[FFmpeg-user] How can I get a duration and fps of any video that corresponds with the number of frames that can be read?

Phil Rhodes phil_rhodes at rocketmail.com
Thu Aug 6 00:42:18 EEST 2020

 > AFAICT, no video tool has solved this without running the entire stream. You might take one approach for fixed-rate containers/encodings and another for 

It might be worth adding that there is a frame-count field available in several container formats, but it is very rarely correctly set. I've worked extensively with AVIs that have frame-count fields which were neither zeroed, nor set to the actual frame count. So, don't trust 'em unless you trust the application that wrote the file, and even then that would be a "trusting the file" smell.

More information about the ffmpeg-user mailing list