Fastest way to extract frames using ffmpeg?

Stpn picture Stpn · Jun 9, 2012 · Viewed 237.9k times · Source

Hi I need to extract frames from videos using ffmpeg.. Is there a faster way to do it than this:

ffmpeg -i file.mpg -r 1/1 $filename%03d.jpg

?

Answer

Multimedia Mike picture Multimedia Mike · Jun 9, 2012

If the JPEG encoding step is too performance intensive, you could always store the frames uncompressed as BMP images:

ffmpeg -i file.mpg -r 1/1 $filename%03d.bmp

This also has the advantage of not incurring more quality loss through quantization by transcoding to JPEG. (PNG is also lossless but tends to take much longer than JPEG to encode.)