adamrehn / pixel-streaming-linux

Issue tracker repository for Pixel Streaming for Linux
https://adamrehn.com/articles/pixel-streaming-in-linux-containers/
22 stars 7 forks source link

WebRTC works locally but not from outside #36

Closed lcdlv closed 3 years ago

lcdlv commented 3 years ago

Hi! Using a NICE DVC with Ubuntu 20.04 I could did it work locally. https://aws.amazon.com/marketplace/pp/prodview-lz7tjiqyswgqk?ref_=unifiedsearch I opened all port in AWS, and I launched the WebRTC with Turn Server to access for outside. This is how I launch WebRTC:

sudo node cirrus --publicIp 54.233.186.77 --peerConnectionOptions="{ \""iceServers\"": [{\""urls\"": [\""stun:stun.l.google.com:19302\"",\""stun:54.233.186.77:19302\"",\""turn:54.233.186.77:19303\""], \""username\"": \""PixelStreamingUser\"", \""credential\"": \""Another\""}]}

If I connect from outside, the Unreal Project (the game) throw alot of this errors after "Click to Start" in the Pixel Streaming landing page (yes, I can see the landing page, so the 80 port is working):

LogCudaVideoEncoder: Buffer #65318 (0) Dropped LogCudaVideoEncoder: Buffer #65319 (0) Dropped

The landing page still in "Starting connection to server, please wait" and I never get the Play Button. But, if I do this inside the VM, all works fine.

lcdlv commented 3 years ago

Update: I thought "maybe is a AWS problem, like a firewall or something", so I installed a Ubuntu 20.04 machine in paperspace.com, configured all the same as AWS, and I got the same error. So, is a problem related to WebRTC and not with the machine host.

lcdlv commented 3 years ago

Hi Guys! I need some answer!! What can I do!? @lukehb

lukehb commented 3 years ago

A few question:

  1. What project are you running, is it the Pixel Streaming Demo?
  2. What happens if you run Cirrus signalling server like so sudo node cirrus and try to connect? (Technically it should work unless your connection requires TURN, I believe Cirrus will, by default, use one of Google's STUN servers).
  3. Is your Cirrus webserver serving player.htm or PixelDemo.htm?
  4. What are the logs in the browser and the UE instance when it errors?

I will try to replicate connecting to an AWS instance some time this week, my apologies though, my time is very limited atm.

lcdlv commented 3 years ago

Hi @lukehb , thanks for replay:

Here is a video of the problem: https://drive.google.com/file/d/1iJGcGGcpRkB9ua3wunt21k-IXTwUyr7C/view?usp=sharing

1) I'm running my own project. 2) I run "sudo node cirrus" and the servers works fine in LOCALHOST, but no from outside using the public IP. 3) I'm using player.htm, is the server with came with the engine, with out modifications. 4) This is the log of Unreal:

LogCudaVideoEncoder: Buffer #65318 (0) Dropped LogCudaVideoEncoder: Buffer #65319 (0) Dropped

Log from the browser:

app.js:1508 <- SS: {"type":"config","peerConnectionOptions":{}} app.js:331 Creating offer webRtcPlayer.js:84 Created datachannel (cirrus) app.js:1508 <- SS: {"type":"playerCount","count":2} app.js:372 -> SS: offer: {"type":"offer","sdp":"v=0\r\no=- 2858647657257563822 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0 1 2\r\na=msid-semantic: WMS\r\nm=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 106 105 13 110 112 113 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:o2NM\r\na=ice-pwd:ZxoLklkQI69/UVf0PjyUgbHO\r\na=ice-options:trickle\r\na=fingerprint:sha-256 7D:67:C6:19:E3:4F:55:47:B0:17:51:B2:D4:A3:F4:11:45:F0:8E:00:19:C9:27:74:6F:E0:6E:0C:BA:64:7D:90\r\na=setup:actpass\r\na=mid:0\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id\r\na=extmap:6 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id\r\na=recvonly\r\na=rtcp-mux\r\na=rtpmap:111 opus/48000/2\r\na=rtcp-fb:111 transport-cc\r\na=fmtp:111 minptime=10;useinbandfec=1\r\na=rtpmap:103 ISAC/16000\r\na=rtpmap:104 ISAC/32000\r\na=rtpmap:9 G722/8000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:106 CN/32000\r\na=rtpmap:105 CN/16000\r\na=rtpmap:13 CN/8000\r\na=rtpmap:110 telephone-event/48000\r\na=rtpmap:112 telephone-event/32000\r\na=rtpmap:113 telephone-event/16000\r\na=rtpmap:126 telephone-event/8000\r\nm=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 122 102 121 127 120 125 107 108 109 124 119 123 118 114 115 116\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:o2NM\r\na=ice-pwd:ZxoLklkQI69/UVf0PjyUgbHO\r\na=ice-options:trickle\r\na=fingerprint:sha-256 7D:67:C6:19:E3:4F:55:47:B0:17:51:B2:D4:A3:F4:11:45:F0:8E:00:19:C9:27:74:6F:E0:6E:0C:BA:64:7D:90\r\na=setup:actpass\r\na=mid:1\r\na=extmap:14 urn:ietf:params:rtp-hdrext:toffset\r\na=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:13 urn:3gpp:video-orientation\r\na=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:12 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\na=extmap:11 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type\r\na=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing\r\na=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/color-space\r\na=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=extmap:5 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id\r\na=extmap:6 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id\r\na=recvonly\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:96 VP8/90000\r\na=rtcp-fb:96 goog-remb\r\na=rtcp-fb:96 transport-cc\r\na=rtcp-fb:96 ccm fir\r\na=rtcp-fb:96 nack\r\na=rtcp-fb:96 nack pli\r\na=rtpmap:97 rtx/90000\r\na=fmtp:97 apt=96\r\na=rtpmap:98 VP9/90000\r\na=rtcp-fb:98 goog-remb\r\na=rtcp-fb:98 transport-cc\r\na=rtcp-fb:98 ccm fir\r\na=rtcp-fb:98 nack\r\na=rtcp-fb:98 nack pli\r\na=fmtp:98 profile-id=0\r\na=rtpmap:99 rtx/90000\r\na=fmtp:99 apt=98\r\na=rtpmap:100 VP9/90000\r\na=rtcp-fb:100 goog-remb\r\na=rtcp-fb:100 transport-cc\r\na=rtcp-fb:100 ccm fir\r\na=rtcp-fb:100 nack\r\na=rtcp-fb:100 nack pli\r\na=fmtp:100 profile-id=2\r\na=rtpmap:101 rtx/90000\r\na=fmtp:101 apt=100\r\na=rtpmap:122 VP9/90000\r\na=rtcp-fb:122 goog-remb\r\na=rtcp-fb:122 transport-cc\r\na=rtcp-fb:122 ccm fir\r\na=rtcp-fb:122 nack\r\na=rtcp-fb:122 nack pli\r\na=fmtp:122 profile-id=1\r\na=rtpmap:102 H264/90000\r\na=rtcp-fb:102 goog-remb\r\na=rtcp-fb:102 transport-cc\r\na=rtcp-fb:102 ccm fir\r\na=rtcp-fb:102 nack\r\na=rtcp-fb:102 nack pli\r\na=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f;x-google-start-bitrate=10000;x-google-max-bitrate=20000\r\na=rtpmap:121 rtx/90000\r\na=fmtp:121 apt=102\r\na=rtpmap:127 H264/90000\r\na=rtcp-fb:127 goog-remb\r\na=rtcp-fb:127 transport-cc\r\na=rtcp-fb:127 ccm fir\r\na=rtcp-fb:127 nack\r\na=rtcp-fb:127 nack pli\r\na=fmtp:127 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42001f;x-google-start-bitrate=10000;x-google-max-bitrate=20000\r\na=rtpmap:120 rtx/90000\r\na=fmtp:120 apt=127\r\na=rtpmap:125 H264/90000\r\na=rtcp-fb:125 goog-remb\r\na=rtcp-fb:125 transport-cc\r\na=rtcp-fb:125 ccm fir\r\na=rtcp-fb:125 nack\r\na=rtcp-fb:125 nack pli\r\na=fmtp:125 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f;x-google-start-bitrate=10000;x-google-max-bitrate=20000\r\na=rtpmap:107 rtx/90000\r\na=fmtp:107 apt=125\r\na=rtpmap:108 H264/90000\r\na=rtcp-fb:108 goog-remb\r\na=rtcp-fb:108 transport-cc\r\na=rtcp-fb:108 ccm fir\r\na=rtcp-fb:108 nack\r\na=rtcp-fb:108 nack pli\r\na=fmtp:108 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01f;x-google-start-bitrate=10000;x-google-max-bitrate=20000\r\na=rtpmap:109 rtx/90000\r\na=fmtp:109 apt=108\r\na=rtpmap:124 H264/90000\r\na=rtcp-fb:124 goog-remb\r\na=rtcp-fb:124 transport-cc\r\na=rtcp-fb:124 ccm fir\r\na=rtcp-fb:124 nack\r\na=rtcp-fb:124 nack pli\r\na=fmtp:124 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=4d001f;x-google-start-bitrate=10000;x-google-max-bitrate=20000\r\na=rtpmap:119 rtx/90000\r\na=fmtp:119 apt=124\r\na=rtpmap:123 H264/90000\r\na=rtcp-fb:123 goog-remb\r\na=rtcp-fb:123 transport-cc\r\na=rtcp-fb:123 ccm fir\r\na=rtcp-fb:123 nack\r\na=rtcp-fb:123 nack pli\r\na=fmtp:123 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=64001f;x-google-start-bitrate=10000;x-google-max-bitrate=20000\r\na=rtpmap:118 rtx/90000\r\na=fmtp:118 apt=123\r\na=rtpmap:114 red/90000\r\na=rtpmap:115 rtx/90000\r\na=fmtp:115 apt=114\r\na=rtpmap:116 ulpfec/90000\r\nm=application 9 UDP/DTLS/SCTP webrtc-datachannel\r\nc=IN IP4 0.0.0.0\r\na=ice-ufrag:o2NM\r\na=ice-pwd:ZxoLklkQI69/UVf0PjyUgbHO\r\na=ice-options:trickle\r\na=fingerprint:sha-256 7D:67:C6:19:E3:4F:55:47:B0:17:51:B2:D4:A3:F4:11:45:F0:8E:00:19:C9:27:74:6F:E0:6E:0C:BA:64:7D:90\r\na=setup:actpass\r\na=mid:2\r\na=sctp-port:5000\r\na=max-message-size:262144\r\n"} webRtcPlayer.js:62 signaling state change: Event {isTrusted: true, type: "signalingstatechange", target: RTCPeerConnection, currentTarget: RTCPeerConnection, eventPhase: 2, …} webRtcPlayer.js:70 ice gathering state change: Event {isTrusted: true, type: "icegatheringstatechange", target: RTCPeerConnection, currentTarget: RTCPeerConnection, eventPhase: 2, …} webRtcPlayer.js:111 ICE candidate RTCPeerConnectionIceEvent {isTrusted: true, candidate: RTCIceCandidate, type: "icecandidate", target: RTCPeerConnection, currentTarget: RTCPeerConnection, …} app.js:379 -> SS: iceCandidate { "candidate": "candidate:2138393493 1 udp 2113937151 93e75a75-82b9-4405-a45d-d5dadfdb5a5c.local 60163 typ host generation 0 ufrag o2NM network-cost 999", "sdpMid": "0", "sdpMLineIndex": 0 } webRtcPlayer.js:111 ICE candidate RTCPeerConnectionIceEvent {isTrusted: true, candidate: RTCIceCandidate, type: "icecandidate", target: RTCPeerConnection, currentTarget: RTCPeerConnection, …} app.js:379 -> SS: iceCandidate { "candidate": "candidate:21593112 1 udp 2113939711 7367b4ad-6268-47dd-9b1d-7a064e33a5ed.local 60164 typ host generation 0 ufrag o2NM network-cost 999", "sdpMid": "0", "sdpMLineIndex": 0 } webRtcPlayer.js:111 ICE candidate RTCPeerConnectionIceEvent {isTrusted: true, candidate: RTCIceCandidate, type: "icecandidate", target: RTCPeerConnection, currentTarget: RTCPeerConnection, …} app.js:379 -> SS: iceCandidate { "candidate": "candidate:2138393493 1 udp 2113937151 93e75a75-82b9-4405-a45d-d5dadfdb5a5c.local 60165 typ host generation 0 ufrag o2NM network-cost 999", "sdpMid": "1", "sdpMLineIndex": 1 } webRtcPlayer.js:111 ICE candidate RTCPeerConnectionIceEvent {isTrusted: true, candidate: RTCIceCandidate, type: "icecandidate", target: RTCPeerConnection, currentTarget: RTCPeerConnection, …} app.js:379 -> SS: iceCandidate { "candidate": "candidate:21593112 1 udp 2113939711 7367b4ad-6268-47dd-9b1d-7a064e33a5ed.local 60166 typ host generation 0 ufrag o2NM network-cost 999", "sdpMid": "1", "sdpMLineIndex": 1 } webRtcPlayer.js:111 ICE candidate RTCPeerConnectionIceEvent {isTrusted: true, candidate: RTCIceCandidate, type: "icecandidate", target: RTCPeerConnection, currentTarget: RTCPeerConnection, …} app.js:379 -> SS: iceCandidate { "candidate": "candidate:2138393493 1 udp 2113937151 93e75a75-82b9-4405-a45d-d5dadfdb5a5c.local 60167 typ host generation 0 ufrag o2NM network-cost 999", "sdpMid": "2", "sdpMLineIndex": 2 } webRtcPlayer.js:111 ICE candidate RTCPeerConnectionIceEvent {isTrusted: true, candidate: RTCIceCandidate, type: "icecandidate", target: RTCPeerConnection, currentTarget: RTCPeerConnection, …} app.js:379 -> SS: iceCandidate { "candidate": "candidate:21593112 1 udp 2113939711 7367b4ad-6268-47dd-9b1d-7a064e33a5ed.local 60168 typ host generation 0 ufrag o2NM network-cost 999", "sdpMid": "2", "sdpMLineIndex": 2 } webRtcPlayer.js:70 ice gathering state change: Event {isTrusted: true, type: "icegatheringstatechange", target: RTCPeerConnection, currentTarget: RTCPeerConnection, eventPhase: 2, …} webRtcPlayer.js:111 ICE candidate RTCPeerConnectionIceEvent {isTrusted: true, candidate: null, type: "icecandidate", target: RTCPeerConnection, currentTarget: RTCPeerConnection, …} app.js:1508 <- SS: {"type":"answer","sdp":"v=0\r\no=- 6581020757058797189 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0 1 2\r\na=msid-semantic: WMS stream_id\r\nm=audio 9 UDP/TLS/RTP/SAVPF 111 110\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:rYtW\r\na=ice-pwd:YQSDUq7U3s89QnqC+vCUycKE\r\na=ice-options:trickle\r\na=fingerprint:sha-256 34:30:C9:1D:07:1D:48:71:3A:DC:FA:69:C5:85:A3:55:22:C2:BF:E2:09:E4:D6:AE:0E:1F:49:3D:BF:0F:72:E5\r\na=setup:active\r\na=mid:0\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=sendonly\r\na=msid:stream_id audio_label\r\na=rtcp-mux\r\na=rtpmap:111 opus/48000/2\r\na=rtcp-fb:111 transport-cc\r\na=fmtp:111 minptime=10;useinbandfec=1\r\na=rtpmap:110 telephone-event/48000\r\na=ssrc:2882336318 cname:KS4puk1gQc82kybI\r\na=ssrc:2882336318 msid:stream_id audio_label\r\na=ssrc:2882336318 mslabel:stream_id\r\na=ssrc:2882336318 label:audio_label\r\nm=video 9 UDP/TLS/RTP/SAVPF 125 107 114 115 116\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:rYtW\r\na=ice-pwd:YQSDUq7U3s89QnqC+vCUycKE\r\na=ice-options:trickle\r\na=fingerprint:sha-256 34:30:C9:1D:07:1D:48:71:3A:DC:FA:69:C5:85:A3:55:22:C2:BF:E2:09:E4:D6:AE:0E:1F:49:3D:BF:0F:72:E5\r\na=setup:active\r\na=mid:1\r\na=extmap:14 urn:ietf:params:rtp-hdrext:toffset\r\na=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:13 urn:3gpp:video-orientation\r\na=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:12 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\na=extmap:11 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type\r\na=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing\r\na=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=sendonly\r\na=msid:stream_id video_label\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:125 H264/90000\r\na=rtcp-fb:125 goog-remb\r\na=rtcp-fb:125 transport-cc\r\na=rtcp-fb:125 ccm fir\r\na=rtcp-fb:125 nack\r\na=rtcp-fb:125 nack pli\r\na=fmtp:125 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e034\r\na=rtpmap:107 rtx/90000\r\na=fmtp:107 apt=125\r\na=rtpmap:114 red/90000\r\na=rtpmap:115 rtx/90000\r\na=fmtp:115 apt=114\r\na=rtpmap:116 ulpfec/90000\r\na=ssrc-group:FID 3806479926 2309581139\r\na=ssrc:3806479926 cname:KS4puk1gQc82kybI\r\na=ssrc:3806479926 msid:stream_id video_label\r\na=ssrc:3806479926 mslabel:stream_id\r\na=ssrc:3806479926 label:video_label\r\na=ssrc:2309581139 cname:KS4puk1gQc82kybI\r\na=ssrc:2309581139 msid:stream_id video_label\r\na=ssrc:2309581139 mslabel:stream_id\r\na=ssrc:2309581139 label:video_label\r\nm=application 9 UDP/DTLS/SCTP webrtc-datachannel\r\nc=IN IP4 0.0.0.0\r\nb=AS:30\r\na=ice-ufrag:rYtW\r\na=ice-pwd:YQSDUq7U3s89QnqC+vCUycKE\r\na=ice-options:trickle\r\na=fingerprint:sha-256 34:30:C9:1D:07:1D:48:71:3A:DC:FA:69:C5:85:A3:55:22:C2:BF:E2:09:E4:D6:AE:0E:1F:49:3D:BF:0F:72:E5\r\na=setup:active\r\na=mid:2\r\na=sctp-port:5000\r\n"} webRtcPlayer.js:250 Received answer: [object Object] app.js:1508 <- SS: {"type":"iceCandidate","candidate":{"sdpMid":"0","sdpMLineIndex":0,"candidate":"candidate:3204638622 1 udp 2122260223 172.31.1.72 54742 typ host generation 0 ufrag rYtW network-id 1 network-cost 50"}} webRtcPlayer.js:228 ICE candidate: {sdpMid: "0", sdpMLineIndex: 0, candidate: "candidate:3204638622 1 udp 2122260223 172.31.1.72 …eration 0 ufrag rYtW network-id 1 network-cost 50"} webRtcPlayer.js:62 signaling state change: Event {isTrusted: true, type: "signalingstatechange", target: RTCPeerConnection, currentTarget: RTCPeerConnection, eventPhase: 2, …} webRtcPlayer.js:74 handleOnTrack [MediaStream] webRtcPlayer.js:76 setting video stream from ontrack webRtcPlayer.js:74 handleOnTrack [MediaStream] webRtcPlayer.js:66 ice connection state change: Event {isTrusted: true, type: "iceconnectionstatechange", target: RTCPeerConnection, currentTarget: RTCPeerConnection, eventPhase: 2, …} webRtcPlayer.js:231 ICE candidate successfully added app.js:1508 <- SS: {"type":"iceCandidate","candidate":{"sdpMid":"0","sdpMLineIndex":0,"candidate":"candidate:4051770222 1 tcp 1518280447 172.31.1.72 34837 typ host tcptype passive generation 0 ufrag rYtW network-id 1 network-cost 50"}} webRtcPlayer.js:228 ICE candidate: {sdpMid: "0", sdpMLineIndex: 0, candidate: "candidate:4051770222 1 tcp 1518280447 172.31.1.72 …eration 0 ufrag rYtW network-id 1 network-cost 50"} webRtcPlayer.js:231 ICE candidate successfully added webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:66 ice connection state change: Event {isTrusted: true, type: "iceconnectionstatechange", target: RTCPeerConnection, currentTarget: RTCPeerConnection, eventPhase: 2, …} webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start ----------------------------- webRtcPlayer.js:152 ----------------------------- Stats start -----------------------------

lukehb commented 3 years ago

Thank you for the video, that was quite helpful to understand your setup.

Seeing as you have it working locally on that machine I think it would be helpful to do some log comparisons.

Can you attach to your next reply:

  1. Full log from the browser when connecting via localhost, called browser_local_client.log
  2. Full log from Cirrus when connecting via localhost, called cirrus_local_client.log
  3. Full log from the browser when connecting publicly, called browser_public_client.log
  4. Full log from Cirrus when connecting publicly, called cirrus_public_client.log

When you do the tests can you make sure you use Chrome for localhost and public.

Additionally, can you make sure to restart Cirrus between testing localhost and publicly.

lukehb commented 3 years ago

Try adding

"peerConnectionOptions": "{\"iceServers\":[{\"urls\":[\"stun:stun.l.google.com:19302\"]}]}"

to your config.json

or

sudo node cirrus --peerConnectionOptions="{\"iceServers\":[{\"urls\":[\"stun:stun.l.google.com:19302\"]}]}"

I tried on AWS today and got it working, I just had to specify a STUN server.

lcdlv commented 3 years ago

Hi @lukehb! Thanks to answer. I was trying something like you said, but with no luck. I made a new video, you can see whats happend.

https://drive.google.com/file/d/1_WtX-WJBmwtxa9oPNH85MPh6MZtRmNzc/view?usp=sharing

Onestly, I don't know what more to do, I tried everything. Maybe if you could, I can give you access to my test virtual machine in AWS, and you see by yourself the problem. Everything is in the Desktop/Conteiners folder (the app and the server). In case you can do this, send me a mail to eduardo@go2future.com or give me you mail and I send you how the credentials.

lukehb commented 3 years ago

In the video I notice you are using Chrome to test from outside, there is a reported bug in Chrome 89 where it sends an SDP offer that UE's WebRTC cannot handle. You can try Firefox or and older Chrome, or, until we upgrade WebRTC the fix for those Chrome versions is:

Add this line webRtcPlayer.js to webRTCPlayer() constructor, roughly line 65.

this.cfg.offerExtmapAllowMixed = false

lukehb commented 3 years ago

If it is not the browser, the another possibility is that your personal connection may be behind symmetric NAT, meaning TURN is required. You can test if you are behind symmetric NAT using this JS Fiddle, simple run it on the page using the play button and open the in-page browser to see what it prints out:

https://jsfiddle.net/5ftsd5c2/17/

If neither of those fix it I can have a look at your AWS configuration, my email is the first four letters of my Github username @ tensorworks.com.au

dex1990 commented 3 years ago

Hi @lukehb! Thanks to answer. I was trying something like you said, but with no luck. I made a new video, you can see whats happend.

https://drive.google.com/file/d/1_WtX-WJBmwtxa9oPNH85MPh6MZtRmNzc/view?usp=sharing

Onestly, I don't know what more to do, I tried everything. Maybe if you could, I can give you access to my test virtual machine in AWS, and you see by yourself the problem. Everything is in the Desktop/Conteiners folder (the app and the server). In case you can do this, send me a mail to eduardo@go2future.com or give me you mail and I send you how the credentials.

hi,@lcdlv ,Have you solved your problem?

lcdlv commented 3 years ago

Hi @dex1990 !!! No, but @lukehb (in a amazing gesture of help) got inside my AWS machine and discover the problem is in the TURN server on Ubuntu. The IceCandidate is getting the LAN IP and not the PUBLIC IP, and that can be a configuration problem on AWS. @lukehb recommend use this AMI: https://aws.amazon.com/marketplace/pp/Amazon-Web-Services-AWS-Deep-Learning-AMI-Ubuntu-1/B07Y43P7X5 I will try it today and I will comment my experience.

@lukehb sent me this by mail:

"When I try to connect from outside using Pixel Streaming your AWS instance sends two ICE candidates that looks like this:

a=candidate:3204638622 1 udp 2122260223 172.31.1.72 46949 typ host generation 0 ufrag uy6n network-id 1 network-cost 50 a=candidate:4051770222 1 tcp 1518280447 172.31.1.72 39397 typ host tcptype passive generation 0 ufrag uy6n network-id 1 network-cost 50

Note the address it wants to use for the connection is 172.31.1.72, note also the type is host, typ host. This means WebRTC wants us to connect directly to that IP address. However, that IP address, 172.31.1.72, is not accessible at all, I cannot ping it or see any open ports on it. This is because it is the local address of the AWS machine from what I can tell. What we want to see in the ICE candidate from the AWS machine is the public IP address 54.233.186.XX. The fact that this IP address is not showing up in the ICE candidates indicates to me that the STUN server is not reachable by the AWS machine for some reason.

I further confirmed this theory by visiting this url using the AWS machine: https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/ The output does not contain the public IP on the AWS instance. What we want to see here is an ICE Candidate with the AWS machine public IP 54.233.186.XX and type srflx.

If we saw that it would indicate that the candidate got its address resolved by the STUN server (basically all the STUN server does is tell you your public IP)."

lcdlv commented 3 years ago

Hi @lukehb and everyone! I happy to announce I fixed the problems thanks to Luke. I used this AMI: https://aws.amazon.com/marketplace/pp/Amazon-Web-Services-AWS-Deep-Learning-AMI-Ubuntu-1/B07Y43P7X5 and the problem was solved. Thanks @lukehb and the team.