[Ffmpeg-devel] [Fwd: Is AVFrame->pts really set by libavcodec when decoding?]

Michael Niedermayer michaelni
Wed Apr 18 17:58:51 CEST 2007


On Wed, Apr 18, 2007 at 02:51:03PM +0200, Luca Abeni wrote:
> Hi Michael,
> thanks for the reply.
> Michael Niedermayer wrote:
> [...]
> >>But a simple test [*] showed that such field is not touched by
> >>libavcodec, or is set to 0 (depending on the codec), at least when
> >>decoding mpeg1/2 and raw video.
> >>
> >>Is this a bug in libavcodec, a bug in the documentation, or something 
> >>else?
> >
> >AVFrame.pts is set to the pts which is stored in the stream, if the stream
> >does not store any PTS AVFrame.pts should be AV_NOPTS_VALUE
> Ok, so there seems to be a bug both in mpeg1/2 and raw video handling 
> (when decoding mpeg pts is always set to 0, when decoding raw video it 
> is not changed).
> If I find the time, I'll try to prepare a patch for this. Where should 
> the timestamp be set? (in the decoder, in the generic - util.c - code, 
> in the parser, or...?)

avcodec_get_frame_defaults() already sets it to AV_NOPTS_VALUE, if it
becomes 0 it either was overriden or the AVFrame was not properly allocated

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070418/24d46700/attachment.pgp>

More information about the ffmpeg-devel mailing list