[Ffmpeg-devel] PTS values
Wed Jan 3 03:38:03 CET 2007
On Wed, Jan 03, 2007 at 01:23:28AM +0100, Anders Moden wrote:
> 3 jan 2007 kl. 00.25 skrev Anders Moden:
> >19 dec 2006 kl. 23.06 skrev Paul Curtis:
> >>Anders Moden wrote:
> >>>Is there any docs that explains the various pts values found in
> >>>the stream, the image and the codec. i can find at least 4 pts
> >>>struct members with various values when decoding?
doxygen / RTFS
> >>That was my problem, also. The discussion concerned which values
> >>were valid after a call to audio_decode or video_decode with
> >>"finished" == true. After much experimentation, I found the
> >>cur_dts to have a valid, monotonically increasing value that was
> >>usable for the encoder.
> >>I never did find any docs that explained when each of the pts/dts
> >>values were valid ... so I built a small program that did nothing
> >>but print the values out. I never got a firm answer on which ones
> >>I should use ....
lav* exports what is stored in the file and fills in what is missing when
it can be guessed correctly with high certainity
now there are files which simply dont contain enough information to
guess some timestamps, and there are files which simply contain
inconsistant timestamps, some which reset timestamps to 0 at random
points and such, it can easily be shown that this cannot be corrected
without timeconsuming things like reading through the whole file
also what you want to use depends on what you do with the data, sorry but
there is no single universal timstamp, there are many
and i suggest that everyone who doesnt know the difference between pts and
dts looks at the mpeg spec which i think nicely describes what the various
> >Too bad. Havn't found the right discussion yet and I haven't tested
> >the cur_dts yet. However I think it is really bad this information
> >shall be so difficult to find.
> >I think the ffmpeg project needs some proper system description !
> >My original question was why I got unordered pts values using
> >avcodec_decode_video(m_pVideoCodecCtx, m_pFrame, &frameFinished,
> >packet.data, packet.size) in the m_pFrame struct ? Please can
> >someone answer this if the images I get are unsorted then ?
> Ok. Just found a bunch of topics covering PTS etc.
> In my case I have a variable fps so interpolating frame time is
> difficult. Is the cur_dts the answer to this problem ?
AVPacket.dts is likely the timestamp you want
cur_dts is a internal variable which you MUST NOT touch
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
No snowflake in an avalanche ever feels responsible. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
More information about the ffmpeg-devel