| | 1 | If you want to extract just a single frame from the video into an image file, you can use the following command line: |
| | 2 | {{{ |
| | 3 | ffmpeg -i input.flv -ss 00:00:14.435 -f image2 -vframes 1 out.png |
| | 4 | }}} |
| | 5 | |
| | 6 | This will seek to the position of 0h:0m:14sec:435msec into the movie and extract one frame (-vframes 1) from that position into a png file. |
| | 7 | |
| | 8 | But, what if you want to extract thumbnails periodically? This will create one thumbnail image every second, named out1.png, out2.png, out3.png, ... |
| | 9 | {{{ |
| | 10 | ffmpeg -i input.flv -f image2 -r 1 out%d.png |
| | 11 | }}} |
| | 12 | |
| | 13 | This will create one thumbnail image every minute, named img001.jpg, img002.jpg, img003.jpg, ... |
| | 14 | ''(%03d means that ordinal number of each thumbnail image should be formatted using 3 digits)'' |
| | 15 | {{{ |
| | 16 | ffmpeg -i myvideo.avi -f image2 -r 1/60 img%03d.jpg |
| | 17 | }}} |
| | 18 | |
| | 19 | This will create one thumbnail image every 10 minutes, named thumb0001.bmp, thumb0002.bmp, thumb0003.bmp, ... |
| | 20 | {{{ |
| | 21 | ffmpeg -i test.flv -f image2 -r 1/600 thumb%04d.bmp |
| | 22 | }}} |
| | 23 | |
| | 24 | '''Explanation:''' |
| | 25 | By telling FFmpeg to set the output file's FPS option (frames per second) to some very low value, we made FFmpeg drop a lot of frames at the output, in order to achieve such a low frame rate, effectively having our thumbnails generated every X seconds :) |
| | 26 | |
| | 27 | '''See also:''' |
| | 28 | [[Create a video slideshow from images]] |