[Ffmpeg-devel] PTS Confusion (was: ffmpeg-devel Digest, Vol 4, Issue 34)

Kenneth Aafløy kenneth
Sun Jul 17 02:16:16 CEST 2005


Hi,

l?rdag 16. juli 2005, 09:42, skrev Michael Niedermayer:
> On Saturday 16 July 2005 03:16, Kenneth Aafl?y wrote:
> > What is inaccurate in adding the duration together?
> > Is it not the duration of the frame?
> 
> yes and no, duration is calculated based upon the timebase / framerate and the 
> number of fields in a frame for mpeg1/2, if this is summed up over many it 
> could be slightly different from the pts/dts values and so it would ruin AV 
> sync sometimes if you would ignore pts/dts and just use duration

So basically the frame.duration field is not to be relied on, even if it's
calculated from the frame rate, or in the case of audio, the number of frames.

I'm confused, and frankly I dont' know how to explain my confusion, I'll try:

The pts/dts links the streams together, but could the pts/dts differ from
one frame to the next by a fraction of the current frame duration?

> > Currently I'm syncing against the dts value from libavcodec,
> > as that is the one with the least sporadic deviations.
> 
> libavformat just outputs whats in the file and fills in missing information 
> where its not too complicated, and its much easier to fill in missing dts 
> values then missing pts, later would require to read several frames ahead 
> which currently isnt supported but using dts is fine for decoding, after
> all they are identical to the reordered pts values

I got some buffer overflows here, HE ;)

Just to be sure, libavformat/codec does reorder the frames to the
correct order, but _may_ omit to adjust the pts/dts on the frames?

IMHO, sounds to me like this may need addition somewhere.

> PS: no need to CC me, iam subscribed, yes really i cant belive it myself

Sorry, just used to push that button to reply to all,
some exo-list conversations goes a little out of hand :)

Kenneth





More information about the ffmpeg-devel mailing list