ffmpeg can't extract screenshot from webm if -loop 1 not included, fails silently
|Reported by:||Fredrick Brennan||Owned by:|
|Blocking:||Reproduced by developer:||no|
|Analyzed by developer:||no|
I own a site (8ch.net) where users are allowed to upload arbitrary WEBM (VP9/Opus or VP8/vorbis) and MP4 (H264/AAC only) files so long as they are under 8MB. Therefore, many users have come up with tricks and codec parameters to tune their files to try to get them to be under the limit.
one-frame-webm-bug.webm ( uploaded to FTP, also available at https://media.8ch.net/test/src/1425957831333.webm ) was generated with the command:
ffmpeg -i shot0002.jpg -i happening.aac one-frame-webm-bug.webm
Browsers (Chrome and Firefox) understand this just fine. They display the image and then play the audio while leaving the image up for the entirety of the video. -loop 1 is not necessary and just a waste of filesize.
However, my thumbnailing routine does this command (log attached):
ffmpeg -y -strict -2 -ss 10 -i one-frame-webm-bug.webm -an -vframes 1 -f mjpeg -vf scale=255:-1 test.jpg
ffmpeg fails because it's asking for frame 10 when only frame 0 was specified.
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)
What's even more annoying is it exits with 0 so I can't even detect there was an error and then run the command again with -ss 0.
Please do not tell me "just use -loop 1", this is a user generated content site and as I said -loop 1 is a waste of filesize with no benefit because all players (even ffplay) understand it correctly, only ffmpeg doesn't.
Please either change the exit status to something non-zero because this is obviously a failure or fix the underlying bug where it doesn't understand the video file correctly.
Tested on versions 1.2.6, 2.5.4 and 2.6. Happens on all of them.