Dead handy, this:
ffmpeg -ss 0.5 -i inputfile.mp4 -t 1 -s 480x300 -f image2 imagefile.jpg
The various options:
-t 1: limit to 1 frame extracted-ss 0.5: point of movie to extract from (ie seek to 0.5 seconds)-s 480x300: frame size of image to output (image resized to fit dimensions)-f image2: forces format
I use this to generate preview stills for jwplayer to use. Dead handy!
Edit: Thanks to reader DieBagger who pointed out it is much faster to place the seek argument before the input file.
by Basti
21 Mar 2011 at 10:45
Nice, exactly what I was looking for =)
by DieBagger
17 Jun 2011 at 20:05
Thx man,
one suggestion though: if you put the -ss in front of -i, ffmpeg will seek to the given position much faster…
by Robert
27 Jun 2011 at 15:47
Hey DieBagger, thanks for the tip, I will test and confirm that! Why does the order of the arguments matter in this case, can you say?
by Robert
27 Jun 2011 at 15:56
Well, there’s a quite clear difference there! It would be good to know exactly why it works this way though.
by Charles Watson
07 Jul 2011 at 14:24
Yeah…I frequently use FFMPEG for extract single image from video. Thanks mate
by Rob
20 Jul 2011 at 14:23
Putting the -ss before the -i is faster (and less precise) because ffmpeg does not decode the video to find the frame. I think this has something to do with keyframes. Because of this I have found it to be problematic with some videos that will produce a gray frame, whereas putting the -ss after the -i will work fine (though of course much slower).
by Robert
20 Jul 2011 at 14:40
Thanks Rob! So it’s a case of ‘try -ss -i, but if that doesn’t work, try -i -ss’ then.