Shashidhara
Shashidhara

Reputation: 683

WebRTC - SDP has more m= line

In my app where one peer (A) has one media stream, and other side (B) has two media streams. I am not understanding why there are more m= line in offer from B to A:

1) The offer from A to B is as follows:

v=0
o=- 298896314257884346 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1
a=msid-semantic: WMS BVmismsFWNYofSpFcVAnbDtyGxd1hzVGcOXe

m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126
c=IN IP4 0.0.0.0
...
a=mid:0
...
a=sendrecv
a=msid:BVmismsFWNYofSpFcVAnbDtyGxd1hzVGcOXe 982eedc1-919b-450f-80e3-2fb173cbc5ae'
...
m=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 102 123 127 122 125 107 108 109 124
c=IN IP4 0.0.0.0
...
a=mid:1
...
a=sendrecv
a=msid:BVmismsFWNYofSpFcVAnbDtyGxd1hzVGcOXe 4112fe2c-24b3-4135-9ad6-7e2f38a6692f

2) The offer from B to A is as follows:

v=0
o=- 6641223000983904101 3 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1 2 3 4
a=msid-semantic: WMS

m=audio 54011 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126
...
a=mid:0
...
a=sendrecv
a=msid:- 4fb1ecb1-86e7-4529-a5b6-1dddd6f77ce0
...
m=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 102 123 127 122 125 107 108 109 124
...
a=mid:1
...
a=sendrecv
a=msid:- b3b97f66-8a7a-4aaf-857b-e011648a4a64
...
m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126
...
a=mid:2
...
a=sendrecv
a=msid:LukrKSP3g6xYlKFbI9DhHXmE22ZEwNz3Shpo 06363625-089b-49f8-ab23-ec04ac0499c0
...
m=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 102 123 127 122 125 107 108 109 124
...
a=mid:3
...
a=sendrecv
a=msid:LukrKSP3g6xYlKFbI9DhHXmE22ZEwNz3Shpo 108478fa-20a9-4393-aaf2-3d27ac641258
...
m=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 102 123 127 122 125 107 108 109 124
...
a=mid:4
...
a=sendrecv
a=msid:zCWSiL1IMAhK6skk975lr4IIPf4LBoh2chQI 4600414c-8faf-451c-b6d4-7d8310ab63f8

In 2nd case the m= line is 5 which is in (BUNDLE 0 1 2 3 4) Why there are 5 lines when we have only two video streams?

Upvotes: 1

Views: 2066

Answers (1)

Karthik
Karthik

Reputation: 2622

session description includes information about the kind of media being sent, its format, the transfer protocol being used, the endpoint's IP address and port, and other information needed to describe a media transfer endpoint.

Since B has two media streams SDP will contain 4 m lines (2 per stream).

In Unified Plan every single media track is assigned to a separate “m=” section. If you use multiple media tracks, multiple “m=” sections are created.

Chrome is migrating to unified plan from plan-b

If you want more details about unified plan you can see this blog - https://www.callstats.io/blog/what-is-unified-plan-and-how-will-it-affect-your-webrtc-development

Upvotes: 1

Related Questions