javascript - 'setRemoteDescription'上执行 'RTCPeerConnection'失败 : Failed to set remote answer sdp

标签 javascript android webrtc phpwebsocket

我已经通过浏览器实现了用于视频音频调用的 WebRTC。我正在使用最新的 adapter.js .我也为原生 android 应用程序实现了 WebRTC。我的信令服务器基于 php WebSocket(Ratchet websocket)。当我在两个浏览器(chrome-chrome 或 chrome-firefox 组合)中测试我的实现时,我看到协议(protocol)运行良好。我的意思是视频-音频通话正常。当我测试我的 android 应用程序时,我可以看到它也适用于应用程序到应用程序的通信。

但问题是,当我尝试从我的 android 应用程序向 Web 应用程序发出调用时,我看到 setRemoteDescription 不起作用,而是产生以下错误:

Failed to execute 'setRemoteDescription' on 'RTCPeerConnection': Failed to set remote answer sdp: Media section has more than one track specified with a=ssrc lines which is not supported with Unified Plan.

在我的 gradle(app) 脚本中,我实现了 WebRTC 库,如下所示:
implementation 'org.webrtc:google-webrtc:1.0.+'

这就是为什么我认为最新的adapter.js (对于 web 部分)和 android 库应该兼容,并且不存在与 web 实现和 android 实现之间的版本不兼容相关的问题。

为了更好地理解,我在这里分享生成报价时发现的 SDP 消息。
v=0
o=- 7452034467634633423 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1
a=msid-semantic: WMS 90 BOLNAOPqVHAtxWW2PZJyA5RG9IkH2MntC2EP
m=audio 9 UDP/TLS/RTP/SAVPF 111 103 9 0 8 105 13 110 113 126
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:KwHG
a=ice-pwd:YhH0S06F5dJrCns9jFbscFMA
a=ice-options:trickle renomination
a=fingerprint:sha-256 B1:75:DB:D5:20:8C:86:F1:CC:54:4A:1C:C6:C9:AD:D3:79:C4:1E:45:57:CD:9B:FC:CC:1D:01:C5:C1:C5:BF:93
a=setup:active
a=mid:0
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=sendrecv
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
a=rtpmap:103 ISAC/16000
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:105 CN/16000
a=rtpmap:13 CN/8000
a=rtpmap:110 telephone-event/48000
a=rtpmap:113 telephone-event/16000
a=rtpmap:126 telephone-event/8000
a=ssrc:2787512374 cname:dF4uE3SebLpSsKGh
a=ssrc:2787512374 msid:90 101
a=ssrc:2787512374 mslabel:90
a=ssrc:2787512374 label:101
a=ssrc:4286803808 cname:dF4uE3SebLpSsKGh
a=ssrc:4286803808 msid:BOLNAOPqVHAtxWW2PZJyA5RG9IkH2MntC2EP cf5d6c28-239b-4c64-8051-33dbbb81edf4
a=ssrc:4286803808 mslabel:BOLNAOPqVHAtxWW2PZJyA5RG9IkH2MntC2EP
a=ssrc:4286803808 label:cf5d6c28-239b-4c64-8051-33dbbb81edf4
m=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 108 109 124
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:KwHG
a=ice-pwd:YhH0S06F5dJrCns9jFbscFMA
a=ice-options:trickle renomination
a=fingerprint:sha-256 B1:75:DB:D5:20:8C:86:F1:CC:54:4A:1C:C6:C9:AD:D3:79:C4:1E:45:57:CD:9B:FC:CC:1D:01:C5:C1:C5:BF:93
a=setup:active
a=mid:1
a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:4 urn:3gpp:video-orientation
a=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
a=extmap:10 http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07
a=sendrecv
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:96 VP8/90000
a=rtcp-fb:96 goog-remb
a=rtcp-fb:96 transport-cc
a=rtcp-fb:96 ccm fir
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
a=rtpmap:97 rtx/90000
a=fmtp:97 apt=96
a=rtpmap:98 VP9/90000
a=rtcp-fb:98 goog-remb
a=rtcp-fb:98 transport-cc
a=rtcp-fb:98 ccm fir
a=rtcp-fb:98 nack
a=rtcp-fb:98 nack pli
a=rtpmap:99 rtx/90000
a=fmtp:99 apt=98
a=rtpmap:108 red/90000
a=rtpmap:109 rtx/90000
a=fmtp:109 apt=108
a=rtpmap:124 ulpfec/90000
a=ssrc-group:FID 1166964128 3959308542
a=ssrc:1166964128 cname:dF4uE3SebLpSsKGh
a=ssrc:1166964128 msid:90 100
a=ssrc:1166964128 mslabel:90
a=ssrc:1166964128 label:100
a=ssrc:3959308542 cname:dF4uE3SebLpSsKGh
a=ssrc:3959308542 msid:90 100
a=ssrc:3959308542 mslabel:90
a=ssrc:3959308542 label:100
a=ssrc-group:FID 1617372799 1848430645
a=ssrc:1617372799 cname:dF4uE3SebLpSsKGh
a=ssrc:1617372799 msid:BOLNAOPqVHAtxWW2PZJyA5RG9IkH2MntC2EP b4a261f3-065b-47bd-a759-207401cb9a6e
a=ssrc:1617372799 mslabel:BOLNAOPqVHAtxWW2PZJyA5RG9IkH2MntC2EP
a=ssrc:1617372799 label:b4a261f3-065b-47bd-a759-207401cb9a6e
a=ssrc:1848430645 cname:dF4uE3SebLpSsKGh
a=ssrc:1848430645 msid:BOLNAOPqVHAtxWW2PZJyA5RG9IkH2MntC2EP b4a261f3-065b-47bd-a759-207401cb9a6e
a=ssrc:1848430645 mslabel:BOLNAOPqVHAtxWW2PZJyA5RG9IkH2MntC2EP
a=ssrc:1848430645 label:b4a261f3-065b-47bd-a759-207401cb9a6e

最佳答案

你可以试试:rtcConfiguration.sdpSemantics = PeerConnection.SdpSemantics.PLAN_B;来自错误:“媒体部分有多个使用 a=ssrc 行指定的轨道,即 统一计划不支持。
Fwiw Unified 计划是默认的(我相信)并且设置为rtcConfiguration.sdpSemantics = PeerConnection.SdpSemantics.UNIFIED_PLAN;

关于javascript - 'setRemoteDescription'上执行 'RTCPeerConnection'失败 : Failed to set remote answer sdp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55378987/

相关文章:

javascript - 为什么我在这个问题上总是得到错误的答案?

java - 寻找如何均匀生成敌人的想法

javascript - 如何以编程方式播放刚在HTML5中录制的webm音频?

javascript - WebRTC鼠标指针

javascript - 为什么这个partialFilterExpression会抛出错误?

javascript - 需要使用 UglifyJsPlugin webpack 禁用 CSS 而不是 JS 的缩小

android - 如何在 Android 中只过滤掉相关的媒体文件?

javascript - 允许 WebRtc 应用程序的用户通过 javascript 下载 webrtc 日志

javascript - GoJS中如何动态添加Node数据和Link数据?

Android Vine/Instagram 风格的视频录制