WebRTC(十一) SDP

下面以一個sdp的實例來解釋說明

會話層

v=0

v:版本號

o=- 2510751529507770530 2 IN IP4 127.0.0.1

0:owner, 
-:name,
2510751529507770530:sessionID, 
2:版本, 
IN:Internet, 
IP4:IP類型,  
127.0.0.1:IP地址

s=-

s:sesssionId, 
-:name

t=0 0

t:time 
0:起始時間
0:結束時間

a=group:BUNDLE 0

a:attribute
group:一組
Bundle:一組媒體流綁定到一起
0:視頻流

a=msid-semantic: WMS UlWZUrYSZtB5e3Aiw4IBfp6eivcA9UWPSFvN

msid:media stream id
wms: webrtc media stream, 
UlWZUrYSZtB5e3Aiw4IBfp6eivcA9UWPSFvN:媒體流id的標識

媒體層

可以有多個m 此處只有一個v即video
m=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 102 122 127 121 125 107 108 109 124 120 123 119 114 115 116

m:media
video:視頻
9:端口號,不接受數據,不要向端口號傳輸
UDP/TLS/RTP/SAVPF:傳輸協議,底層是UDP協議,上層是RTP,TLS表示交換證書,SAVPF:Securate Audio Video Protocal Family
96 97 98 99 100 101 102 122 127 121 125 107 108 109 124 120 123 119 114 115 116:payload type

c=IN IP4 0.0.0.0

c:connection
IN:internet
IP4:網絡類型
0.0.0.0:表示任意地址

a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:cHvA

ice-ufrag:鏈路驗證有效性 會驗證ufrag和pwd是否一直

a=ice-pwd:H2JJrFRuXwIKBsQ7Aa01M7kU

ice-pwd:鏈路驗證有效性 會驗證ufrag和pwd是否一直

a=ice-options:trickle

trickle:之前ice收集完成之後,纔開始做sdp的交換,因爲ice耗時比較長,所以改爲了先進行sdp交換,
然後先用ice的任意通路,發現更好的通路再進行替換

a=fingerprint:sha-256 39:0E:67:55:E1:CE:9C:E3:65:5B:BB:EF:CE:DF:C1:59:27:95:3F:6F:A3:50:D8:B8:82:13:0E:FB:18:80:3D:86

fingerprint:256位的哈希值,TLS傳輸的校驗,雙方會校驗fingerprint是否是合法的

a=setup:actpass

actpass:表示可以作爲服務器端或者客戶端。

a=mid:0
a=extmap:14 urn:ietf:params:rtp-hdrext:toffset

extmap:external 擴展屬性集合

a=extmap:13 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:12 urn:3gpp:video-orientation
a=extmap:2 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:11 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
a=extmap:8 http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07
a=extmap:9 http://www.webrtc.org/experiments/rtp-hdrext/color-space
a=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
a=sendrecv

sendrecv:send receive 既可以發送又可以接收

a=msid:UlWZUrYSZtB5e3Aiw4IBfp6eivcA9UWPSFvN af6eaad8-69c6-44fc-ad63-b5be8558a449

a=rtcp-mux

rtcp:傳輸反饋,比如丟包或帶寬數據等
mux:複用,即爲rtp與rtcp複用

a=rtcp-rsize

rsize:爲了減少少rtcp包的,帶寬足夠時,反饋包括很多數據。由於有時候沒有足夠帶寬,所以就用rsize來表示發送丟了多少包。

a=rtpmap:96 VP8/90000

96:payload type 
VP8:編碼方式
90000:採樣率

a=rtcp-fb:96 goog-remb

goog-remb:google 接收端帶寬評估

a=rtcp-fb:96 transport-cc

transport-cc 傳輸端的貸款評估

a=rtcp-fb:96 ccm fir

ccm:codec cotrol message,編碼控制的回饋消息
fir:完整的內部幀 即請求發送一個完整的I幀

a=rtcp-fb:96 nack

nack:告訴它有多少包是沒有收到應答的,可以將沒應答的包重新發一遍

a=rtcp-fb:96 nack pli

pli和fir類似 請求完整幀類型 picture lose

a=rtpmap:97 rtx/90000

rtx:丟包重傳的通道

a=fmtp:97 apt=96

apt:表示9796關聯的通道,當96有數據包丟包時候,需要重傳,重傳的payload type是97

a=rtpmap:98 VP9/90000
a=rtcp-fb:98 goog-remb
a=rtcp-fb:98 transport-cc
a=rtcp-fb:98 ccm fir
a=rtcp-fb:98 nack
a=rtcp-fb:98 nack pli
a=fmtp:98 profile-id=0
a=rtpmap:99 rtx/90000
a=fmtp:99 apt=98
a=rtpmap:100 VP9/90000
a=rtcp-fb:100 goog-remb
a=rtcp-fb:100 transport-cc
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=fmtp:100 profile-id=2
a=rtpmap:101 rtx/90000
a=fmtp:101 apt=100
a=rtpmap:102 H264/90000
a=rtcp-fb:102 goog-remb
a=rtcp-fb:102 transport-cc
a=rtcp-fb:102 ccm fir
a=rtcp-fb:102 nack
a=rtcp-fb:102 nack pli
a=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f
a=rtpmap:122 rtx/90000
a=fmtp:122 apt=102
a=rtpmap:127 H264/90000
a=rtcp-fb:127 goog-remb
a=rtcp-fb:127 transport-cc
a=rtcp-fb:127 ccm fir
a=rtcp-fb:127 nack
a=rtcp-fb:127 nack pli
a=fmtp:127 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42001f
a=rtpmap:121 rtx/90000
a=fmtp:121 apt=127
a=rtpmap:125 H264/90000
a=rtcp-fb:125 goog-remb
a=rtcp-fb:125 transport-cc
a=rtcp-fb:125 ccm fir
a=rtcp-fb:125 nack
a=rtcp-fb:125 nack pli
a=fmtp:125 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
a=rtpmap:107 rtx/90000
a=fmtp:107 apt=125
a=rtpmap:108 H264/90000
a=rtcp-fb:108 goog-remb
a=rtcp-fb:108 transport-cc
a=rtcp-fb:108 ccm fir
a=rtcp-fb:108 nack
a=rtcp-fb:108 nack pli
a=fmtp:108 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01f
a=rtpmap:109 rtx/90000
a=fmtp:109 apt=108
a=rtpmap:124 H264/90000
a=rtcp-fb:124 goog-remb
a=rtcp-fb:124 transport-cc
a=rtcp-fb:124 ccm fir
a=rtcp-fb:124 nack
a=rtcp-fb:124 nack pli
a=fmtp:124 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=4d0032
a=rtpmap:120 rtx/90000
a=fmtp:120 apt=124
a=rtpmap:123 H264/90000
a=rtcp-fb:123 goog-remb
a=rtcp-fb:123 transport-cc
a=rtcp-fb:123 ccm fir
a=rtcp-fb:123 nack
a=rtcp-fb:123 nack pli
a=fmtp:123 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=640032
a=rtpmap:119 rtx/90000
a=fmtp:119 apt=123
a=rtpmap:114 red/90000

red:冗餘丟包策略

a=rtpmap:115 rtx/90000
a=fmtp:115 apt=114
a=rtpmap:116 ulpfec/90000

a=ssrc-group:FID 790110816 3858362499

ssrc:標識一路流

a=ssrc:790110816 cname:IXwkxlCRc+MAD5lr

cname:channel name 和ssrc對應的名字

a=ssrc:790110816 msid:UlWZUrYSZtB5e3Aiw4IBfp6eivcA9UWPSFvN af6eaad8-69c6-44fc-ad63-b5be8558a449
a=ssrc:790110816 mslabel:UlWZUrYSZtB5e3Aiw4IBfp6eivcA9UWPSFvN
a=ssrc:790110816 label:af6eaad8-69c6-44fc-ad63-b5be8558a449
a=ssrc:3858362499 cname:IXwkxlCRc+MAD5lr
a=ssrc:3858362499 msid:UlWZUrYSZtB5e3Aiw4IBfp6eivcA9UWPSFvN af6eaad8-69c6-44fc-ad63-b5be8558a449
a=ssrc:3858362499 mslabel:UlWZUrYSZtB5e3Aiw4IBfp6eivcA9UWPSFvN
a=ssrc:3858362499 label:af6eaad8-69c6-44fc-ad63-b5be8558a449

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章