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

Måns Rullgård mans
Mon Apr 23 16:49:03 CEST 2007


Baptiste Coudurier wrote:
> M?ns Rullg?rd wrote:
>> Michel Bardiaux wrote:
>>> Luca Abeni wrote:
>>>> 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.
>>> I think so too. My reading of the spec is that in the absence of
>>> B-frames, the DTS are not even necessary;
>>
>> The spec allows PTS != DTS only when B-frames are used.
>
> When low_delay is 0, pts AND dts shall differ for I and P frames, and
> have a delay of 1 (if I understood well). Low delay to 0 does not imply
> B frames.

It allows, but doesn't require, B-frames.  As far as the decoder can tell,
there could be B-frames ahead, and it has to be prepared to deal with them.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list