[Libav-user] PTS values and writing encoded audio and video frames ?

ashika umanga umanga.forums at gmail.com
Thu Apr 12 07:44:09 CEST 2012


Greetings all,

I am writing a wrapper class for video/audio encoding by following the
"muxing.c".
http://ffmpeg.org/doxygen/trunk/muxing_8c-source.html

I see in the example that before writing frames to the file ,is checks
whether the PTS value of audiostream is
lesser than that of videostream.

code snippet:

 if (!video_st || (video_st && audio_st && audio_pts < video_pts)) {
            write_audio_frame(oc, audio_st);
        } else {
            write_video_frame(oc, video_st);
            picture->pts++;
        }

Can someone explain why this test is done? Whats the connection between PTS
values ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20120412/82e8358c/attachment.html>


More information about the Libav-user mailing list