Sdp Plan-b UnifiedPlan

Unified Plan and Plan B were two competing IETF drafts for the negotiation and exchange of multiple media sources (AKA MediaStreamTracks, or MSTs) between two WebRTC endpoints. 
Unified Plan 和 Plan B 和 Plan A是SDP协商中,多路媒体流的协商方式。

unified-plan文档

unified-plan

Plan-b 和 Unified-plan 区别

In Plan B, one m= section is used for audio and one m= section is used for video, with the media stream identification attribute, or mid, set to “audio” or “video” respectively. If multiple tracks of the same kind are in an offer, multiple a=ssrc lines are listed under the same m= section.

In Unified Plan, one m= section means one sending and/or one receiving track. The mid is its identifier. If multiple tracks are used, multiple m= sections are created。
  • 在Plan-b中, 音频只有一个m=, 视频只有一个m= 。 当有多路媒体流时, 根据ssrc 区分。
  • 在Unified-plan 中, 每路流都有一个m=。
  • 当只有一个路视频流,一路音频流时,两者格式兼容。
  • 对比下图中,发送两路音频流时的区别。
plan-b unified-plan
Sdp Plan-b UnifiedPlan_第1张图片 在这里插入图片描述 Sdp Plan-b UnifiedPlan_第2张图片Sdp Plan-b UnifiedPlan_第3张图片

其它

  1. https://tools.ietf.org/html/draft-roach-mmusic-unified-plan-00
  2. chrome 支持计划:https://webrtc.org/web-apis/chrome/unified-plan/
  3. firefox 支持unified-plan, mid 长度不能超过16位
  4. chrome unified-plan 需要确保协商结束后发送视频流,否则会 Failed to set local answer sdp: Failed to process the bundled m= section.
  5. 修改chrome://flags 设置sdp 格式
  6. chrome 下72 默认格式unified-plan , 通过getConfiguration 查看当前peer 格式, 在低版本的chrome里,就算强制声明参数unified-plan ,还是会使用plan-b。格式以getConfiguration 返回的为准。
type: offer, sdp: v=0
o=mediasoup 76760093 1 IN IP4 0.0.0.0
s=-
t=0 0
a=ice-lite
a=fingerprint:sha-256 75:E9:8A:3C:96:49:89:97:18:A3:0D:73:E9:9A:59:D1:8A:B4:15:A9:8F:C4:DE:91:8F:5D:E3:73:0D:E2:00:4E
a=msid-semantic: WMS *
a=group:BUNDLE audio-1 video-1 j6gtnlva p0o0fho7 i860vo1m xwa9siz1
m=audio 7 RTP/SAVPF 100
c=IN IP4 127.0.0.1
a=rtpmap:100 opus/48000/2
a=fmtp:100 minptime=10;useinbandfec=1
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=setup:actpass
a=mid:audio-1
a=recvonly
a=ice-ufrag:3lw1e76eix7edjcm
a=ice-pwd:cidqjcjfv28re4t7djaf410gkzpoblq4
a=candidate:udpcandidate 1 udp 1078862079 10.1.133.155 19211 typ host
a=end-of-candidates
a=ice-options:renomination
a=rtcp-mux
a=rtcp-rsize
m=video 7 RTP/SAVPF 123 101
c=IN IP4 127.0.0.1
a=rtpmap:123 VP8/90000
a=rtpmap:101 rtx/90000
a=fmtp:101 apt=123
a=rtcp-fb:123 goog-remb
a=rtcp-fb:123 ccm fir
a=rtcp-fb:123 nack
a=rtcp-fb:123 nack pli
a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:4 urn:3gpp:video-orientation
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=setup:actpass
a=mid:video-1
a=recvonly
a=ice-ufrag:3lw1e76eix7edjcm
a=ice-pwd:cidqjcjfv28re4t7djaf410gkzpoblq4
a=candidate:udpcandidate 1 udp 1078862079 10.1.133.155 19211 typ host
a=end-of-candidates
a=ice-options:renomination
a=rtcp-mux
a=rtcp-rsize
m=video 7 RTP/SAVPF 123 101
c=IN IP4 127.0.0.1
a=rtpmap:123 VP8/90000
a=rtpmap:101 rtx/90000
a=fmtp:101 apt=123
a=rtcp-fb:123 goog-remb
a=rtcp-fb:123 ccm fir
a=rtcp-fb:123 nack
a=rtcp-fb:123 nack pli
a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:4 urn:3gpp:video-orientation
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=setup:actpass
a=mid:j6gtnlva
a=msid:kREh1yv7S0I5syCOntCAIUBeMoesO6v5RlkL 28c40df0-83b8-46c7-bd06-34e7e6fc8fa0
a=sendonly
a=ice-ufrag:3lw1e76eix7edjcm
a=ice-pwd:cidqjcjfv28re4t7djaf410gkzpoblq4
a=candidate:udpcandidate 1 udp 1078862079 10.1.133.155 19211 typ host
a=end-of-candidates
a=ice-options:renomination
a=ssrc:4131643841 cname:pYEUk1YEO5F9x9T/
a=ssrc:1251779610 cname:pYEUk1YEO5F9x9T/
a=ssrc-group:FID 4131643841 1251779610
a=rtcp-mux
a=rtcp-rsize
m=audio 7 RTP/SAVPF 100
c=IN IP4 127.0.0.1
a=rtpmap:100 opus/48000/2
a=fmtp:100 minptime=10;useinbandfec=1
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=setup:actpass
a=mid:p0o0fho7
a=msid:kREh1yv7S0I5syCOntCAIUBeMoesO6v5RlkL 1271c25f-e4e8-4763-8770-2f043f426445
a=sendonly
a=ice-ufrag:3lw1e76eix7edjcm
a=ice-pwd:cidqjcjfv28re4t7djaf410gkzpoblq4
a=candidate:udpcandidate 1 udp 1078862079 10.1.133.155 19211 typ host
a=end-of-candidates
a=ice-options:renomination
a=ssrc:4125350497 cname:pYEUk1YEO5F9x9T/
a=rtcp-mux
a=rtcp-rsize
m=video 7 RTP/SAVPF 123 101
c=IN IP4 127.0.0.1
a=rtpmap:123 VP8/90000
a=rtpmap:101 rtx/90000
a=fmtp:101 apt=123
a=rtcp-fb:123 goog-remb
a=rtcp-fb:123 ccm fir
a=rtcp-fb:123 nack
a=rtcp-fb:123 nack pli
a=fmtp:123 x-google-min-bitrate=140;x-google-max-bitrate=180;x-google-start-bitrate=160;x-google-min-bitrate=140;x-google-max-bitrate=180;x-google-start-bitrate=160;x-google-min-bitrate=140;x-google-max-bitrate=180;x-google-start-bitrate=160
a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:4 urn:3gpp:video-orientation
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=setup:actpass
a=mid:i860vo1m
a=msid:nbwkpaLOrbf3snCxWpLgPCi01iwx6ghw9xu2 1098359b-2cc9-4b96-b7f4-6aa2b7c40031
a=sendonly
a=ice-ufrag:3lw1e76eix7edjcm
a=ice-pwd:cidqjcjfv28re4t7djaf410gkzpoblq4
a=candidate:udpcandidate 1 udp 1078862079 10.1.133.155 19211 typ host
a=end-of-candidates
a=ice-options:renomination
a=ssrc:2368086230 cname:QVg07Awk9yf5LedF
a=ssrc:2368086230 cname:QVg07Awk9yf5LedF
a=ssrc-group:FID 2368086230 2368086230
a=rtcp-mux
a=rtcp-rsize
m=audio 7 RTP/SAVPF 100
c=IN IP4 127.0.0.1
a=rtpmap:100 opus/48000/2
a=fmtp:100 minptime=10;useinbandfec=1
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=setup:actpass
a=mid:xwa9siz1
a=msid:nbwkpaLOrbf3snCxWpLgPCi01iwx6ghw9xu2 357db268-a530-4b09-98e9-8ad599921249
a=sendonly
a=ice-ufrag:3lw1e76eix7edjcm
a=ice-pwd:cidqjcjfv28re4t7djaf410gkzpoblq4
a=candidate:udpcandidate 1 udp 1078862079 10.1.133.155 19211 typ host
a=end-of-candidates
a=ice-options:renomination
a=ssrc:1666321053 cname:QVg07Awk9yf5LedF
a=rtcp-mux
a=rtcp-rsize
type: offer, sdp: v=0
o=mediasoup 24017464 1 IN IP4 0.0.0.0
s=-
t=0 0
a=ice-lite
a=fingerprint:sha-256 75:E9:8A:3C:96:49:89:97:18:A3:0D:73:E9:9A:59:D1:8A:B4:15:A9:8F:C4:DE:91:8F:5D:E3:73:0D:E2:00:4E
a=msid-semantic: WMS *
a=group:BUNDLE audio-tracks video-tracks
m=audio 7 RTP/SAVPF 100
c=IN IP4 127.0.0.1
a=rtpmap:100 opus/48000/2
a=fmtp:100 minptime=10;useinbandfec=1
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=setup:actpass
a=mid:audio-tracks
a=sendrecv
a=ice-ufrag:vdb6b4984o7dkf16
a=ice-pwd:4agfo1y9pl4ylg2zxrx4lufimetfuxzc
a=candidate:udpcandidate 1 udp 1078862079 10.1.133.155 51891 typ host
a=end-of-candidates
a=ice-options:renomination
a=ssrc:1689928828 cname:tw9LY2QY98p9spEm
a=ssrc:1689928828 msid:NSyf3jpXBCyhNnds6Shejy3vfxXmQRpVkcpQ 9f9624db-1c35-49a0-9898-2d578606961d
a=ssrc:2064048689 cname:0SQ2ImcTH1runIhp
a=ssrc:2064048689 msid:FWqQatBcsifPcujegGiIXt2BgBNSS89G20VC 06c7586a-c83e-4a5a-a06c-d126c49a810d
a=rtcp-mux
a=rtcp-rsize
m=video 7 RTP/SAVPF 123 101
c=IN IP4 127.0.0.1
a=rtpmap:123 VP8/90000
a=rtpmap:101 rtx/90000
a=fmtp:101 apt=123
a=rtcp-fb:123 goog-remb
a=rtcp-fb:123 ccm fir
a=rtcp-fb:123 nack
a=rtcp-fb:123 nack pli
a=fmtp:123 x-google-min-bitrate=140;x-google-max-bitrate=180;x-google-start-bitrate=160
a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:4 urn:3gpp:video-orientation
a=setup:actpass
a=mid:video-tracks
a=sendrecv
a=ice-ufrag:vdb6b4984o7dkf16
a=ice-pwd:4agfo1y9pl4ylg2zxrx4lufimetfuxzc
a=candidate:udpcandidate 1 udp 1078862079 10.1.133.155 51891 typ host
a=end-of-candidates
a=ice-options:renomination
a=ssrc:1028448819 cname:tw9LY2QY98p9spEm
a=ssrc:1028448819 msid:NSyf3jpXBCyhNnds6Shejy3vfxXmQRpVkcpQ e59b243c-f944-471b-b410-45a80db0797e
a=ssrc:788703880 cname:tw9LY2QY98p9spEm
a=ssrc:788703880 msid:NSyf3jpXBCyhNnds6Shejy3vfxXmQRpVkcpQ e59b243c-f944-471b-b410-45a80db0797e
a=ssrc:2889626611 cname:0SQ2ImcTH1runIhp
a=ssrc:2889626611 msid:FWqQatBcsifPcujegGiIXt2BgBNSS89G20VC c73ef760-4a91-4077-9bf1-fbdda5c10c71
a=ssrc:4061195486 cname:0SQ2ImcTH1runIhp
a=ssrc:4061195486 msid:FWqQatBcsifPcujegGiIXt2BgBNSS89G20VC c73ef760-4a91-4077-9bf1-fbdda5c10c71
a=ssrc-group:FID 1028448819 788703880
a=ssrc-group:FID 2889626611 4061195486
a=rtcp-mux
a=rtcp-rsize

你可能感兴趣的:(音视频)