Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebRTC: Use same SDP for multiple peer connections?

Tags:

webrtc

sdp

Is it possible to use same SDP in multiple peer connections?

I'm building video conference using WebRTC. The idea is that caller, using some signaling mechanism, send broadcast message to all other users with it's SDP (same SDP for each user) and then users will respond with their SDP.

When user receive somebody's SDP, he use it to set remote description, like this:

connection = new RTCPeerConnection()
desc = RTCSessionDescription({sdp: SDP, type: "offer"});
connection = setRemoteDescription(desc);

Here is SDP example:

v=0
o=- 6843023960119608301 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE audio
a=msid-semantic: WMS
m=audio 1 RTP/SAVPF 111 103 104 0 8 106 105 13 126
c=IN IP4 0.0.0.0
a=rtcp:1 IN IP4 0.0.0.0
a=ice-ufrag:q36dZRVoaS4ixPYP
a=ice-pwd:K5yAm4A+zGoIKIgsX9o4VgDA
a=ice-options:google-ice
a=fingerprint:sha-256 62:3E:99:2F:FF:D4:58:7C:F0:A1:02:3F:09:2B:D1:F3:71:D7:F6:59:62:12:E4:1B:4A:68:01:4C:43:E0:D1:75
a=setup:actpass
a=mid:audio
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=recvonly
a=rtcp-mux
a=crypto:0 AES_CM_128_HMAC_SHA1_32 inline:Tdz5Z3KHB3Xosqr5D53WZfi7Zndz+932X3H46Qvf
a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:NJO4XhhHUgiJRCfyYzDgajkCJAF/9BX8QeU+FKQs
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:106 CN/32000
a=rtpmap:105 CN/16000
a=rtpmap:13 CN/8000
a=rtpmap:126 telephone-event/8000
a=maxptime:60

I don't see here anything unique, so if B and D will use it as remote description, would it work? If yes - how can I generate this SDP? The only way I know for now is using RTCPeerConnection.createOffer but this will create unneeded peer connection object (according to my idea, peer objects should be created after received response from other users).

like image 383
SET Avatar asked Feb 14 '14 19:02

SET


People also ask

How many connections can WebRTC handle?

As many as you like. You can cram anywhere from one to a million users into a WebRTC call. You've been asked to create a group video call, and obviously, the technology selected for the project was WebRTC. It is almost the only alternative out there and certainly the one with the best price-performance ratio.

How does WebRTC peer-to-peer work?

WebRTC in the real world Users discover each other and exchange details such as names. WebRTC client applications (peers) exchange network information. Peers exchange data about media such as video format and resolution. WebRTC client applications traverse NAT gateways and firewalls.

Is WebRTC peer-to-peer?

Peer connections is the part of the WebRTC specifications that deals with connecting two applications on different computers to communicate using a peer-to-peer protocol. The communication between peers can be video, audio or arbitrary binary data (for clients supporting the RTCDataChannel API).

What is ICE candidate in WebRTC?

The RTCIceCandidate interface—part of the WebRTC API—represents a candidate Interactive Connectivity Establishment (ICE) configuration which may be used to establish an RTCPeerConnection . An ICE candidate describes the protocols and routing needed for WebRTC to be able to communicate with a remote device.


2 Answers

No, WebRTC is not designed that way. You need to create a separate PeerConnection for one peer.

like image 104
Wilson Chen Avatar answered Sep 23 '22 21:09

Wilson Chen


You can use the same SDP, as long as it contains no Candidate fields! These candidate fields are bound to the local RTP Port, which is not reusable.

like image 4
Tilmann Bach Avatar answered Sep 20 '22 21:09

Tilmann Bach