RTC: Fix rtc to rtmp sync timestamp using sender report.#2470
RTC: Fix rtc to rtmp sync timestamp using sender report.#2470winlinvip merged 12 commits intoossrs:4.0releasefrom
Conversation
Codecov Report
@@ Coverage Diff @@
## 4.0release #2470 +/- ##
==============================================
+ Coverage 59.03% 59.33% +0.29%
==============================================
Files 122 122
Lines 51367 51556 +189
==============================================
+ Hits 30326 30592 +266
+ Misses 21041 20964 -77 | Impacted Files | Coverage Δ | |' Translated to English while maintaining the markdown structure: '| Impacted Files | Coverage Δ | | Translated to English while maintaining the markdown structure: '| trunk/src/app/srs_app_rtc_codec.cpp | Continue to review full report at Codecov.
Translated to English while maintaining the markdown structure: '>
|
bf2c3a1 to
5e87627
Compare
In the scenario of converting WebRTC to RTMP, this conversion will not proceed until an SenderReport is received; for reference, see: #2470. Thus, if HTTP-FLV streaming is attempted before the SR is received, the FLV Header will contain only audio, devoid of video content. This error can be resolved by disabling `guess_has_av` in the configuration file, since we can guarantee that both audio and video are present in the test cases. However, in the original regression tests, the `TestRtcPublish_HttpFlvPlay` test case contains a bug: https://github.com/ossrs/srs/blob/5a404c089baa93b906d2452ef47e2ba8a9e6211c/trunk/3rdparty/srs-bench/srs/rtc_test.go#L2421-L2424 The test would pass when `hasAudio` is true and `hasVideo` is false, which is actually incorrect. Therefore, it has been revised so that the test now only passes if both values are true. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: winlin <winlinvip@gmail.com>
In the scenario of converting WebRTC to RTMP, this conversion will not proceed until an SenderReport is received; for reference, see: #2470. Thus, if HTTP-FLV streaming is attempted before the SR is received, the FLV Header will contain only audio, devoid of video content. This error can be resolved by disabling `guess_has_av` in the configuration file, since we can guarantee that both audio and video are present in the test cases. However, in the original regression tests, the `TestRtcPublish_HttpFlvPlay` test case contains a bug: https://github.com/ossrs/srs/blob/5a404c089baa93b906d2452ef47e2ba8a9e6211c/trunk/3rdparty/srs-bench/srs/rtc_test.go#L2421-L2424 The test would pass when `hasAudio` is true and `hasVideo` is false, which is actually incorrect. Therefore, it has been revised so that the test now only passes if both values are true. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: winlin <winlinvip@gmail.com>
Referenced this article: https://mp.weixin.qq.com/s/Tmr2Qk-h2BRa276_YFaBig
WebRTC uses SenderReport to synchronize the timestamps of audio and video during streaming. Without receiving SenderReport, it is impossible to determine the synchronization time. Therefore, it is not forwarded to RtmpFromRtcBridge to avoid further issues with rtmp/hls/flv/dvr caused by timestamp problems in the source stream.
TRANS_BY_GPT3