[FFmpeg-devel] First time using libavcodec and libavformat

Stephen Dranger dranger
Thu Jun 28 08:20:35 CEST 2007

On 6/28/07, Jon Dufresne <jon.dufresne at infinitevideocorporation.com> wrote:
> I am trying to use libavcodec and libavformat in my program to decode an
> mpeg2 transport stream. I am using the tutorial found here to guide me:
> http://www.inb.uni-luebeck.de/~boehme/using_libavcodec.html
> So far it is working very well. I can demux the stream and play the
> video some what using SDL.
> However, I am a bit confused on how to grab video frame timestamps using
> the tutorial's GetNextFrame(). Specifically I need to get the DTS of the
> video. This information doesn't appear to be in the AVFrame struct and
> the pts that I receive is alway 0.
> So I am a little curious how to go about getting the DTS properly from a
> decoded frame.
> Thanks for any help and the great libraries!
> Jon

I wrote a tutorial that explains how to do this:
http://www.dranger.com/ffmpeg/ Your specific problem is addressed in
step 5: http://www.dranger.com/ffmpeg/tutorial05.html Enjoy!

By the way, might this tutorial end up on the Documentation part of
the web page?

More information about the ffmpeg-devel mailing list