<p>Greetings all,</p><p>I am writing a wrapper class for video/audio encoding by following the "muxing.c".<br><a href="http://ffmpeg.org/doxygen/trunk/muxing_8c-source.html">http://ffmpeg.org/doxygen/trunk/muxing_8c-source.html</a></p>
<p>I see in the example that before writing frames to the file ,is checks whether the PTS value of audiostream is <br>lesser than that of videostream.</p><p>code snippet:</p><p> if (!video_st || (video_st && audio_st && audio_pts < video_pts)) {<br>
write_audio_frame(oc, audio_st);<br> } else {<br> write_video_frame(oc, video_st);<br> picture->pts++;<br> }</p><p>Can someone explain why this test is done? Whats the connection between PTS values ?</p>
<p> </p>