pion / example-webrtc-applications

Examples of WebRTC applications that are large, or use 3rd party libraries
https://pion.ly/
MIT License
1.04k stars 247 forks source link

sfu-ws crashed for sdp mismatch #6

Closed jinleileiking closed 5 years ago

jinleileiking commented 5 years ago

Your environment.

What did you do?

run sfu-ws example, click publish

What did you expect?

Do not crash

What happened?

crashed

2019/04/10 19:42:17 http: panic serving 10.232.7.215:59926: TypeError: offer SDP semantics does not match configuration
goroutine 25 [running]:
net/http.(*conn).serve.func1(0xc000330140)
        /home/jinlei1/os/go/src/net/http/server.go:1769 +0xc9
panic(0x9438e0, 0xc000399350)
        /home/jinlei1/os/go/src/runtime/panic.go:522 +0x1b5
main.checkError(...)
        /home/jinlei1/ksyun/src/github.com/pion/example-webrtc-applications/sfu-ws/main.go:16
main.room(0xaad8c0, 0xc0003561c0, 0xc00018a300)
        /home/jinlei1/ksyun/src/github.com/pion/example-webrtc-applications/sfu-ws/room.go:142 +0x8f7
net/http.HandlerFunc.ServeHTTP(0xa0ff50, 0xaad8c0, 0xc0003561c0, 0xc00018a300)
        /home/jinlei1/os/go/src/net/http/server.go:1995 +0x44
net/http.(*ServeMux).ServeHTTP(0xe8bf40, 0xaad8c0, 0xc0003561c0, 0xc00018a300)
        /home/jinlei1/os/go/src/net/http/server.go:2375 +0x1d6
net/http.serverHandler.ServeHTTP(0xc00019e340, 0xaad8c0, 0xc0003561c0, 0xc00018a300)
        /home/jinlei1/os/go/src/net/http/server.go:2774 +0xab
net/http.(*conn).serve(0xc000330140, 0xaaeb00, 0xc0001849c0)
        /home/jinlei1/os/go/src/net/http/server.go:1878 +0x84c
created by net/http.(*Server).Serve
        /home/jinlei1/os/go/src/net/http/server.go:2884 +0x2f4
jinleileiking commented 5 years ago

browser sdp:

v=0
o=- 5667747449333056332 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE audio video
a=msid-semantic: WMS 16456tjcxRpJImDVLaFNzl32WjNIumDG4ySX
m=audio 58653 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126
c=IN IP4 192.168.76.88
a=rtcp:9 IN IP4 0.0.0.0
a=candidate:650067990 1 udp 2122260223 192.168.76.88 58653 typ host generation 0 network-id 1 network-cost 10
a=candidate:1158031425 1 udp 2122194687 10.232.7.215 52381 typ host generation 0 network-id 2 network-cost 50
a=candidate:1748810982 1 tcp 1518280447 192.168.76.88 9 typ host tcptype active generation 0 network-id 1 network-cost 10
a=candidate:193320113 1 tcp 1518214911 10.232.7.215 9 typ host tcptype active generation 0 network-id 2 network-cost 50
a=ice-ufrag:5cb9
a=ice-pwd:xumhIf5418EP/NiP3l+bVqnY
a=ice-options:trickle
a=fingerprint:sha-256 04:6F:F9:72:02:F7:65:E4:CD:61:83:81:97:A1:95:A0:72:FD:33:48:1D:BA:4B:04:5C:34:73:4F:EA:6A:CD:8C
a=setup:actpass
a=mid:audio
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=sendrecv
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:106 CN/32000
a=rtpmap:105 CN/16000
a=rtpmap:13 CN/8000
a=rtpmap:110 telephone-event/48000
a=rtpmap:112 telephone-event/32000
a=rtpmap:113 telephone-event/16000
a=rtpmap:126 telephone-event/8000
a=ssrc:2902567662 cname:vRk6NTLMTMkGrmyP
a=ssrc:2902567662 msid:16456tjcxRpJImDVLaFNzl32WjNIumDG4ySX 713256c6-661a-43bb-a6d5-563cfaa9d4b9
a=ssrc:2902567662 mslabel:16456tjcxRpJImDVLaFNzl32WjNIumDG4ySX
a=ssrc:2902567662 label:713256c6-661a-43bb-a6d5-563cfaa9d4b9
m=video 49722 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 102 122 127 121 125 107 108 109 124 120 123 119 114
c=IN IP4 192.168.76.88
a=rtcp:9 IN IP4 0.0.0.0
a=candidate:650067990 1 udp 2122260223 192.168.76.88 49722 typ host generation 0 network-id 1 network-cost 10
a=candidate:1158031425 1 udp 2122194687 10.232.7.215 60917 typ host generation 0 network-id 2 network-cost 50
a=candidate:1748810982 1 tcp 1518280447 192.168.76.88 9 typ host tcptype active generation 0 network-id 1 network-cost 10
a=candidate:193320113 1 tcp 1518214911 10.232.7.215 9 typ host tcptype active generation 0 network-id 2 network-cost 50
a=ice-ufrag:5cb9
a=ice-pwd:xumhIf5418EP/NiP3l+bVqnY
a=ice-options:trickle
a=fingerprint:sha-256 04:6F:F9:72:02:F7:65:E4:CD:61:83:81:97:A1:95:A0:72:FD:33:48:1D:BA:4B:04:5C:34:73:4F:EA:6A:CD:8C
a=setup:actpass
a=mid:video
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 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
a=extmap:10 http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07
a=sendrecv
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 H264/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 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f
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=0;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=1;profile-level-id=42e01f
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=0;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=1;profile-level-id=4d0032
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=640032
a=rtpmap:120 rtx/90000
a=fmtp:120 apt=124
a=rtpmap:123 red/90000
a=rtpmap:119 rtx/90000
a=fmtp:119 apt=123
a=rtpmap:114 ulpfec/90000
a=ssrc-group:FID 1979325835 2697097421
a=ssrc:1979325835 cname:vRk6NTLMTMkGrmyP
a=ssrc:1979325835 msid:16456tjcxRpJImDVLaFNzl32WjNIumDG4ySX e797f0a3-2e4f-43ed-af5c-ca374df32bf6
a=ssrc:1979325835 mslabel:16456tjcxRpJImDVLaFNzl32WjNIumDG4ySX
a=ssrc:1979325835 label:e797f0a3-2e4f-43ed-af5c-ca374df32bf6
a=ssrc:2697097421 cname:vRk6NTLMTMkGrmyP
a=ssrc:2697097421 msid:16456tjcxRpJImDVLaFNzl32WjNIumDG4ySX e797f0a3-2e4f-43ed-af5c-ca374df32bf6
a=ssrc:2697097421 mslabel:16456tjcxRpJImDVLaFNzl32WjNIumDG4ySX
a=ssrc:2697097421 label:e797f0a3-2e4f-43ed-af5c-ca374df32bf6
mjmac commented 5 years ago

Hi @jinleileiking! I believe that this is because the default SDP format is now unified plan, and your offer is in plan-b format. If you want to continue using plan-b, you need to either add SDPSemantics: SDPSemanticsPlanB or SDPSemantics: SDPSemanticsUnifiedPlanWithFallback to your PeerConnection configuration.