Nov 3 2010

Creating screenshots with FFmpeg is slow?

Just a quick note for everyone who’s using FFmpeg for creating screenshots from video files. Today I noticed that FFmpeg can be VERY slow on large/long movie files, but there’s a pretty neat trick to speed up the screenshot generation.

I used to create my screenshots this way:

ffmpeg -i /var/www/input.mov -y -f image2 -ss 1234  -sameq -t 0.001 “/var/www/screenshot.jpg” 2>&1

and on huge files it sometimes took minutes. The solution is simple:

ffmpeg -ss 1234 -i /var/www/input.mov -y -f image2  -sameq -t 0.001 “/var/www/screenshot.jpg” 2>&1

Put the -ss parameter in front of the input file and FFmpeg skips to the selected frame almost instantly.

hf! :)