Reputation: 704
I have a web based WebRTC client and I am having the following functionality:
a=group:BUNDLE 0 1 video_1
". Here I am
getting second video track (video_1
)with a=sendonly
.The Re-invite SDP is :
c=IN IP4 xxx.xx.xx.xx
b=AS:4044
t=0 0
a=ice-lite
a=ice-options:trickle
a=group:BUNDLE 0 1 video_1
a=msid-semantic:WMS 43e6158b973b4ca08c2bc5174f58b434
m=audio 49162 UDP/TLS/RTP/SAVP 111 110
b=AS:44
a=tcap:1 RTP/SAVPF
a=pcfg:1 t=1
a=rtpmap:111 opus/48000/2
a=fmtp:111 maxaveragebitrate=6000; maxplaybackrate=16000; sprop-maxcapturerate=16000; sprop-stereo=0; stereo=0; useinbandfec=1
a=rtpmap:110 telephone-event/48000
a=fmtp:110 0-15
a=ptime:20
a=maxptime:120
a=sendrecv
a=rtcp:49163
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=candidate:1 1 UDP 2130706175 xxx.xx.xx.xx 49162 typ host
a=end-of-candidates
a=ice-ufrag:zurp
a=ice-pwd:Zrz0Y1wK3WbD0HSKqgx88C
a=setup:actpass
a=fingerprint:sha-256 5B:A6:08:68:7C:5B:39:BB:C1:EC:C5:72:35:C7:62:3B:A2:BE:BE:0C:29:83:11:CC:51:FE:0C:93:A5:8D:AA:E8
a=rtcp-mux
a=msid:43e6158b973b4ca08c2bc5174f58b434 09c78ac11b0347aa8b6a1a9fdba841c1
a=ssrc:1095164922 cname:K8o0hMe5bXvm
a=mid:0
m=video 57354 UDP/TLS/RTP/SAVPF 96
b=AS:2000
a=rtpmap:96 VP8/90000
a=fmtp:96 max-fr=30; max-fs=3600
a=sendrecv
a=framerate:30
a=extmap:13 urn:3gpp:video-orientation
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=rtcp:57355
a=rtcp-fb:* nack
a=rtcp-fb:* nack pli
a=rtcp-fb:* ccm fir
a=rtcp-fb:* goog-remb
a=rtcp-fb:* ccm tmmbr
a=candidate:1 1 UDP 2130706175 xxx.xx.xx.xx 57354 typ host
a=end-of-candidates
a=ice-ufrag:X9Z+
a=ice-pwd:hcvRaKtCJLdHDRs7MP4KXq
a=setup:actpass
a=fingerprint:sha-256 5B:A6:08:68:7C:5B:39:BB:C1:EC:C5:72:35:C7:62:3B:A2:BE:BE:0C:29:83:11:CC:51:FE:0C:93:A5:8D:AA:E8
a=rtcp-mux
a=msid:43e6158b973b4ca08c2bc5174f58b434 track-1
a=ssrc:2066381390 cname:K8o0hMe5bXvm
a=mid:1
m=video 0 UDP/TLS/RTP/SAVPF 96
b=AS:2000
a=rtpmap:96 VP8/90000
a=fmtp:96 max-fr=30; max-fs=3600
a=sendonly
a=framerate:30
a=extmap:13 urn:3gpp:video-orientation
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=rtcp:57355
a=rtcp-fb:* nack
a=rtcp-fb:* nack pli
a=rtcp-fb:* ccm fir
a=rtcp-fb:* goog-remb
a=rtcp-fb:* ccm tmmbr
a=ice-ufrag:X9Z+
a=ice-pwd:hcvRaKtCJLdHDRs7MP4KXq
a=setup:actpass
a=fingerprint:sha-256 5B:A6:08:68:7C:5B:39:BB:C1:EC:C5:72:35:C7:62:3B:A2:BE:BE:0C:29:83:11:CC:51:FE:0C:93:A5:8D:AA:E8
a=rtcp-mux
a=msid:43e6158b973b4ca08c2bc5174f58b434 track-2
a=ssrc:2776644557 cname:K8o0hMe5bXvm
a=mid:video_1
a=bundle-only
a=recvonly
.Below is the SDP generated as an Answer to the above Re-Invite request:
a=group:BUNDLE 0 1 video_1
a=msid-semantic: WMS 03b098fc-d19f-4604-8698-a164f1064222
m=audio 54067 UDP/TLS/RTP/SAVP 111 110
c=IN IP4 192.168.1.107
a=rtcp:9 IN IP4 0.0.0.0
a=candidate:779251937 1 udp 2122260223 192.168.1.107 54067 typ host generation 0 network-id 1 network-cost 10
a=candidate:1626442769 1 tcp 1518280447 192.168.1.107 9 typ host tcptype active generation 0 network-id 1 network-cost 10
a=ice-ufrag:bSuf
a=ice-pwd:gEbxh/ZGJqewM+cb6mLj9vX1
a=ice-options:trickle
a=fingerprint:sha-256 CC:89:23:8E:49:D2:F3:20:70:FB:B6:3B:BB:D9:76:B6:E3:E2:6D:C4:CB:51:0D:55:AB:D7:93:D8:91:63:15:4E
a=setup:active
a=mid:0
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=sendrecv
a=msid:03b098fc-d19f-4604-8698-a164f1064222 bf7a9e2d-c258-419b-9460-6e0c492599eb
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=fmtp:111 maxaveragebitrate=6000;minptime=10;useinbandfec=1
a=rtpmap:110 telephone-event/48000
a=ssrc:2871826634 cname:NdgoEAIRngdC542j
m=video 9 UDP/TLS/RTP/SAVPF 96
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:bSuf
a=ice-pwd:gEbxh/ZGJqewM+cb6mLj9vX1
a=ice-options:trickle
a=fingerprint:sha-256 CC:89:23:8E:49:D2:F3:20:70:FB:B6:3B:BB:D9:76:B6:E3:E2:6D:C4:CB:51:0D:55:AB:D7:93:D8:91:63:15:4E
a=setup:active
a=mid:1
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:13 urn:3gpp:video-orientation
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=recvonly
a=msid:03b098fc-d19f-4604-8698-a164f1064222 20213716-40ab-4f1c-9b69-9d859de05ca6
a=rtcp-mux
a=rtpmap:96 VP8/90000
a=rtcp-fb:96 goog-remb
a=rtcp-fb:96 ccm fir
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
a=ssrc:3663801913 cname:NdgoEAIRngdC542j
m=video 9 UDP/TLS/RTP/SAVPF 96
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:bSuf
a=ice-pwd:gEbxh/ZGJqewM+cb6mLj9vX1
a=ice-options:trickle
a=fingerprint:sha-256 CC:89:23:8E:49:D2:F3:20:70:FB:B6:3B:BB:D9:76:B6:E3:E2:6D:C4:CB:51:0D:55:AB:D7:93:D8:91:63:15:4E
a=setup:active
a=mid:video_1
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:13 urn:3gpp:video-orientation
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=recvonly
a=rtcp-mux
a=rtpmap:96 VP8/90000
a=rtcp-fb:96 goog-remb
a=rtcp-fb:96 ccm fir
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
I am creating a new peer connection on getting the Re-Invite, but using the same localstreams object which I fetched during the time of creating the offer in Step 1. Clearing the existing local tracks from the old peer connection before creating a new peerconnection.
localStream.getTracks().forEach(function(track) {
var sender = call.peerConnection.getSenders().find ? call.peerConnection.getSenders().find(function(s) {
return s.track === track;
}) : null;
if (sender) {
call.peerConnection.removeTrack(sender);
On creating a new peerConnection adding the local tracks like:
newStream.getTracks().forEach(function(track) {
wsclogger.debug("addLocalStream, calling addTrack() --> "+ track.kind);
peerConnection.addTrack(track, newStream);
});
Here I have confirmed from the log above that both Audio and Video tracks are getting added to the newly created peerConnection object.
Please guide me whats going wrong here.
PS: Same logic works well with Android, where the Re-invite Response sdp contains a=sendrecv
for the track-1 and a=recvonly
for the track-2.
Thanks in Advance.
Upvotes: 1
Views: 906