SDP可以说是WebRTC的核心,因为双方进行通信的参数都在其中,如使用的编解码器是多少,码流是多大,有多少个媒体流等等这些都在 SDP中描述着。所以必须要非常清楚每一行的含义。而往往这部分知识很复杂,能了解清楚的人少之又少,从而导致对 WebRTC的理解很难深入下去…
11-1 【协议规范】SDP规范
SDP简介
SDP结构
SDP字段含义
rtpmap,fmtp比较重要。
11-2 【协议规范】WebRTC中的SDP
11-3 【详解】WebRTC中Offer_AnswerSDP
Local SDP和Remote SDP差不多。
v=0 //版本号
o=- 6056452709547191583 2 IN IP4 127.0.0.1 //2版本号 IN Internet
s=-
t=0 0 实时通话,一直为0.。开始时间和终止时间。
a=group:BUNDLE 0
a=extmap-allow-mixed
a=msid-semantic: WMS 9cmBHlRNiTv2IpyJtWDAuQOn1lOCzK8b6cPF
//媒体信息 96-最后是payload
m=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 102 121 127 120 125 107 108 109 35 36 124 119 123 118 114 115 116
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:EVGd
a=ice-pwd:HDm9JdT3VNhVdb6lYCYdfzeG
a=ice-options:trickle
a=fingerprint:sha-256 EE:2B:CB:3E:65:70:1F:E3:D6:A0:C3:5D:AC:60:E3:8F:0E:50:8E:FE:9F:8E:54:4F:65:D9:FC:13:02:64:49:6D
a=setup:actpass
a=mid:0
a=extmap:1 urn:ietf:params:rtp-hdrext:toffset
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:3 urn:3gpp:video-orientation
a=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:5 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://www.webrtc.org/experiments/rtp-hdrext/color-space
a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:10 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
a=extmap:11 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
a=sendrecv
a=msid:9cmBHlRNiTv2IpyJtWDAuQOn1lOCzK8b6cPF 42e5113f-5a41-4bfe-a398-423996678a4d
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:96 VP8/90000
a=rtcp-fb:96 goog-remb
a=rtcp-fb:96 transport-cc
a=rtcp-fb:96 ccm fir
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
a=rtpmap:97 rtx/90000
a=fmtp:97 apt=96
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:121 rtx/90000
a=fmtp:121 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:120 rtx/90000
a=fmtp:120 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:35 AV1X/90000
a=rtcp-fb:35 goog-remb
a=rtcp-fb:35 transport-cc
a=rtcp-fb:35 ccm fir
a=rtcp-fb:35 nack
a=rtcp-fb:35 nack pli
a=rtpmap:36 rtx/90000
a=fmtp:36 apt=35
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=4d001f
a=rtpmap:119 rtx/90000
a=fmtp:119 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=64001f
a=rtpmap:118 rtx/90000
a=fmtp:118 apt=123
a=rtpmap:114 red/90000
a=rtpmap:115 rtx/90000
a=fmtp:115 apt=114
a=rtpmap:116 ulpfec/90000
a=ssrc-group:FID 3659076229 3083105003
a=ssrc:3659076229 cname:tAOMPA92M7yAkOzR
a=ssrc:3659076229 msid:9cmBHlRNiTv2IpyJtWDAuQOn1lOCzK8b6cPF 42e5113f-5a41-4bfe-a398-423996678a4d
a=ssrc:3659076229 mslabel:9cmBHlRNiTv2IpyJtWDAuQOn1lOCzK8b6cPF
a=ssrc:3659076229 label:42e5113f-5a41-4bfe-a398-423996678a4d
a=ssrc:3083105003 cname:tAOMPA92M7yAkOzR
a=ssrc:3083105003 msid:9cmBHlRNiTv2IpyJtWDAuQOn1lOCzK8b6cPF 42e5113f-5a41-4bfe-a398-423996678a4d
a=ssrc:3083105003 mslabel:9cmBHlRNiTv2IpyJtWDAuQOn1lOCzK8b6cPF
a=ssrc:3083105003 label:42e5113f-5a41-4bfe-a398-423996678a4d
11-4 对于SDP协议是做什么作用的?
SDP字段讲解
https://www.cnblogs.com/chyingp/archive/2019/07/29/sdp-in-webrtc.html