[Libav-user] How to sync audio and video streams with pts & dts timestamps while writing a webm file using libavformat

ravikiran.bs ravikiran.bs at zohocorp.com
Tue Nov 7 15:47:57 EET 2017


I am using FFMpeg libavformat library to generate a webm file from RTP video and audio streams that I receive on my server. I receive already encoded streams. Video - vp8 encoded and audio - opus encoded.

I will have RTP timestamps for both the streams and NTP timestamps for the corresponding RTP packets from the RTCP. Now how do I set PTS and DTS of AVPacket with these values ? I parse the video byte stream to get frame wise byte array and I will have the timestamps mentioned above. So, while constructing AVPacket, how should I set the timestamps so that audio and video will be in sync properly in my final output file ?


Ravi Kiran B S

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20171107/1400658c/attachment.html>

More information about the Libav-user mailing list