簡體   English   中英

WebRTC:在SDP中添加沒有BUNDLE行的視頻到音頻呼叫

[英]WebRTC: Adding Video To Audio Call With No BUNDLE Lines in SDP

我希望你們中的一位WebRTC專家可以指出我正確的方向,或者告訴我,如果我想要做的是在當前的Chrome瀏覽器中是否可行/支持,或者即使Chrome將來會支持這個用例。

我已經搜索了一個答案並在我的代碼中嘗試了很多東西,但是我無法完成以下工作:

我正在嘗試進行呼叫升級(將視頻添加到現有的僅音頻呼叫), 而沒有SDP中的捆綁線。 我的網絡不支持端口捆綁,所以我需要一個音頻和視頻端口不同的SDP。 我想指出,如果我刪除Bundle行(保持默認SDP),我可以讓它工作。

使用案例:

  1. 在用戶A和用戶B之間設置初始視頻通話
  2. 用戶A進行呼叫降級(通過將視頻端口設置為0來刪除視頻)
  3. 用戶A進行呼叫升級(使用新的getUserMedia再次添加視頻)
  4. 用戶B接受呼叫升級(使用新的getUserMedia再次添加視頻)

注意:在執行任何_pc.setLocalDescription之前,我會以這種方式從SDP中刪除捆綁行:

sessionDescription.sdp = sessionDescription.sdp.replace(/a=group:BUNDLE audio\r\n/g, "");
sessionDescription.sdp = sessionDescription.sdp.replace(/a=group:BUNDLE audio video\r\n/g, "");

這確實有效,因為我在“m = audio”和“m = video”上獲得了不同的端口,這是預期的行為。

您可以使用此客戶端復制行為(只需按照步驟操作,查看最后一步的控制台日志):

http://webrtc.utopicum.com/

結果:

我無法執行升級, 第4步失敗!

基本上,如果呼叫對“m = audio”和“m = video”行使用相同的端口,則瀏覽器只能連續多次成功執行升級。 如果端口不同,則從降級的呼叫轉到再次視頻呼叫不起作用。

這些是我用於執行升級的詳細步驟:

  1. 新的webkitGetUserMedia({audio: true, video: true}, function(stream)...
  2. 刪除現有的流_pc.removeStream(localStream)
  3. 添加新流_pc.addStream(stream)
  4. 創建新的_pc.createOffer
  5. 刪除捆綁線
  6. setLocalSDP _pc.setLocalDescription
  7. 得到冰候選人
  8. 向遠程對等方發送要約

這些是我用來執行降級的詳細步驟:

  1. 創建新商品_pc.createOffer,約束“OfferToReceiveVideo”設置為false
  2. 刪除捆綁線
  3. 將視頻端口設置為0(同樣,確保我們處於“sendrecv”模式)
  4. setLocalSDP _pc.setLocalDescription
  5. 向遠程對等方發送要約

在LOGS中,我可以看到我的用例的第4步的SDP缺少ice-ufrag和ice-pwd,並且視頻端口設置為1 ......

看升級版提供:

v=0
o=- 4834140171951113916 5 IN IP4 127.0.0.1
s=-
t=0 0
a=msid-semantic: WMS z4nWgYpFsPw6UThtfe5tJOwKwfD3WTEl39Dt
m=audio 52158 RTP/SAVPF 111 103 104 0 8 126
c=IN IP4 125.113.122.55
a=rtcp:52159 IN IP4 142.133.123.33
a=candidate:437151159 1 udp 2122260223 142.133.123.33 52158 typ host generation 0
a=candidate:437151159 2 udp 2122260222 142.133.123.33 52159 typ host generation 0
a=candidate:1418565959 1 tcp 1518280447 142.133.123.33 0 typ host tcptype active generation 0
a=candidate:1418565959 2 tcp 1518280446 142.133.123.33 0 typ host tcptype active generation 0
a=ice-ufrag:yTCE4QuOaRby5yJd
a=ice-pwd:KKHBT1dd/0NoScpt8Iiix8ub
a=ice-options:google-ice
a=fingerprint:sha-256 F3:E1:6D:88:FD:B7:DA:55:BB:C8:10:DC:9C:12:C2:9E:C4:E7:49:03:88:C4:7A:10:D1:EA:DA:62:30:85:83:45
a=setup:actpass
a=mid:audio
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=sendrecv
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=fmtp:111 minptime=10
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:126 telephone-event/8000
a=maxptime:60
a=ssrc:2250182501 cname:GVPQmpDpIZXlFcBr
a=ssrc:2250182501 msid:z4nWgYpFsPw6UThtfe5tJOwKwfD3WTEl39Dt 4ef7d31c-eae4-4314-9732-6a100b53e42e
a=ssrc:2250182501 mslabel:z4nWgYpFsPw6UThtfe5tJOwKwfD3WTEl39Dt
a=ssrc:2250182501 label:4ef7d31c-eae4-4314-9732-6a100b53e42e
m=video 52169 RTP/SAVPF 100 116 117 96
c=IN IP4 125.113.122.55
a=rtcp:52170 IN IP4 142.133.123.33
a=candidate:437151159 1 udp 2122260223 142.133.123.33 52169 typ host generation 0
a=candidate:437151159 2 udp 2122260222 142.133.123.33 52170 typ host generation 0
a=candidate:1418565959 1 tcp 1518280447 142.133.123.33 0 typ host tcptype active generation 0
a=candidate:1418565959 2 tcp 1518280446 142.133.123.33 0 typ host tcptype active generation 0
a=candidate:437151159 1 udp 2122260223 142.133.123.33 61801 typ host generation 0
a=candidate:437151159 2 udp 2122260222 142.133.123.33 61802 typ host generation 0
a=candidate:1418565959 1 tcp 1518280447 142.133.123.33 0 typ host tcptype active generation 0
a=candidate:1418565959 2 tcp 1518280446 142.133.123.33 0 typ host tcptype active generation 0
a=ice-ufrag:yTCE4QuOaRby5yJd
a=ice-pwd:KKHBT1dd/0NoScpt8Iiix8ub
a=ice-options:google-ice
a=fingerprint:sha-256 F3:E1:6D:88:FD:B7:DA:55:BB:C8:10:DC:9C:12:C2:9E:C4:E7:49:03:88:C4:7A:10:D1:EA:DA:62:30:85:83:45
a=setup:actpass
a=mid:video
a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
a=extmap:14 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=sendrecv
a=rtcp-mux
a=rtpmap:100 VP8/90000
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=rtcp-fb:100 goog-remb
a=rtpmap:116 red/90000
a=rtpmap:117 ulpfec/90000
a=rtpmap:96 rtx/90000
a=fmtp:96 apt=100
a=ssrc-group:FID 454679926 4043911517
a=ssrc:454679926 cname:GVPQmpDpIZXlFcBr
a=ssrc:454679926 msid:z4nWgYpFsPw6UThtfe5tJOwKwfD3WTEl39Dt 09c6faeb-b226-49b0-9ce4-40378af9558e
a=ssrc:454679926 mslabel:z4nWgYpFsPw6UThtfe5tJOwKwfD3WTEl39Dt
a=ssrc:454679926 label:09c6faeb-b226-49b0-9ce4-40378af9558e
a=ssrc:4043911517 cname:GVPQmpDpIZXlFcBr
a=ssrc:4043911517 msid:z4nWgYpFsPw6UThtfe5tJOwKwfD3WTEl39Dt 09c6faeb-b226-49b0-9ce4-40378af9558e
a=ssrc:4043911517 mslabel:z4nWgYpFsPw6UThtfe5tJOwKwfD3WTEl39Dt
a=ssrc:4043911517 label:09c6faeb-b226-49b0-9ce4-40378af9558e

看瀏覽器ANSWER:

m=video 1 RTP/SAVPF 100 116 117 96
c=IN IP4 0.0.0.0
a=rtcp:1 IN IP4 0.0.0.0
a=ice-ufrag:
a=ice-pwd:
v=0
o=- 6057878882910049263 5 IN IP4 127.0.0.1
s=-
t=0 0
a=msid-semantic: WMS z5IdhGE6udWLNtZ5j1De4o0cKSTc2H4wo3U1
m=audio 52163 RTP/SAVPF 111 103 104 0 8 126
c=IN IP4 125.113.122.55
a=rtcp:1 IN IP4 0.0.0.0
a=candidate:437151159 1 udp 2122260223 142.133.123.33 52163 typ host generation 0
a=candidate:1418565959 1 tcp 1518280447 142.133.123.33 0 typ host tcptype active generation 0
a=ice-ufrag:FjQgNw/qg0UA36ZH
a=ice-pwd:kHYooqwEWmTn7Pco1mh4Af+E
a=fingerprint:sha-256 F3:E1:6D:88:FD:B7:DA:55:BB:C8:10:DC:9C:12:C2:9E:C4:E7:49:03:88:C4:7A:10:D1:EA:DA:62:30:85:83:45
a=setup:active
a=mid:audio
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=sendrecv
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=fmtp:111 minptime=10
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:126 telephone-event/8000
a=maxptime:60
a=ssrc:2432452571 cname:jbVMZw57KYOje031
a=ssrc:2432452571 msid:z5IdhGE6udWLNtZ5j1De4o0cKSTc2H4wo3U1 147c3eaf-87cc-457f-bf9c-1610deff30b4
a=ssrc:2432452571 mslabel:z5IdhGE6udWLNtZ5j1De4o0cKSTc2H4wo3U1
a=ssrc:2432452571 label:147c3eaf-87cc-457f-bf9c-1610deff30b4
m=video 1 RTP/SAVPF 100 116 117 96
c=IN IP4 0.0.0.0
a=rtcp:1 IN IP4 0.0.0.0
a=ice-ufrag:
a=ice-pwd:
a=fingerprint:sha-256 F3:E1:6D:88:FD:B7:DA:55:BB:C8:10:DC:9C:12:C2:9E:C4:E7:49:03:88:C4:7A:10:D1:EA:DA:62:30:85:83:45
a=setup:active
a=mid:video
a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
a=extmap:14 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=sendrecv
a=rtcp-mux
a=rtpmap:100 VP8/90000
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=rtcp-fb:100 goog-remb
a=rtpmap:116 red/90000
a=rtpmap:117 ulpfec/90000
a=rtpmap:96 rtx/90000
a=fmtp:96 apt=100
a=ssrc-group:FID 3620434458 3089122764
a=ssrc:3620434458 cname:jbVMZw57KYOje031
a=ssrc:3620434458 msid:z5IdhGE6udWLNtZ5j1De4o0cKSTc2H4wo3U1 acb064af-1bc3-4d0e-80fe-9ed251bbc8ca
a=ssrc:3620434458 mslabel:z5IdhGE6udWLNtZ5j1De4o0cKSTc2H4wo3U1
a=ssrc:3620434458 label:acb064af-1bc3-4d0e-80fe-9ed251bbc8ca
a=ssrc:3089122764 cname:jbVMZw57KYOje031
a=ssrc:3089122764 msid:z5IdhGE6udWLNtZ5j1De4o0cKSTc2H4wo3U1 acb064af-1bc3-4d0e-80fe-9ed251bbc8ca
a=ssrc:3089122764 mslabel:z5IdhGE6udWLNtZ5j1De4o0cKSTc2H4wo3U1
a=ssrc:3089122764 label:acb064af-1bc3-4d0e-80fe-9ed251bbc8ca

WebRTC - >無法設置會話描述:無法設置本地答案sdp:使用SDP調用而不使用ice-ufrag和ice-pwd。

任何幫助將不勝感激!!!

提前致謝!

我在webRTC討論組中對此問題進行了討論,並確定此問題應在Chrome中作為TR提出。

這是問題:

https://code.google.com/p/webrtc/issues/detail?id=4260

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM