[Ffmpeg-devel] Re: [PATCH] PKT_FLAG_B

Uoti Urpala uoti.urpala
Mon Jul 31 17:14:01 CEST 2006

On Mon, 2006-07-31 at 16:40 +0200, Baptiste Coudurier wrote:
> >> MOV muxer, it's not mandatory, but It will help deciding whether to put
> >> 'ctts' atom or not. Like I said I got some mpeg samples with P frames
> >> only and those don't need ctts atom, however detection based on pts/dts
> >> is not really accurate since difference is still 1 and that will create
> >> 'ctts' atom.
> > 
> > As discussed on IRC I don't believe that using PKT_FLAG_B for this would
> > be the correct behavior.
> Well, Im pretty much for a better alternative. What do you propose ?

If the mov stts atom is supposed to represent dts in the sense "the pts
of the output frame (if any) that the decoder will output when fed this
input frame, assuming standard buffering behavior in the decoder" then
you need to create separate ctts atoms when the decoder will delay the
stream, even if there are only P frames. You can determine this by
checking whether pts != dts for any of the frames. If you're currently
doing this then I think the behavior is most likely correct.

If it's OK to omit separate ctts atoms as long as pts are monotonous (I
doubt this is the intended semantics) then you can check directly for
that condition.

More information about the ffmpeg-devel mailing list