I've been using FFmpeg to extract single frames into an image. Though some Googling, it turns out that running:
ffmpeg.exe -i video.avi -ss 00:30:00 -y -an -vframes 1 test.png
...runs SIGNIFICANTLY slower than the following, which is nearly identical, but instantaneous:
ffmpeg.exe -ss 00:30:00 -i video.avi -y -an -vframes 1 test.png
The only difference is the order of -i and -ss. Is this an intentional 'feature'? Is there some sort of technical reason for the difference here?
This is an educated guess. When -ss
occurs before -i
, it is treated as instructions for the input, so the first frame of the video stream is the one at 30 seconds. When -ss
occurs after -i
, it is treated as an effect, and the first 30 seconds of frames are read and dropped, leading to a performance difference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With