ffmpeg image thumbnail every minute, seconds… the math!

 

This will create one thumbnail image every minute, named img001.jpg, img002.jpg, img003.jpg, … (%03d means that ordinal number of each thumbnail image should be formatted using 3 digits)

ffmpeg -i myvideo.avi -f image2 -vf fps=fps=1/60 img%03d.jpg

This will create one thumbnail image every 10 minutes, named thumb0001.bmp, thumb0002.bmp, thumb0003.bmp, …

ffmpeg -i test.flv -f image2 -vf fps=fps=1/600 thumb%04d.bmp

This will create one thumbnail image every I-frame, named thumb0001.bmp, thumb0002.bmp, thumb0003.bmp, …

https://trac.ffmpeg.org/wiki/Create%20a%20thumbnail%20image%20every%20X%20seconds%20of%20the%20video

So, we can use some logical/math to make some conclusions…
1/60 stands for 1 thumb at each 60 seconds,  the same as say each minute…
1/600 stands for 1 thumb at each 60 seconds * 10, the same as say each 10 minutes…

if we want a thumb at each 2 minutes we should multiply the 60 per 2, that will gives us 1/120… this way we can also assume that if we want a thumb at each 4 seconds, we can use 1/4.

Useful link
https://trac.ffmpeg.org/wiki/Create%20a%20thumbnail%20image%20every%20X%20seconds%20of%20the%20video

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.