[Ffmpeg-devel] Possible bug in reading PTS/DTS

Luca Abeni lucabe72
Mon Apr 23 11:50:15 CEST 2007

Hi Michel,

Michel Bardiaux wrote:
>> (If the problem really is in the user application, I can prepare and 
>> send a patch fixing ffmpeg.c and ffserver.c)
>> Or maybe the problem is in my (mis)understanding of this issue?
> I'm not sure the problem is in decoding. I find it rather strange that 
> the first frame, which is a keyframe, does not have PTS=DTS.
I do not know... I see that for containers that store both PTS and DTS, 
ffmpeg generally generates
DTS = PTS - frame period
for video (I am not using B frames, to simplify the testing). Is this 
wrong? If yes, then I think there is something to fix in the encoding / 
muxing side.

Anyway, even if DTS == PTS the problem will be only delayed (it will 
appear as soon as timestamp will cross the 33bit boundary).

> That said, given a file with timestamps crossing the 33-bits boundary, I 
> dont think the solution should be to reproduce internally the deficiency 
> of the container.
Ok, I see your point. This is why I asked :)
Just to see if I got you right: are you saying that user applications 
should not care about st->pts_wrap_bits?
If this is the case, then the error is likely in libavformat/utils.c

Let's see what Michael says...


More information about the ffmpeg-devel mailing list