WebRTC connection failed

132 Views Asked by At

I'm currently building a video chat application using python aiortc for a desktop application and JavaScript for the browser application.

for now i am only trying to stream video from the desktop application to the browser (chrome). I've successfully exchanged SDP and ICE candidates between peers, and i expected the browser to start receiving video frames. but I ran into an issue in establishing the connection (the browser connection state changes to connecting then failed), even though both applications are running on the same machine. i am using google's stun server "stun.l.google.com:19305" for both peers with no turn server. my local ip address is 192.168.1.18 I was wondering if anyone in the community has encountered a similar issue before and could offer some suggestions or advice on how to troubleshoot it. here is the sdp of the offer:

v=0
o=- 3892138848 3892138848 IN IP4 0.0.0.0
s=-
t=0 0
a=group:BUNDLE 0
a=msid-semantic:WMS *
m=video 37981 UDP/TLS/RTP/SAVPF 96 97 102 123 125 107
c=IN IP4 192.168.1.18
a=sendonly
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid
a=mid:0
a=msid:84e4e0c4-e245-4c9c-82d0-4fae9e42da73 7b602d3e-8b49-40cd-b620-59e55c501fb5
a=rtcp:9 IN IP4 0.0.0.0
a=rtcp-mux
a=ssrc-group:FID 1641309444 1855287933
a=ssrc:1641309444 cname:0414464c-032d-45c6-98a0-26c1bcfc093f
a=ssrc:1855287933 cname:0414464c-032d-45c6-98a0-26c1bcfc093f
a=rtpmap:96 VP8/90000
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
a=rtcp-fb:96 goog-remb
a=rtpmap:97 rtx/90000
a=fmtp:97 apt=96
a=rtpmap:102 H264/90000
a=rtcp-fb:102 nack
a=rtcp-fb:102 nack pli
a=rtcp-fb:102 goog-remb
a=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f
a=rtpmap:123 rtx/90000
a=fmtp:123 apt=102
a=rtpmap:125 H264/90000
a=rtcp-fb:125 nack
a=rtcp-fb:125 nack pli
a=rtcp-fb:125 goog-remb
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=candidate:376db875d7c62c6877336db91f13c833 1 udp 2130706431 192.168.1.18 37981 typ host
a=candidate:95a5144d22d827ac85a6c13daea75649 1 udp 2130706431 172.18.0.1 49786 typ host
a=candidate:17df9441e1a496b7f666bdcfb3826610 1 udp 2130706431 172.19.0.1 46876 typ host
a=candidate:96744b746ca3046d82efb394e4c2b69c 1 udp 2130706431 172.21.0.1 51900 typ host
a=candidate:580b5f32035da7f14a30ea7a8d826c67 1 udp 2130706431 172.17.0.1 44326 typ host
a=candidate:502a6caeec7cd58b56f9167af0a2599e 1 udp 1694498815 197.238.176.74 37981 typ srflx raddr 192.168.1.18 rport 37981
a=candidate:e561fd838710cb12e3ec857899f83408 1 udp 1694498815 197.238.176.74 46876 typ srflx raddr 172.19.0.1 rport 46876
a=candidate:0f3b412dcd29d04164d632fd05c6959f 1 udp 1694498815 197.238.176.74 51900 typ srflx raddr 172.21.0.1 rport 51900
a=candidate:297898e4296c74660bb3ab65d8da90ec 1 udp 1694498815 197.238.176.74 49786 typ srflx raddr 172.18.0.1 rport 49786
a=candidate:0ad8db753210ce9554cf251a9e51e792 1 udp 1694498815 197.238.176.74 44326 typ srflx raddr 172.17.0.1 rport 44326
a=end-of-candidates
a=ice-ufrag:dJ8h
a=ice-pwd:vB5sFw5TfaU4JOyUeDvKpV
a=fingerprint:sha-256 E4:DE:2C:1D:9F:30:26:3E:C0:23:31:B7:5C:06:4E:85:9A:B8:3A:4C:16:D2:49:EE:DD:C4:AF:C0:9A:1F:4C:B6
a=setup:active```
v=0
o=- 8355756947036896539 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0
a=extmap-allow-mixed
a=msid-semantic: WMS
m=video 34980 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 35 36 37 38 102 123 127 122 125 107 108 109 124 121 39 40 41 42 43 44 45 46 120 119 114 47
c=IN IP4 197.238.176.74
a=rtcp:9 IN IP4 0.0.0.0
a=candidate:918459911 1 udp 2122260223 192.168.1.18 34980 typ host generation 0 network-id 1 network-cost 10
a=candidate:3232690131 1 udp 1686052607 197.238.176.74 34980 typ srflx raddr 192.168.1.18 rport 34980 generation 0 network-id 1 network-cost 10
a=candidate:2017290999 1 tcp 1518280447 192.168.1.18 9 typ host tcptype active generation 0 network-id 1 network-cost 10
a=ice-ufrag:33f4
a=ice-pwd:h+apO00yIaDbueM62A8j6T3a
a=ice-options:trickle
a=fingerprint:sha-256 C4:EB:61:44:C9:B5:0B:76:DD:9D:8E:9F:87:19:FD:33:DD:B6:FB:16:03:38:88:B3:33:12:23:CD:EA:FD:4E:80
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=recvonly
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:35 VP9/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=fmtp:35 profile-id=1
a=rtpmap:36 rtx/90000
a=fmtp:36 apt=35
a=rtpmap:37 VP9/90000
a=rtcp-fb:37 goog-remb
a=rtcp-fb:37 transport-cc
a=rtcp-fb:37 ccm fir
a=rtcp-fb:37 nack
a=rtcp-fb:37 nack pli
a=fmtp:37 profile-id=3
a=rtpmap:38 rtx/90000
a=fmtp:38 apt=37
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:123 rtx/90000
a=fmtp:123 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:122 rtx/90000
a=fmtp:122 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=4d001f
a=rtpmap:121 rtx/90000
a=fmtp:121 apt=124
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:41 H264/90000
a=rtcp-fb:41 goog-remb
a=rtcp-fb:41 transport-cc
a=rtcp-fb:41 ccm fir
a=rtcp-fb:41 nack
a=rtcp-fb:41 nack pli
a=fmtp:41 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=f4001f
a=rtpmap:42 rtx/90000
a=fmtp:42 apt=41
a=rtpmap:43 H264/90000
a=rtcp-fb:43 goog-remb
a=rtcp-fb:43 transport-cc
a=rtcp-fb:43 ccm fir
a=rtcp-fb:43 nack
a=rtcp-fb:43 nack pli
a=fmtp:43 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=f4001f
a=rtpmap:44 rtx/90000
a=fmtp:44 apt=43
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=rtpmap:46 rtx/90000
a=fmtp:46 apt=45
a=rtpmap:120 red/90000
a=rtpmap:119 rtx/90000
a=fmtp:119 apt=120
a=rtpmap:114 ulpfec/90000
a=rtpmap:47 flexfec-03/90000
a=rtcp-fb:47 goog-remb
a=rtcp-fb:47 transport-cc
a=fmtp:47 repair-window=10000000

and this is the sdp of the answer :

v=0
o=- 3892138848 3892138848 IN IP4 0.0.0.0
s=-
t=0 0
a=group:BUNDLE 0
a=msid-semantic:WMS *
m=video 37981 UDP/TLS/RTP/SAVPF 96 97 102 123 125 107
c=IN IP4 192.168.1.18
a=sendonly
a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid
a=mid:0
a=msid:84e4e0c4-e245-4c9c-82d0-4fae9e42da73 7b602d3e-8b49-40cd-b620-59e55c501fb5
a=rtcp:9 IN IP4 0.0.0.0
a=rtcp-mux
a=ssrc-group:FID 1641309444 1855287933
a=ssrc:1641309444 cname:0414464c-032d-45c6-98a0-26c1bcfc093f
a=ssrc:1855287933 cname:0414464c-032d-45c6-98a0-26c1bcfc093f
a=rtpmap:96 VP8/90000
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
a=rtcp-fb:96 goog-remb
a=rtpmap:97 rtx/90000
a=fmtp:97 apt=96
a=rtpmap:102 H264/90000
a=rtcp-fb:102 nack
a=rtcp-fb:102 nack pli
a=rtcp-fb:102 goog-remb
a=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f
a=rtpmap:123 rtx/90000
a=fmtp:123 apt=102
a=rtpmap:125 H264/90000
a=rtcp-fb:125 nack
a=rtcp-fb:125 nack pli
a=rtcp-fb:125 goog-remb
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=candidate:376db875d7c62c6877336db91f13c833 1 udp 2130706431 192.168.1.18 37981 typ host
a=candidate:95a5144d22d827ac85a6c13daea75649 1 udp 2130706431 172.18.0.1 49786 typ host
a=candidate:17df9441e1a496b7f666bdcfb3826610 1 udp 2130706431 172.19.0.1 46876 typ host
a=candidate:96744b746ca3046d82efb394e4c2b69c 1 udp 2130706431 172.21.0.1 51900 typ host
a=candidate:580b5f32035da7f14a30ea7a8d826c67 1 udp 2130706431 172.17.0.1 44326 typ host
a=candidate:502a6caeec7cd58b56f9167af0a2599e 1 udp 1694498815 197.238.176.74 37981 typ srflx raddr 192.168.1.18 rport 37981
a=candidate:e561fd838710cb12e3ec857899f83408 1 udp 1694498815 197.238.176.74 46876 typ srflx raddr 172.19.0.1 rport 46876
a=candidate:0f3b412dcd29d04164d632fd05c6959f 1 udp 1694498815 197.238.176.74 51900 typ srflx raddr 172.21.0.1 rport 51900
a=candidate:297898e4296c74660bb3ab65d8da90ec 1 udp 1694498815 197.238.176.74 49786 typ srflx raddr 172.18.0.1 rport 49786
a=candidate:0ad8db753210ce9554cf251a9e51e792 1 udp 1694498815 197.238.176.74 44326 typ srflx raddr 172.17.0.1 rport 44326
a=end-of-candidates
a=ice-ufrag:dJ8h
a=ice-pwd:vB5sFw5TfaU4JOyUeDvKpV
a=fingerprint:sha-256 E4:DE:2C:1D:9F:30:26:3E:C0:23:31:B7:5C:06:4E:85:9A:B8:3A:4C:16:D2:49:EE:DD:C4:AF:C0:9A:1F:4C:B6
a=setup:active

Thanks in advance!

0

There are 0 best solutions below