This may be an obvious suggestion, but make sure you’ve forwarded port 8555 in you router to the IP address of your home assistant instance (an RPi 4 in my case).
WebRTC Camera integration has fallback to MSE technology in case when WebRTC couldn’t connect remotely. You can check it by icon on top right corner of lovelace card.
WebRTC Camera custom card incompatible with go2rtc add-on.
Well I guess this was indeed my router’s fault.
I restarted everything, including the router, and now the streaming is fluid
However, I often get errors when trying to opening up the streams in Lovelace:
Failed to start WebRTC stream: Timeout handling WebRTC offer
and something else in the lines of
WebRTC streaming error: undefined
Upon restarting the add-on, it works again, so for now I made a button to quickly restart the add-on when needed:
show_name: true
show_icon: true
type: button
tap_action:
action: call-service
service: hassio.addon_restart
data:
addon: a889bffc_go2rtc
target: {}
entity: ''
name: Restart go2rtc
show_state: false
icon: mdi:restart
icon_height: 50px
I thought others might want to be aware of something I discovered today.
I thought my Amcrest AD410 button ring wasn’t working for hte past week and was about the warranty a claim. But I just figured out that I was sending video to my tv/nest hub devices when a ‘human’ was triggered from the cameras like I have always done. However, now that trigger opens up a ‘call’ to the doorbell every time and while there is a ‘call’ going on, the doorbell button itself won’t function.
So lesson here is be careful that with doorbells when sending videos to a display ahead of a doorbell press, it will actually disable the button.
I really need to figure out how to initiate video from the doorbell through this integration without activating a ‘call’ (stop turning on the microphone maybe?)
From the Amcrest app, I can view the live feed while not in a ‘call’ letting the doorbell still ring properly.
What’s worse too is pipup doesn’t seem to close the connection resulting in the go2rtc connection remaining open with the camera and afte the first button press, the doorbell never works again until I restart go2rtc.
Would a coral TPU help to resolve the transcoding issue?
As far as I know, Coral TPU is not involved in transcoding at all. Even when you using Frigate.
Could you explain your setup a bit more? I’m trying to set this up with my unifi protect integration and Nothing loads.
Good afternoon,
Installation of go2rtc: Home Assistant Add-on failed, error
‘AddonManager.install’ blocked from execution, system is not healthy
Installation of go2rtc: Docker, successful
Question 1: where was it necessary to register the data from the instructions?
'services:
go2rtc:
image: alexit/go2rtc
network_mode: host
restart: always
volumes:
“~/go2rtc.yaml:/config/go2rtc.yaml”’
In portainer alex it/go2rtc:latest there is , status Unused
Reboot…
In config/go2rtc.yaml
, I wrote
''api:
listen: “127.0.0.1:1984”
rtsp:
listen: “127.0.0.1:8554”
webrtc:
listen: “:8555” # external TCP port - forward this in your router
candidates:
stun:8555 # if you have dynamic public IP-address
streams:
1_camera: rtsp://admin:ХХХХ@192.168.0.8/Streaming/Channels/102 /’
Reboot…
It is not possible to reach the addresses 127.0.0.1:1984, 192.168.0.108:1984 (server address).
Question 2: How to reach the go2rtc web page, which I’m not doing right.
So far at this stage …
If you setup go2rtc on localhost on remote server, you can’t reach its web UI via browser.
Good afternoon, I have access to RP3 via Vnc server remotely, but I still can’t log into the go2rtc web. even when I enter the address 127.0.0.1:1984 or 129.168.0.108:1984
@nprez83 Is this still working for you in the current beta 8? It seems to have stopped working for me somewhere along the line…
14:28:28.838 DBG [webrtc] new consumer url=camera.kitchen_display
14:28:28.861 DBG [streams] probe producer url={input}
2022/10/06 10:28:28 http: panic serving 172.30.33.9:36814: runtime error: slice bounds out of range [:-1]
goroutine 70 [running]:
net/http.(*conn).serve.func1()
net/http/server.go:1825 +0xb8
panic({0x6ab5a0, 0x40004ba7c8})
runtime/panic.go:844 +0x260
github.com/AlexxIT/go2rtc/cmd/streams.GetProducer({0x4000137c78, 0x7})
github.com/AlexxIT/go2rtc/cmd/streams/handlers.go:30 +0xec
github.com/AlexxIT/go2rtc/cmd/streams.(*Producer).GetMedias(0x40001d76c0)
github.com/AlexxIT/go2rtc/cmd/streams/producer.go:46 +0x12c
github.com/AlexxIT/go2rtc/cmd/streams.(*Stream).AddConsumer(0x40001aeff0, {0x7edb10?, 0x400020c1c0})
github.com/AlexxIT/go2rtc/cmd/streams/stream.go:63 +0x2c8
github.com/AlexxIT/go2rtc/cmd/webrtc.offerHandler(0x40000e6380, 0x40003480c0)
github.com/AlexxIT/go2rtc/cmd/webrtc/webrtc.go:109 +0x408
github.com/AlexxIT/go2rtc/cmd/api.apiWS({0x7ee890, 0x400008c460}, 0x40002c0800)
github.com/AlexxIT/go2rtc/cmd/api/api.go:131 +0x198
net/http.HandlerFunc.ServeHTTP(0x72?, {0x7ee890?, 0x400008c460?}, 0x1cd20?)
net/http/server.go:2084 +0x3c
net/http.(*ServeMux).ServeHTTP(0x40002d40fc?, {0x7ee890, 0x400008c460}, 0x40002c0800)
net/http/server.go:2462 +0x144
net/http.serverHandler.ServeHTTP({0x400034c720?}, {0x7ee890, 0x400008c460}, 0x40002c0800)
net/http/server.go:2916 +0x408
net/http.(*conn).serve(0x400030a280, {0x7eef20, 0x40000900c0})
net/http/server.go:1966 +0x550
created by net/http.(*Server).Serve
net/http/server.go:3071 +0x448
It is, although interestingly when I went to check it right now, it initially wasn’t. I tried restarting the addon first and that did not fix it. I then reloaded the RTSPtoWebRTC integration and that did the trick. I’ve had to reload the integration a few times over the past few days after getting an error related to not being able to access the WebRTC server or something like that. I am on beta 8 btw.
Reloading didn’t help. I get consistent panics where this all used to work flawless.
Hmm, interesting. The only other difference I see is in the way we define our video streams. Here’s how I’m defining them. Try it and see if it helps.
streams:
"camera.foscam1": ffmpeg:{input}#video=copy#audio=opus
"camera.foscam2": ffmpeg:{input}#video=copy#audio=opus
"camera.foscam3": ffmpeg:{input}#video=copy#audio=opus
"camera.nest_cam": ffmpeg:{input}#video=copy#audio=opus
Yes I tried that as well.
Its something with localhost and docker I think. I am on HAOS and even this doesn’t work anymore which used to:
testing:
- ffmpeg:rtsp://127.0.0.1:8554/hass%3Abackyard#audio=opus
1:26:10.215 ERR [streams] probe producer error=timeout url=ffmpeg:rtsp://127.0.0.1:8554/hass%3Abackyard#audio=opus
I see. I run hassos in a RPI4, not sure what else you can try, sorry.
Good Afternoon All!
I’ve been attempting to setup a WebRTC / go2rtc system in hass to help with latency and consistency in a baby monitor I have running through hass. The generic camera integration works as it should, but is slow to load the video / audio and drops out regularly. I have had luck improving both latency and consistency with WebRTC and go2rtc, but am having issues with audio not being passed through.
The WebRTC add-on (RTSPtoWeb - WebRTC) doesn’t support audio at all. The other WebRTC add-on (RTSPtoWebRTC) does support audio but is labeled as not preferred and I have been unable to get any config to work properly.
I just finished getting the go2rtc add-on setup and it is functioning properly, just not as I would like in this situation. I have done:
Camera > RTSP > WebRTC > go2rtc
Go2rtc is set to combine the video from WebRTC and the audio from the RTSP stream and this plays correctly in the webview for the go2rtc add-on when viewed as webrtc. The issue is, if I pass this back into hass via the Generic Camera integration the audio is once again cut off by WebRTC. If I leave it only in go2rtc, then I have no way to view it from a lovelace dashboard, only the webview for go2rtc.
I would like to find a way to get this combined video and audio into hass in a way that it can be viewed from a dashboard. Any suggestions?
Hey @WhatTrees
One option is to use an iframe card to display the direct go2rtc webrtc url like this:
type: iframe
url: http://192.168.0.22:1984/webrtc.html?src=frontdoor
aspect_ratio: 76%
Alternatively you can try the WebRTC Card and check the notes on that github page about audio. You’ll need to find out what format your audio is and adjust the WebRTC card settings accordingly.
I’ve now been using the frigate card for much of this as well. Its extremely flexible.
I have the go2rtc add-on paired with the RTSPtoWebRTC integration, and use a picture-elements card to access live video, audio, as well as PTZ controls for my cameras. See my go2rtc.yaml entry for one stream and the code for my picture-elements card below.
streams:
"camera.baby_cam_1": ffmpeg:{input}#video=copy#audio=opus
type: picture-elements
camera_image: camera.baby_cam_1
camera_view: live
elements:
- type: image
entity: camera.baby_cam_1
camera_image: camera.baby_cam_1
camera_view: live
style:
top: 50%
left: 50%
width: 100%
opacity: 0%
- type: icon
icon: mdi:arrow-up
style:
color: rgba(255, 255, 255, 0.5)
background: rgba(255, 255, 255, 0)
right: 15px
bottom: 40px
tap_action:
action: call-service
service: foscam.ptz
service_data:
entity_id: camera.baby_cam_1
movement: up
- type: icon
icon: mdi:arrow-down
style:
color: rgba(255, 255, 255, 0.5)
background: rgba(255, 255, 255, 0)
right: 15px
bottom: '-10px'
tap_action:
action: call-service
service: foscam.ptz
service_data:
entity_id: camera.baby_cam_1
movement: down
- type: icon
icon: mdi:arrow-left
style:
color: rgba(255, 255, 255, 0.5)
background: rgba(255, 255, 255, 0)
right: 40px
bottom: 15px
tap_action:
action: call-service
service: foscam.ptz
service_data:
entity_id: camera.baby_cam_1
movement: left
- type: icon
icon: mdi:arrow-right
style:
color: rgba(255, 255, 255, 0.5)
background: rgba(255, 255, 255, 0)
right: '-10px'
bottom: 15px
tap_action:
action: call-service
service: foscam.ptz
service_data:
entity_id: camera.baby_cam_1
movement: right
I have also used it without the RTSPtoWebRTC integration by using an iframe as mentioned above. I still use the picture-elements card to get the PTZ controls, see my code below .
type: picture-elements
camera_image: camera.baby_cam_1
camera_view: live
elements:
- type: image
entity: camera.baby_cam_1
camera_image: camera.baby_cam_1
camera_view: live
style:
top: 50%
left: 50%
width: 100%
opacity: 0%
tap_action:
action: fire-dom-event
browser_mod:
service: browser_mod.popup
data:
title: Baby Cam 1
size: wide
content:
type: iframe
url: >-
https://YOURDOMAIN.freeddns.org/go2rtc/webrtc.html?src=camera.baby_cam_1
aspect_ratio: 75%
- type: icon
icon: mdi:arrow-up
style:
color: rgba(255, 255, 255, 0.5)
background: rgba(255, 255, 255, 0)
right: 15px
bottom: 40px
tap_action:
action: call-service
service: foscam.ptz
service_data:
entity_id: camera.baby_cam_1
movement: up
- type: icon
icon: mdi:arrow-down
style:
color: rgba(255, 255, 255, 0.5)
background: rgba(255, 255, 255, 0)
right: 15px
bottom: '-10px'
tap_action:
action: call-service
service: foscam.ptz
service_data:
entity_id: camera.baby_cam_1
movement: down
- type: icon
icon: mdi:arrow-left
style:
color: rgba(255, 255, 255, 0.5)
background: rgba(255, 255, 255, 0)
right: 40px
bottom: 15px
tap_action:
action: call-service
service: foscam.ptz
service_data:
entity_id: camera.baby_cam_1
movement: left
- type: icon
icon: mdi:arrow-right
style:
color: rgba(255, 255, 255, 0.5)
background: rgba(255, 255, 255, 0)
right: '-10px'
bottom: 15px
tap_action:
action: call-service
service: foscam.ptz
service_data:
entity_id: camera.baby_cam_1
movement: right