From a7d95461ee9f8c898d857103eb39049d0c652398 Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Sat, 12 Aug 2023 15:24:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=87=E6=BB=A4=E6=8E=89=E4=B8=8D=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E7=9A=84webrtc=20rtp=20ext=EF=BC=8C=E6=8F=90=E9=AB=98?= =?UTF-8?q?webrtc=E8=BD=AC=E5=8F=91=E5=85=BC=E5=AE=B9=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在测试obs simulcast推流时,发现chrome无法正常播放, 分析rtp ext扩展,发现是rtp mid ext未过滤导致, zlmediakit在回复answer sdp时,已申明不支持mid扩展, 但是obs并未理会还是发送mid扩展。 根据answer sdp过滤rtp ext可兼容此问题。 --- webrtc/WebRtcTransport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webrtc/WebRtcTransport.cpp b/webrtc/WebRtcTransport.cpp index 031710e8..127a1987 100644 --- a/webrtc/WebRtcTransport.cpp +++ b/webrtc/WebRtcTransport.cpp @@ -515,7 +515,7 @@ void WebRtcTransportImp::onStartWebRTC() { _pt_to_track.emplace(track->plan_rtx->pt, std::unique_ptr(new WrappedRtxTrack(track))); } // 记录rtp ext类型与id的关系,方便接收或发送rtp时修改rtp ext id - track->rtp_ext_ctx = std::make_shared(*m_offer); + track->rtp_ext_ctx = std::make_shared(m_answer); weak_ptr weak_track = track; track->rtp_ext_ctx->setOnGetRtp([this, weak_track](uint8_t pt, uint32_t ssrc, const string &rid) { // ssrc --> MediaTrack