If you want to add other video extension

add the following code at the end and replace mpeg with your desired video extension (it must be supported by totem)

PHP Code: 
for video in "$1"/*.mpeg;
do
file=${video##*/
}
wext=${file%%.*}
totem-video-thumbnailer -g 18 -s 200 "$video" "$wext".png
done 
Yes, you can have the output to jpeg or jpg

by changing all png throughout the script by jpeg or jpg

-----

If you want to reduce the file size, change 200 (which is the width of each thumbnail) and 18 (which is the number of thumbnail to be taken) to a lower value