[FFmpeg-devel] A change in r_frame_rate values after upgrade to FFmpeg 6.1

Tobias Rapp t.rapp at noa-archive.com
Tue Sep 24 17:26:33 EEST 2024


On 15/09/2024 14:41, Anton Khirnov wrote:

> Quoting Antoni Bizoń (2024-09-13 15:20:16)
>> Hello,
>> I recently upgraded FFmpeg to version 6.1 in my web application and
>> encountered a change while running my app's tests. After the upgrade,
>> ffprobe reported an r_frame_rate of 60/1 instead of the expected 30/1
>> for two videos in my test suite.
> r_frame_rate does not mean what you probably think it means, and is
> actually NOT guaranteed to be a frame rate of anything. See if
> avg_frame_rate doesn't work better.

I also stumbled over the reported issue with r_frame_rate some time ago 
when migrating to v6.1, and from what I remember using avg_frame_rate 
caused other files in my test-set to report a rate that is slightly off.

Finally I chose to workaround the issue by using a simple heuristic when 
detecting the media frame-rate value in my application: When the float 
representation of avg_frame_rate is more than 10% below r_frame_rate it 
uses avg_frame_rate, otherwise it keeps using r_frame_rate. That seemed 
to cover those situations where r_frame_rate is actually set to the 
field rate.

Regards,
Tobias




More information about the ffmpeg-devel mailing list