[FFmpeg-devel] [PATCH][RFC] set codec time base to format time base at the end

Baptiste Coudurier baptiste.coudurier
Thu Jun 11 07:08:35 CEST 2009

On 5/29/2009 2:40 PM, Michael Niedermayer wrote:
> On Thu, May 28, 2009 at 06:04:22PM -0700, Baptiste Coudurier wrote:
>> Hi
>> $subject,
>> This will leave codec timebase unset and therefore being unreliable,
>> which is the case IMHO, but I'm not sure of the implications.
> iam not sure either but i fear that this may have unexpected sideeffects
> but then maybe not ...
>> wrong_framerate.mov on mplayerhqhu which is detected as 59.94 instead of
>> 29.97 because the first frame duration has 150 duration instead of 100
>> on a 2997 timescale.
> strictly speaking 59.94 is more correct for this one
>> This is problematic when transcoding to mpeg2.
> yes and this is what i think i discussed with reimar IIRC
> which is the guessed timebase really depends on what it is used for
> For transcoding to mpeg2 it must be one of a small fixed set, no matter
> what
> And for avi it can be an arbitrary fraction but it is very strongly
> preferred for that fraction to be a large value (like 1/30 or 1001/24000
> but not 1/24000)
> In that sense i belive the timbase guessing code should be extended by
> a few flags or something that tell it what the user app really wants 

Ok, what about finally adding a avg_frame_rate to AVFormatContext and
display this to the user ? That would be better I think.

What about using it when transcoding ? I mean if output is mpeg2 at 25
fps, code must deal with it correctly no matter what, so sync code must
be flexible.

I know by experience that avg frame rate is reasonable for mov/3gp/mp4
and that's what quicktime displays.

Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org

More information about the ffmpeg-devel mailing list