[Libav-user] x264 pts values when muxing with libavformat

Carl Lindqvist lulebo at gmail.com
Mon Jun 4 09:51:52 CEST 2012


I am trying to encode video with x264 and mux using something similar to
the example muxing.c.

To get to the settings of x264 easier, I am not using libavcodec to encode,
but x264 directly. Libavcodec is used for audio and muxing with libavformat.

The problem I am having is setting the correct pts values. When I play the
files the frames are not even shown in the correct order. I am not really
sure how to set the pts correctly.

I can set the pts before frames go in to x264 for encoding, and I have
tried using just a frame counter. I have tried to set the avpacket pts to
the pic_out pts value from x264, but I think it's in the wrong form. I need
to convert this number somehow.

Does someone have a link to a good explanation of pts times and dts times
of h264? And how to set them correctly in libavformat?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20120604/22aad535/attachment.html>

More information about the Libav-user mailing list