GRVYDEV / Lightspeed-webrtc

A RTP -> WebRTC broadcast server for Project Lightspeed.
MIT License
75 stars 31 forks source link

ICE Failure #12

Closed woodrowbarlow closed 3 years ago

woodrowbarlow commented 3 years ago

Hello, what a fantastic project. Thank you!

I'm having trouble setting up the demo, and it looks like it's down to the WebRTC connection, possibly in ICE resolution.

Lightspeed-ingest is running on 8084. Lightspeed-webrtc is using 8080 and udp 65535, with --addr=192.168.1.xxx (my LAN IP address) Lightspeed-react is serving on 8082 and has set "ws://example.com:8080/websocket" in wsUrl.js (with my domain in place of example). Firewall has opened TCP 8080, 8082, and 8084. My environment is Windows 10. I'm running everything on the same local machine for now.

OBS is streaming, connected via domain name. Lightspeed-ingest shows:

Listening on port 8084 Hashes match! Client connected! Protocol Version: 0.9 Vendor Name: OBS Studio Vendor Version: 26.1.0 Video Codec: H264 Video Height: 720 Video Width: 1280 Audio Codec: OPUS

When the webpage loads, the websocket connects successfully. Lightspeed-webrtc shows:

Waiting for RTP Packets Connections: 1

The video does not load, and simply shows the poster. The JavaScript log shows:

Connected to websocket offer candidate candidate candidate candidate Candidate fail

Based on App.js, it looks like "Candidate fail" is an ICE failure. Is there some additional network configuration needed?

GRVYDEV commented 3 years ago

Hey! Try clicking the play button on the website since it seems that right now autoplay is broken. Other than that everything looks like it should be working! The console.log statements aren't correct as I do not think that that is a candidate failure but rather just an empty candidate and I will fix this soon.

woodrowbarlow commented 3 years ago

Hmm. I have clicked play, but I don't see any activity. The developer tools websocket inspector doesn't show any traffic either, aside from the candidates, offer, and answer.

Capture

I've confirmed via Wireshark that RTP frames are arriving from OBS on UDP 65535, I'm getting payload type 96 and 97 frames for the video and audio as expected. I'm just not seeing any WebRTC frames on the websocket.

I've never written or read Go, but tomorrow I'll try adding some additional debug prints in the Lightspeed-webrtc binary to see where things are getting dropped.

woodrowbarlow commented 3 years ago

Aha. I had configured OBS to stream to my domain, which resolves to my external IP address. I changed the URL in %AppData%\obs-studio\plugin_config\rtmp-services\services.json to use my 192.168.1.xxx LAN IP address and it worked. Brilliant!

GRVYDEV commented 3 years ago

Ah! I’m glad you got this figured out :) enjoy!