[Ffmpeg-devel] [PATCH] fix frame duration computation in find_stream_infos

Fred Rothganger fred
Sat Mar 31 15:44:36 CEST 2007

Michael Niedermayer wrote:
> NO r_frame_rate is not the average framerate

We need something like "useful_frame_rate" that matches our intuitive 
notions of the true speed of the file.  :)

In particular, I need a value that allows me to calculate a timestamp 
based on a frame number in a fixed rate video.  Unfortunately, it seems 
that the fixed rate videos in my possesion, and apparently in the 
possession of others as well, don't have clean enough timestamps to 
produce a usable r_frame_rate.

You've explained in a previous thread that the job of r_frame_rate is to 
give the (inverse of the) smallest time quantum that all the timestamps 
in the file fall on.  In a mixed frame rate file this will be something 
like the LCM of the framerates.  In that thread you agreed to the idea 
of adding an "avg_frame_rate", but I still haven't gotten around to it.  :)

A coworker of mine described a variable rate video he generated in which 
some frames last over a minute and others less than a second.  This is 
probably an extreme case, but it is an existence proof that average 
frame rate can be made useless.  However, it should be possible to 
determine the true frame rate of an essentially fixed-rate video using 
the average.

-- Fred

More information about the ffmpeg-devel mailing list