Go2rtc project - help thread

Thanks for the suggestion. Sorry, but I clearly am missing a piece of the puzzle.
I’m still randomly getting static images of cameras on the frigate cards and sometimes live video with very little latency. The WebRTC card is just a black card with a pause logo and the disconnected icon in top right.

I currently have WebRTCCamera and RTSPtoWebRTC integrations. The former has min and max UDP port set to 0 (default AFAIK). The latter has the url http://127.0.0.1:1984 and has google STUN set as

I’ve created a test page with a Frigate card, which still works occasionally and two WebRTC Camera cards with the following config

type: custom:webrtc-camera
entity: camera.driveway

and

type: custom:webrtc-camera
entity: camera.pool

Here are the logs from Go2RTC. It appears that it’s setting up the streams (mostly from the frigate cards I think as it has all cameras rather than just the 2 I have on the test page). It still lists a couple of IO timeouts as mentioned previously.

Starting go2rtc...
06:01:37.825 INF go2rtc version 0.1-rc.7 linux/amd64
06:01:37.826 INF [api] listen addr=:1984
06:01:37.826 INF [rtsp] listen addr=:8554
06:01:37.827 INF [hass] load stream url=hass:Home
06:01:37.827 INF [hass] load stream url="hass:Workshop Camera"
06:01:37.827 INF [hass] load stream url="hass:Front Door Camera"
06:01:37.827 INF [hass] load stream url="hass:Driveway Camera"
06:01:37.827 INF [hass] load stream url="hass:Pool Camera"
06:01:37.827 INF [hass] load stream url="hass:Side Yard Camera"
06:01:37.827 INF [hass] load stream url="hass:Garage Camera"
06:01:37.827 INF [hass] load stream url="hass:Alfresco Camera"
06:01:37.827 INF [hass] load stream url="hass:Side House Camera"
06:01:37.827 INF [hass] load stream url="hass:Rear Yard Camera"
06:01:37.827 INF [hass] load stream url="hass:Front Yard Camera"
06:01:37.827 INF [webrtc] listen addr=:8555
06:01:37.827 INF [srtp] listen addr=:8443
06:01:58.429 DBG [streams] probe producer url=rtsp://user:[email protected]:554/Streaming/channels/102
06:01:58.552 DBG [streams] start producer url=rtsp://user:[email protected]:554/Streaming/channels/102
06:02:21.192 DBG [streams] probe producer url=rtsp://user:[email protected]:554/Streaming/channels/102
06:02:21.204 DBG [streams] start producer url=rtsp://user:[email protected]:554/Streaming/channels/102
06:02:21.290 DBG [streams] probe producer url=rtsp://user:[email protected]:554/live.sdp
06:02:21.305 DBG [streams] probe producer url=rtsp://user:[email protected]:554/Streaming/channels/102
06:02:21.317 DBG [streams] start producer url=rtsp://user:[email protected]:554/live.sdp
06:02:21.323 DBG [streams] probe producer url=rtsp://user:[email protected]:554/Streaming/channels/102
06:02:21.348 DBG [streams] start producer url=rtsp://user:[email protected]:554/Streaming/channels/102
06:02:21.435 DBG [streams] probe producer url=rtsp://user:[email protected]:554/Streaming/channels/102
06:02:21.438 DBG [streams] start producer url=rtsp://user:[email protected]:554/Streaming/channels/102
06:02:21.450 DBG [streams] probe producer url=rtsp://user:[email protected]:554/Streaming/channels/102
06:02:21.451 DBG [streams] start producer url=rtsp://user:[email protected]:554/Streaming/channels/102
06:02:21.477 DBG [streams] start producer url=rtsp://user:[email protected]:554/Streaming/channels/102
06:02:42.284 DBG [streams] stop producer url=rtsp://user:[email protected]:554/live.sdp
06:02:43.434 DBG [streams] stop producer url=rtsp://user:[email protected]:554/Streaming/channels/102
06:02:43.441 DBG [streams] stop producer url=rtsp://user:[email protected]:554/Streaming/channels/102
06:02:43.442 DBG [streams] stop producer url=rtsp://user:[email protected]:554/Streaming/channels/102
06:02:43.457 DBG [streams] stop producer url=rtsp://user:[email protected]:554/Streaming/channels/102
06:02:44.421 WRN github.com/AlexxIT/go2rtc/cmd/streams/producer.go:110 > error="read tcp 192.168.55.253:56458->192.168.55.240:554: i/o timeout" url=rtsp://user:[email protected]:554/Streaming/channels/102
06:02:44.421 DBG [streams] reconnect to url=rtsp://user:[email protected]:554/Streaming/channels/102
06:02:44.423 WRN github.com/AlexxIT/go2rtc/cmd/streams/producer.go:110 > error="read tcp 192.168.55.253:59928->192.168.55.248:554: i/o timeout" url=rtsp://user:[email protected]:554/Streaming/channels/102
06:02:44.423 DBG [streams] reconnect to url=rtsp://user:[email protected]:554/Streaming/channels/102
06:02:49.422 DBG github.com/AlexxIT/go2rtc/cmd/streams/producer.go:129 > error="dial tcp 192.168.55.240:554: i/o timeout"
06:02:49.422 DBG [streams] stop producer url=rtsp://user:[email protected]:554/Streaming/channels/102
06:02:49.423 DBG github.com/AlexxIT/go2rtc/cmd/streams/producer.go:129 > error="dial tcp 192.168.55.248:554: i/o timeout"
06:02:49.424 DBG [streams] stop producer url=rtsp://user:[email protected]:554/Streaming/channels/102
06:03:00.714 DBG [streams] probe producer url=rtsp://user:[email protected]:554/Streaming/channels/102
06:03:00.718 DBG [streams] probe producer url=rtsp://user:[email protected]:554/Streaming/channels/102
06:03:00.729 DBG [streams] start producer url=rtsp://user:[email protected]:554/Streaming/channels/102
06:03:00.765 DBG [streams] probe producer url=rtsp://user:[email protected]:554/Streaming/channels/102
06:03:00.781 DBG [streams] start producer url=rtsp://user:[email protected]:554/Streaming/channels/102
06:03:00.782 DBG [streams] start producer url=rtsp://user:[email protected]:554/Streaming/channels/102

Thanks for the assistance and patience with my ignorance

You don’t neet RTSPtoWebRTC integrations and set any STUN when you using new WebRTC Camera v3. It support multiple technologies for get stream from go2rtc. If you will have problem with external access with WebRTC - it will use MSE. Also it support MJPEG and MP4 (not tested yet).

The problem is only if you use an iPhone. Because it does not support MSE. And you should setup external access with WebRTC correctly. It can be difficult if you don’t understand much about IT…

Thanks again. Yes, as I mentioned above I am using an iPhone and understand it has limitations but was also under the impression it should be falling back to HLS?

I’ll make the changes above and report back. Thanks again for the assistance and a great add on as it’s working amazing internally for me!

WebRTC Camera and go2rtc don’t support fallback to HLS.
I don’t know, what about RTSPtoWebRTC.

I would first remove the RTSP integration and then download the beta version of the WebRTC Camera from HACS. the public release version of WebRTC camera doesn’t yet support Go2RTC. Then from there I’d test, I haven’t been successful myself in getting either Frigate card or WebRTC card to reliable work when I am not on my LAN network.

As for the latest WebRTC card beta it doesn’t even work on LAN, so I recommend using one release older beta version if you experience issues on your LAN network too.

Seems like the latest version of the Go2RTC addon is giving me issues, its slow to load and sometimes doesn’t load at all. I have to restart the addon for the streams to load.

1 Like

Hey @AlexxIT , I am having troubles with the RC7 for the addon and Beta 4 for WebRTC Camera. After a few hours of not viewing any camera streams the streams never start. It just gets stuck on Loading2 and never starts, the only way to get the streams started is to restart the addon. After that the streams will work for a few hours then do the same thing again. Interestingly if I use Frigate card the streams start albeit a little slowly, so not sure if this is an integration or addon issues. I am not seeing any errors or anything in the logs either.

Amazing! It seems it’s now all finally working. Thanks @pabla and @AlexxIT

I basically started from scratch and removed WebRTCCamera, RTSPtoWebRTC and Go2RTC.
I then redownloaded WebRTC Camera v3 beta 5 and Go2RTC 0.1rc8 and restarted HA. I then recreated my camera cards using the WebRTCv3 cards and the camera entitties. Unfortunately I was getting an error “webrtc the type provided ('video/mp4; codecs=“undefined”) not supported” on WebRTC Camera v3 beta 5. After rolling back to beta 4 the error left and my cameras were all working using RTC on LAN via PC and iPhone and MP4 on iPhone when external.

The card via Mac/PC Edge browser allows me to turn the audio off, however the iPhone companion app doesn’t seem to allow this. Any chance of adding this function? With 10 cameras all playing audio it’s a bit much, but it’s amazing to finally have audio via HA

Thanks again for the assistance!!

1 Like

Happy to hear it worked out for you! I’m still struggling a bit myself but seeing your success has made me confident that I will be able to figure it out!

As for the audio what I noticed is when using MP4 stream on iPhone the native iOS video controls are hidden. You can permanently mute each stream by adding ‘muted: true’ in each camera card config but I’m not sure if you this is what you want.

yeah, ideally it would be good to default to mute but re-enable on demand, but that will suffice for now. Thanks again for the suggestion and good luck with your setup.

Edit: actually, the muted: true works great. It mutes by default but you can click to unmute. Thanks again

Now that i’ve got this working on my setup, i’m attempting to setup another environment I look after. All works fine via browser although it’s using MSE. Go2RTC is reporting an error which I believe is due to the password on the cameras:

parse "rtsp:admin:xxxx": invalid port ":xxx" after host

The password has a # followed by some numbers. xxx is the first part of the password prior to the hash

# in password can be a problem. Because it symbol for source additional settings. You can try to encode it to %23. I don’t know if it helps.

So my setup is currently struggling to start a live stream after the addon has been started for some time. Basically after I start the addon, streams start as expected. After maybe about 20-30 mins they stop starting. Taking a look at the go2rtc webpage and the streams have disappeared and here is what the logs look like. I have tried a chrome browser and the iPhone app both do not get a live stream. While this is happening, if I use Frigate card instead of WebRTC camera card, the stream starts but it looks like it falls back to HLS since the stream is very delayed and I don’t see anything in the logs for the go2RTC addon about a new consumer.

I am running go2rtc addon RC9 and WebRTC Beta 5.

Edit: Just as a test I added the streams to the go2rtc config just to see if that would help and after a few minutes they disappeared from the webUI. Seems like a possible memory leak issue

20:20:37.434 DBG [webrtc] new consumer url=rtsp://xxxxx:[email protected]:554/cam/realmonitor?channel=1&subtype=0
20:20:37.443 DBG [webrtc] new consumer url=rtsp://xxxxx:[email protected]:554/cam/realmonitor?channel=6&subtype=0
20:20:37.443 DBG [webrtc] new consumer url=rtsp://xxxxx:[email protected]:554/cam/realmonitor?channel=2&subtype=0
20:20:37.546 DBG [webrtc] new consumer url=rtsp://xxxxx:[email protected]:554/cam/realmonitor?channel=5&subtype=0
20:20:37.558 DBG [webrtc] new consumer url=rtsp://xxxxx:[email protected]:554/cam/realmonitor?channel=12&subtype=0
20:20:37.559 DBG [webrtc] new consumer url=rtsp://xxxxx:[email protected]:554/cam/realmonitor?channel=8&subtype=0
20:20:37.562 DBG [webrtc] new consumer url=rtsp://xxxxx:[email protected]:554/cam/realmonitor?channel=3&subtype=0
20:20:38.010 DBG [webrtc] new consumer url=rtsp://xxxxx:[email protected]:554/cam/realmonitor?channel=7&subtype=0
20:20:38.011 DBG [webrtc] new consumer url=rtsp://xxxxx:[email protected]:554/cam/realmonitor?channel=4&subtype=0
20:20:38.016 DBG [webrtc] new consumer url=rtsp://xxxxx:[email protected]:554/cam/realmonitor?channel=10&subtype=0
20:20:38.049 DBG [webrtc] new consumer url=rtsp://xxxxx:[email protected]:554/cam/realmonitor?channel=9&subtype=0
20:20:38.049 DBG [webrtc] new consumer url=rtsp://xxxxx:[email protected]:554/cam/realmonitor?channel=11&subtype=0
20:21:18.658 DBG [webrtc] new consumer url=rtsp://xxxxx:[email protected]:554/cam/realmonitor?channel=1&subtype=0
20:21:18.670 DBG [webrtc] new consumer url=rtsp://xxxxx:[email protected]:554/cam/realmonitor?channel=2&subtype=0
20:21:18.699 DBG [webrtc] new consumer url=rtsp://xxxxx:[email protected]:554/cam/realmonitor?channel=6&subtype=0
20:21:18.726 DBG [webrtc] new consumer url=rtsp://xxxxx:[email protected]:554/cam/realmonitor?channel=5&subtype=0
20:21:18.758 DBG [webrtc] new consumer url=rtsp://xxxxx:[email protected]:554/cam/realmonitor?channel=12&subtype=0
20:21:18.776 DBG [webrtc] new consumer url=rtsp://xxxxx:[email protected]:554/cam/realmonitor?channel=8&subtype=0
20:21:18.811 DBG [webrtc] new consumer url=rtsp://xxxxx:[email protected]:554/cam/realmonitor?channel=7&subtype=0
20:21:18.823 DBG [webrtc] new consumer url=rtsp://xxxxx:[email protected]:554/cam/realmonitor?channel=3&subtype=0
20:21:18.839 DBG [webrtc] new consumer url=rtsp://xxxxx:[email protected]:554/cam/realmonitor?channel=4&subtype=0
20:21:18.862 DBG [webrtc] new consumer url=rtsp://xxxxx:[email protected]:554/cam/realmonitor?channel=10&subtype=0
20:21:18.882 DBG [webrtc] new consumer url=rtsp://xxxxx:[email protected]:554/cam/realmonitor?channel=11&subtype=0
20:21:18.902 DBG [webrtc] new consumer url=rtsp://xxxxx:[email protected]:554/cam/realmonitor?channel=9&subtype=0

I have a strange problem. I use go2rtc in docker container with own turn server and rstp2webrtc integration in hasio. If i connect from local network everything works correctly, if i connect from lte network stream doesn’t work. Port 8555 is forwarded both udp and tcp.
If i install go2rtc as a hasio addon with same config, external streaming works perfectly.

LE: Found the problem. I had two dst-nat rules on router.

Hey guys , I have been banging my head with iframe and browsermod-popup for days now .
I have setup the NPM and Cloudflared to work and I can access my camera externally with 2 way audio .
I can access my camera using https://go2.mydomain/webrtc.html?src=doorbell_cam when I visit this webpage I can see the Mic icon on webpage and in my ios orange icon showing that mic is being used and also 2 way audio works with direct links.
But when I use in picture-elements card iframe only shows the stream 2 way audio is not working

There is the lovelace card I am using

type: picture-elements
camera_image: camera.doorbell_main
camera_view: live
elements:
  - type: image
    entity: camera.doorbell_main
    camera_image: camera.doorbell_main
    camera_view: live
    style:
      top: 50%
      left: 50%
      width: 100%
      opacity: 0%
    hold_action:
      action: fire-dom-event
      browser_mod:
        service: browser_mod.popup
        data:
          size: wide
          content:
            type: iframe
            url: https://go2.mydoamin/webrtc.html?src=doorbell_cam
            aspect_ratio: 50%

With hold cation iframe pops up with live video feed but not able to send audio
What I am doing wrong ?

Need help, I can’t start the go2rtc since yesterday. Before that was fine.

13:54:51.101 INF go2rtc version 1.0.1 linux/amd64
13:54:51.101 INF [api] listen addr=127.0.0.1:1986
13:54:51.101 INF [rtsp] listen addr=127.0.0.1:8552
13:54:51.103 INF [hass] load stream url=“hass:Camera - Living Room”
13:54:51.103 INF [hass] load stream url=“hass:Camera - Car Porch”
13:54:51.103 INF [hass] load stream url=“hass:Camera - Kitchen”
13:54:51.103 INF [hass] load stream url=hass:127_0_0_1
13:54:51.103 INF [webrtc] listen addr=127.0.0.1:8556
13:54:51.104 WRN github.com/AlexxIT/go2rtc/cmd/srtp/srtp.go:31 > error=“listen udp :8443: bind: address already in use”
13:54:51.104 INF [srtp] listen addr=:8443
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0xa0012c]
goroutine 20 [running]:
github.com/AlexxIT/go2rtc/pkg/srtp.(*Server).Serve(0xc000010018, {0x0?, 0x0})
github.com/AlexxIT/go2rtc/pkg/srtp/server.go:41 +0x6c
github.com/AlexxIT/go2rtc/cmd/srtp.Init.func1()
github.com/AlexxIT/go2rtc/cmd/srtp/srtp.go:39 +0x85
created by github.com/AlexxIT/go2rtc/cmd/srtp.Init
github.com/AlexxIT/go2rtc/cmd/srtp/srtp.go:37 +0x28f

Is this docker install

What is using port 8443?

Hi,

I have foscam FI9000EP camera.
My config: in docker go2rtc and 3.01 webrtc in home assistant configuration
This is my rtps address “rtsp://user:[email protected]:88/videoMain” which is working on go2rtc page 192.168.1.222:1984
Set it up on my HA dashboard with this:

type: custom:webrtc-camera
url: rtsp://user:[email protected]:88/videoMain
mode: webrtc
muted: true

I see the live video and the RTC logo on the right corner. But the live video always stutters.
If I click full screen the picture is the same stutters.
On go2rtc page when I click stream get same stutters but if click mp4 it is open full screen and perfect the live video without stutters.
Want to make a new generic cam with this setup but get this error and not working with mp4:

4:12:19.820 INF [streams] create new stream url=http://192.168.1.222:1984/api/stream.mp4?src=rtsp://user:[email protected]:88/videoMain
14:12:20.761 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:52 > error="unsupported Content-Type: video/mp4" url=http://192.168.1.222:1984/api/stream.mp4?src=rtsp://user:[email protected]:88/videoMain

How can I solve this in Home Assistant?
(another cameras reolinkE1 Zoom on MSE and foscamC1 on RTC working without problem)

nope, is HAOS. nothing using the port.

You probably already have go2rtc on your server. It could be:

  • WebRTC Camera integration
  • go2rtc addon
  • Frigate 12 addon

In last few days telegram notification that get pushed from go2rtc are not working anymore.
Don’t know if due to latest version of go2rtc or latest supervisor or Hass update…

Anyone else?

Thanks

Bye
Marco