ffprobe icon indicating copy to clipboard operation
ffprobe copied to clipboard

whats the difference between r_frame_rate and avg_frame_rate ?

Open komalpharate opened this issue 7 years ago • 4 comments

Hi, I want to know about r_frame_rate and avg_frame_rate significance. these are the output parameters.

komalpharate avatar Feb 26 '18 08:02 komalpharate

r_frame_rate is "the lowest framerate with which all timestamps can be represented accurately (it is the least common multiple of all framerates in the stream)."

avg_frame_rate is total duration / total # of frames

s-fletcher avatar May 29 '21 18:05 s-fletcher

r_frame_rate is "the lowest framerate with which all timestamps can be represented accurately (it is the least common multiple of all framerates in the stream)."

avg_frame_rate is total duration / total # of frames

Minor correction. I think the avg_frame_rate is total # of frames / total duration. The denominator and the numerator is changed. (30 frames in 1 sec = 30 fps) And I want to know the source about the avg_frame_rate. I was able to find this thread, but I couldn't find the same info from the documentation.

knowblesse avatar May 02 '22 02:05 knowblesse

I think it is more accurate to say that avg_frame_rate is (nb_frames / time_base ) "/" duration_ts

Essentially the total duration is calculated based off the time_base (Usually tbn) multiplied by the largest presentation timestep in the file (duration_ts).

eliotalanfoss avatar Feb 15 '24 21:02 eliotalanfoss

Sorry to re-awaken this thread, but...

Since nb_frames is the number of frames in a stream, not the number of frames which are going to be displayed from the stream (because some frames in the stream can be "hidden" by edit lists, and that there can be frames in a stream past the end of the duration of a stream) and duration_ts is the actual duration that the non-"hidden" frames will be played for - avg_frame_rate can be nonsense for some files.

himslm01 avatar Mar 17 '24 23:03 himslm01