RTP lipync同步 [英] RTP lipsync synchronization
问题描述
我有以下数据可供我使用:
u64RTCP_NTP_TS - RTCP发件人报告的NTP时间戳
u32RTCP_TS - RTCP发送者报告中的时间戳
u32AudioRTP_TS - 音频RTP数据包的时间戳记
u32VideoRTP_TS - 视频RTP中的时间戳包
我已经搜索了一个答案,但是我仍然无法清楚地了解如何在计算上实现这一点,我还缺少什么? / p>
确定我已经通过浏览 Live555 ,所以信用额度应该去那里,很多谢谢他们。
答案位于文件 RTPSource.cpp
RTPReceptionStats :: noteIncomingPacket
和 RTPReceptionStats :: noteIncomingSR
将这个想法背后是非常简单的,有一点值得注意的是,
在计算当前时间戳被设置为同步时间戳,并且也可以被RTCP SR报告覆盖(应该是)。
因此, RTSP会话应该具有或多或少的同一时间。
Hi could someone please explain to me how to achieve a lipsync between two RTP streams (from the same RTSP session). I'm trying to calculate proper pts for ffmpeg AVPacket but I'm missing something and I can't get my head around this.
I have the following data available to me:
u64RTCP_NTP_TS - NTP timestamp from RTCP Sender Report
u32RTCP_TS - Timestamp from the RTCP Sender Report
u32AudioRTP_TS - Timestamp from the Audio RTP packet
u32VideoRTP_TS - Timestamp from the Video RTP Packet
I've searched for an answer but still I can't get a clear picture of how this should be achieved calculation-wise, what am I still missing.
Ok I've found the answer by browsing the code of the Live555 so the credits should go there, and many thanks to them for that.
The answer is located in the file RTPSource.cpp
RTPReceptionStats::noteIncomingPacket
and RTPReceptionStats::noteIncomingSR
It's pretty straightforward to get the idea behind, one thing of note is that after calculation the current timestamp is being set as sync timestamp, and can be also overwritten by RTCP SR report (and well it should).
As a result the presentation timestamp for any stream in the RTSP session should have more or less the same time.
这篇关于RTP lipync同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!