[FFmpeg-devel] [PATCH] simplify ipmovie.c pts calculation

Reimar Döffinger Reimar.Doeffinger
Thu Feb 26 19:31:04 CET 2009


On Thu, Feb 26, 2009 at 07:01:49PM +0100, Michael Niedermayer wrote:
> On Thu, Feb 26, 2009 at 06:47:23PM +0100, Reimar D?ffinger wrote:
> > On Thu, Feb 26, 2009 at 05:14:16PM +0100, Michael Niedermayer wrote:
> > > why does lavf fail?
> > > could you print the duration from the packets (i mean pts-last_pts) ?
> > > if they are (near) multiplies of some integer lavf should find the
> > > timebase, if OTOH they are random then 1/1m is maybe the best timebase
> > > in which these can be specified exactly
> > 
> > Can you point me to the code that does this guessing? I didn't find it.
> 
> see code calling tb_unreliable() in lavf/utils.c

Maybe that is just a bad name, but the time base is not unreliable, not
a bit, it is 100% exact. It just has no relation with the frame rate
(admittedly, tb_unreliable checks if the time_base would make a valid
frame rate).
Obviously, the code around line 2192 in utils.c is supposed to fix up
that kind of thing.
I guess the error is in that completely unexplained and mysterious
calculation of the initial best_error value.
The value for this is
0.000029
On the other hand the "error" value of a frame rate of 15000/1001 is
0.012646
Thus it is not selected, even though 15000/1001 is about
14.9850
compared to the exact value of 1000000/66728 with
14.9862

Greetings,
Reimar D?ffinger




More information about the ffmpeg-devel mailing list