searchusermenu
  • 发布文章
  • 消息中心
点赞
收藏
评论
分享
原创

Webrtc推流-SDP交互

2024-09-04 09:42:35
9
0

1.简介

        本文介绍了webrtc推流时,推流端与服务端的sdp交互流程

2.主要流程

  1. 客户端首先获取offer sdp,里面包含了客户端支持的音视频编码格式等信息
  2. 客户端通过信令服务器,将offer sdp发送给服务端
  3. 服务端收到offer sdp后,选择自己意向的编码格式,生成answer sdp
  4. 服务端通过信令服务器,返回answer sdp给客户端

3.offer sdp

v=0
o=- 3053614121604473466 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1
a=extmap-allow-mixed
a=msid-semantic: WMS
m=audio 9 UDP/TLS/RTP/SAVPF 111 63 9 0 8 13 110 126
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:mV4G
a=ice-pwd:yMz7z1inGraCTegW/iRtBNNB
a=ice-options:trickle
a=fingerprint:sha-256 ED:7D:94:9C:7F:3A:E9:7B:55:EB:FC:80:EA:44:7D:D1:5B:20:AB:57:6D:71:F7:45:AF:F5:05:25:6C:AA:10:3F
a=setup:actpass
a=mid:0
a=sendonly
a=msid:- 80a21af4-157f-4b1e-862f-9eff1253738d
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
a=rtpmap:63 red/48000/2
a=fmtp:63 111/111
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:13 CN/8000
a=rtpmap:110 telephone-event/48000
a=rtpmap:126 telephone-event/8000
a=ssrc:1536335743 cname:evls19uC3prPBhhp
a=ssrc:1536335743 msid:- 80a21af4-157f-4b1e-862f-9eff1253738d
m=video 9 UDP/TLS/RTP/SAVPF 96 97 102 103 104 105 106 107 108 109 127 125 39 40 45 46 98 99 100 101 112 113 116 117 118
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:mV4G
a=ice-pwd:yMz7z1inGraCTegW/iRtBNNB
a=ice-options:trickle
a=fingerprint:sha-256 ED:7D:94:9C:7F:3A:E9:7B:55:EB:FC:80:EA:44:7D:D1:5B:20:AB:57:6D:71:F7:45:AF:F5:05:25:6C:AA:10:3F
a=setup:actpass
a=mid:1
a=sendonly
a=msid:- 3c1cdfb7-8fcd-4b94-8c26-057acaec242f
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: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:103 rtx/90000
a=fmtp:103 apt=102
a=rtpmap:104 H264/90000
a=rtcp-fb:104 goog-remb
a=rtcp-fb:104 transport-cc
a=rtcp-fb:104 ccm fir
a=rtcp-fb:104 nack
a=rtcp-fb:104 nack pli
a=fmtp:104 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42001f
a=rtpmap:105 rtx/90000
a=fmtp:105 apt=104
a=rtpmap:106 H264/90000
a=rtcp-fb:106 goog-remb
a=rtcp-fb:106 transport-cc
a=rtcp-fb:106 ccm fir
a=rtcp-fb:106 nack
a=rtcp-fb:106 nack pli
a=fmtp:106 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
a=rtpmap:107 rtx/90000
a=fmtp:107 apt=106
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: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=1;profile-level-id=4d001f
a=rtpmap:125 rtx/90000
a=fmtp:125 apt=127
a=rtpmap:39 H264/90000
a=rtcp-fb:39 goog-remb
a=rtcp-fb:39 transport-cc
a=rtcp-fb:39 ccm fir
a=rtcp-fb:39 nack
a=rtcp-fb:39 nack pli
a=fmtp:39 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=4d001f
a=rtpmap:40 rtx/90000
a=fmtp:40 apt=39
a=rtpmap:45 AV1/90000
a=rtcp-fb:45 goog-remb
a=rtcp-fb:45 transport-cc
a=rtcp-fb:45 ccm fir
a=rtcp-fb:45 nack
a=rtcp-fb:45 nack pli
a=fmtp:45 level-idx=5;profile=0;tier=0
a=rtpmap:46 rtx/90000
a=fmtp:46 apt=45
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:112 H264/90000
a=rtcp-fb:112 goog-remb
a=rtcp-fb:112 transport-cc
a=rtcp-fb:112 ccm fir
a=rtcp-fb:112 nack
a=rtcp-fb:112 nack pli
a=fmtp:112 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=64001f
a=rtpmap:113 rtx/90000
a=fmtp:113 apt=112
a=rtpmap:116 red/90000
a=rtpmap:117 rtx/90000
a=fmtp:117 apt=116
a=rtpmap:118 ulpfec/90000
a=ssrc-group:FID 1826441427 1051831965
a=ssrc:1826441427 cname:evls19uC3prPBhhp
a=ssrc:1826441427 msid:- 3c1cdfb7-8fcd-4b94-8c26-057acaec242f
a=ssrc:1051831965 cname:evls19uC3prPBhhp
a=ssrc:1051831965 msid:- 3c1cdfb7-8fcd-4b94-8c26-057acaec242f

3.answer sdp

v=0
o=SRS/5.0.64(Bee) 140528444707488 2 IN IP4 0.0.0.0
s=SRSPublishSession
t=0 0
a=ice-lite
a=group:BUNDLE 0 1
a=msid-semantic: WMS live/livestream
m=audio 9 UDP/TLS/RTP/SAVPF 111
c=IN IP4 0.0.0.0
a=ice-ufrag:7r520w3r
a=ice-pwd:071r99710534b95201n761k26qq81957
a=fingerprint:sha-256 24:1D:C4:C6:DB:1A:CD:11:78:1F:32:C9:40:9B:0D:AD:DD:12:EE:63:C3:C0:DC:A5:D7:58:1C:60:CA:28:5B:EC
a=setup:passive
a=mid:0
a=recvonly
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
a=candidate:0 1 udp 2130706431 172.24.6.238 8000 typ host generation 0
m=video 9 UDP/TLS/RTP/SAVPF 106 116
c=IN IP4 0.0.0.0
a=ice-ufrag:7r520w3r
a=ice-pwd:071r99710534b95201n761k26qq81957
a=fingerprint:sha-256 24:1D:C4:C6:DB:1A:CD:11:78:1F:32:C9:40:9B:0D:AD:DD:12:EE:63:C3:C0:DC:A5:D7:58:1C:60:CA:28:5B:EC
a=setup:passive
a=mid:1
a=recvonly
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:106 H264/90000
a=rtcp-fb:106 transport-cc
a=rtcp-fb:106 nack
a=rtcp-fb:106 nack pli
a=fmtp:106 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
a=rtpmap:116 red/90000
a=candidate:0 1 udp 2130706431 172.24.6.238 8000 typ host generation 0
0条评论
作者已关闭评论
y****n
4文章数
0粉丝数
y****n
4 文章 | 0 粉丝
原创

Webrtc推流-SDP交互

2024-09-04 09:42:35
9
0

1.简介

        本文介绍了webrtc推流时,推流端与服务端的sdp交互流程

2.主要流程

  1. 客户端首先获取offer sdp,里面包含了客户端支持的音视频编码格式等信息
  2. 客户端通过信令服务器,将offer sdp发送给服务端
  3. 服务端收到offer sdp后,选择自己意向的编码格式,生成answer sdp
  4. 服务端通过信令服务器,返回answer sdp给客户端

3.offer sdp

v=0
o=- 3053614121604473466 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1
a=extmap-allow-mixed
a=msid-semantic: WMS
m=audio 9 UDP/TLS/RTP/SAVPF 111 63 9 0 8 13 110 126
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:mV4G
a=ice-pwd:yMz7z1inGraCTegW/iRtBNNB
a=ice-options:trickle
a=fingerprint:sha-256 ED:7D:94:9C:7F:3A:E9:7B:55:EB:FC:80:EA:44:7D:D1:5B:20:AB:57:6D:71:F7:45:AF:F5:05:25:6C:AA:10:3F
a=setup:actpass
a=mid:0
a=sendonly
a=msid:- 80a21af4-157f-4b1e-862f-9eff1253738d
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
a=rtpmap:63 red/48000/2
a=fmtp:63 111/111
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:13 CN/8000
a=rtpmap:110 telephone-event/48000
a=rtpmap:126 telephone-event/8000
a=ssrc:1536335743 cname:evls19uC3prPBhhp
a=ssrc:1536335743 msid:- 80a21af4-157f-4b1e-862f-9eff1253738d
m=video 9 UDP/TLS/RTP/SAVPF 96 97 102 103 104 105 106 107 108 109 127 125 39 40 45 46 98 99 100 101 112 113 116 117 118
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:mV4G
a=ice-pwd:yMz7z1inGraCTegW/iRtBNNB
a=ice-options:trickle
a=fingerprint:sha-256 ED:7D:94:9C:7F:3A:E9:7B:55:EB:FC:80:EA:44:7D:D1:5B:20:AB:57:6D:71:F7:45:AF:F5:05:25:6C:AA:10:3F
a=setup:actpass
a=mid:1
a=sendonly
a=msid:- 3c1cdfb7-8fcd-4b94-8c26-057acaec242f
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: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:103 rtx/90000
a=fmtp:103 apt=102
a=rtpmap:104 H264/90000
a=rtcp-fb:104 goog-remb
a=rtcp-fb:104 transport-cc
a=rtcp-fb:104 ccm fir
a=rtcp-fb:104 nack
a=rtcp-fb:104 nack pli
a=fmtp:104 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42001f
a=rtpmap:105 rtx/90000
a=fmtp:105 apt=104
a=rtpmap:106 H264/90000
a=rtcp-fb:106 goog-remb
a=rtcp-fb:106 transport-cc
a=rtcp-fb:106 ccm fir
a=rtcp-fb:106 nack
a=rtcp-fb:106 nack pli
a=fmtp:106 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
a=rtpmap:107 rtx/90000
a=fmtp:107 apt=106
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: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=1;profile-level-id=4d001f
a=rtpmap:125 rtx/90000
a=fmtp:125 apt=127
a=rtpmap:39 H264/90000
a=rtcp-fb:39 goog-remb
a=rtcp-fb:39 transport-cc
a=rtcp-fb:39 ccm fir
a=rtcp-fb:39 nack
a=rtcp-fb:39 nack pli
a=fmtp:39 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=4d001f
a=rtpmap:40 rtx/90000
a=fmtp:40 apt=39
a=rtpmap:45 AV1/90000
a=rtcp-fb:45 goog-remb
a=rtcp-fb:45 transport-cc
a=rtcp-fb:45 ccm fir
a=rtcp-fb:45 nack
a=rtcp-fb:45 nack pli
a=fmtp:45 level-idx=5;profile=0;tier=0
a=rtpmap:46 rtx/90000
a=fmtp:46 apt=45
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:112 H264/90000
a=rtcp-fb:112 goog-remb
a=rtcp-fb:112 transport-cc
a=rtcp-fb:112 ccm fir
a=rtcp-fb:112 nack
a=rtcp-fb:112 nack pli
a=fmtp:112 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=64001f
a=rtpmap:113 rtx/90000
a=fmtp:113 apt=112
a=rtpmap:116 red/90000
a=rtpmap:117 rtx/90000
a=fmtp:117 apt=116
a=rtpmap:118 ulpfec/90000
a=ssrc-group:FID 1826441427 1051831965
a=ssrc:1826441427 cname:evls19uC3prPBhhp
a=ssrc:1826441427 msid:- 3c1cdfb7-8fcd-4b94-8c26-057acaec242f
a=ssrc:1051831965 cname:evls19uC3prPBhhp
a=ssrc:1051831965 msid:- 3c1cdfb7-8fcd-4b94-8c26-057acaec242f

3.answer sdp

v=0
o=SRS/5.0.64(Bee) 140528444707488 2 IN IP4 0.0.0.0
s=SRSPublishSession
t=0 0
a=ice-lite
a=group:BUNDLE 0 1
a=msid-semantic: WMS live/livestream
m=audio 9 UDP/TLS/RTP/SAVPF 111
c=IN IP4 0.0.0.0
a=ice-ufrag:7r520w3r
a=ice-pwd:071r99710534b95201n761k26qq81957
a=fingerprint:sha-256 24:1D:C4:C6:DB:1A:CD:11:78:1F:32:C9:40:9B:0D:AD:DD:12:EE:63:C3:C0:DC:A5:D7:58:1C:60:CA:28:5B:EC
a=setup:passive
a=mid:0
a=recvonly
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
a=candidate:0 1 udp 2130706431 172.24.6.238 8000 typ host generation 0
m=video 9 UDP/TLS/RTP/SAVPF 106 116
c=IN IP4 0.0.0.0
a=ice-ufrag:7r520w3r
a=ice-pwd:071r99710534b95201n761k26qq81957
a=fingerprint:sha-256 24:1D:C4:C6:DB:1A:CD:11:78:1F:32:C9:40:9B:0D:AD:DD:12:EE:63:C3:C0:DC:A5:D7:58:1C:60:CA:28:5B:EC
a=setup:passive
a=mid:1
a=recvonly
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:106 H264/90000
a=rtcp-fb:106 transport-cc
a=rtcp-fb:106 nack
a=rtcp-fb:106 nack pli
a=fmtp:106 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
a=rtpmap:116 red/90000
a=candidate:0 1 udp 2130706431 172.24.6.238 8000 typ host generation 0
文章来自个人专栏
流媒体
4 文章 | 1 订阅
0条评论
作者已关闭评论
作者已关闭评论
0
0