docs/RTP-usage.html
This tutorial is out-dated (written in 2013). WebRTC implementation is heavily changed since then. So please do NOT refer or rely on this page.
Note: Chrome usually bundles & multiplexes media ports over single UDP port. Below all scenarios are for non-bundled media connections.
In this scenario; maximum 4 RTP ports are opened for each peer:
Each RTP port is using 1 MB bandwidth. It means that 4 MB bandwidth is acquired by each peer.
Remember, you can use ' b=AS' to increase/decrease bandwidth usage for each stream; which will be divided according to number of RTP ports for each stream.
There are two kinds of users in this scenario:
2 RTP ports are opened for broadcasting peer:
There is no incoming RTP ports.
2 MB audio/video bandwidth is required and used by the broadcasting peer. Because there are two outgoing RTP ports.
2 RTP ports are opened for participating peer:
There is no outgoing RTP ports.
2 MB audio/video bandwidth is required and used by the participating peer. Because there are two incoming RTP ports.
In this scenario; number of RTP ports depends upon number of peer connections multiplied by 4.
40 RTP ports are opened for each user; i.e. 40 MB bandwidth is used by each user.
// remove existing bandwidth lines
sdp = sdp.replace( /b=AS([^\r\n]+\r\n)/g , '');
// audio bandwidth 50 kilobits per second
sdp = sdp.replace( /a=mid: **audio** \r\n/g , 'a=mid:audio\r\n **b=AS:50** \r\n');
// video bandwidth 256 kilobits per second
sdp = sdp.replace( /a=mid: **video** \r\n/g , 'a=mid:video\r\n **b=AS:256** \r\n');
// data bandwidth 1638400 kilobits per second
sdp = sdp.replace( /a=mid: **data** \r\n/g , 'a=mid:data\r\n **b=AS:1638400** \r\n');
Above snippet is setting bandwidth for first track in each m-line. You need to set application specific bandwidth attribute for each track if you attached multiple streams.
Assume that you attached following streams per single peer:
In this scenario; 8 RTP ports will be opened for each peer:
In such scenario; default bandwidth acquired by each peer is 8 MB.
By default, 5 simultaneous calls need 20M bandwidth, as 2M each. You can also try to limit each stream by adding 'b=AS' according to your available bandwidth.
| Maximum video bitrate | 2 | Mbps | | Minimum video bitrate | .05 | Mbps | | Starting video bitrate | .3 | Mbps |
Send MessageEnter your email too; if you want "direct" reply!