Generate Video Thumbnails using Terminal on a Mac

I use a hosted service that does not support video services like ffmpeg. That means that if I use a software package like Piwigo that supports automatic video thumbnailing, I can’t take advantage of that feature. I can however upload my own thumbnail of a video, and if its the same file name (ex: vacation.mp4 and vacation.png) then it will automatically apply that image to my video. I wasn’t able to find a thumbnail generator that worked well and was free. Enter Terminal and the built in services to a Mac.

qlmanage -t -s 512 your_video.mp4 -o .

This command will use the QuickLook Manager utility to generate a 512 sized thumbnail and output it to the current directory. I wrote a quick one-liner to generate for all the videos in my directory that I wanted to upload.

for i in `ls`; do qlmanage -t -s512 $i -o .; done

Then another one-liner to remove the double file extension.

for i in `ls | grep png`; do mv $i `echo $i | cut -d”.” -f1,3`; done

As with all of my scripts, its not the most elegant way to do it, but it works.