Hi guys, I’ve been quite lost with this topic up until now.
And let me tell you, did it help to write this down!
Bear with me as I describe how painful this has been for me
1. First I started experimenting with this add-on: “RTSPtoWeb - WebRTC”.
And it worked great, I got low-latency streaming, except I didn’t realize at first that this wasn’t going to work outside of my LAN.
So I disabled “RTSPtoWeb - WebRTC” in the integrations page.
Note: I didn’t remove the integration. This will be important later on.
2. Then I installed the add-on “RTSPtoWebRTC” - visiting http://[my HA ip]:8083 returns “No Stream Found (add stream and reload page)” - add stream where exactly?
I’m confused with the tutorial… There seems to be some mix-up between these two add-ons.
The page about this one, shows a video about the first one: RTSPtoWebRTC - Home Assistant
Well, I added the integration “WebRTC Camera”, configured the UDP port range, and added the UDP port forwarding in my router.
Using the ‘custom:webrtc-camera’ does work outside of my LAN, however it’s very unstable. Stream isn’t fluid nor low-latency.
After all this, still no cameras listed here: http://[my HA ip]:8083
I didn’t know where to go from here.
3. Now I’m trying to work with the add-on “go2rtc”.
Visiting http://[my HA ip]:1984, no cameras show up so I really must be missing something, since go2rtc was supposed to “grab” any existing streams.
So I added the streams to the config/go2rtc.yaml file and now they show up under http://[my HA ip]:1984
And I added these streams as “Generic Camera” integrations, the source being something like rtsp://[my HA ip]:8554/[some_camera]
Adding them as picture cards, it all works, but once again this isn’t low-latency.
And then I realize, maybe I had previous configurations messing with my current setup.
So I removed all the “RTSPtoWeb/WebRTC”-related integrations, and re-added the “RTSPtoWebRTC” integration.
This time using the server address http://[my HA ip]:1984
I removed the streams from the config file go2rtc.yaml
Then I re-added the lovelace cards as regular picture cards with “live view”.
And now I do get a dynamic list under http://[my HA ip]:1984; this list changes when I watch the streams in my Dashboard.
However, they take a long time to show up at first. (several seconds; sometimes returning an error and not showing up, and I need to refresh)
And again I lost remote access to the streams.
Now, how do I enable remote access?
#go2rtc.yaml
api:
listen: "127.0.0.1:1984" # localhost
listen: "xxx.xxx.xxx.xxx:1984" # vm host
rtsp:
listen: "127.0.0.1:8554" # localhost
webrtc:
listen: ":8555" # external TCP port - forward this in your router
candidates:
- stun:8555 # if you have dynamic public IP-address
And still not working remotely, I mean, rarely one stream passes through.
So what’s happening?
This pops up a lot in the go2rtc Log:
WRN [webrtc] candidate error="address xxxx:xxx:xxxx:xxxx:xxx:xxxx:xxxx:xxxx:xxxx: too many colons in address"
So I disabled IPv6 under Settings → System → Network
And finally I have remote streaming.
But with remote access it’s choppy again. Just 1-2 frames per second.
Do you know how to improve this, or what’s wrong with the way I configured it?