Go2rtc project - help thread

Just tried out the iframe, I can get the video feed but unfortunately I can’t get 2-way communication working via my HA instance.
I’ve got 2-way communication working through the direct link to the camera: https://mydomain.org/go2rtc/webrtc.html?src=frontdoor

I’m guessing it’s an issue with my nginx/Swag setup not allowing it through my HA external URL: https://homeassistant.mydomain.org/

Does your camera use profile T for communication? What make/model is it? I didn’t do anything special for it to work. It travels along with the video so I doubt its getting blocked.

It’s an Amcrest AD410 doorbell, I think it’s profile T yeah!
2 way communication definitely works when I use the direct go2rtc link that I’ve exposed via swag/nginx: https://mydomain.org/go2rtc/webrtc.html?src=frontdoor

That’s my exact camera and it works great with 2-way. Hm Wonder what’s going on with yours. Maybe a browser permission issue? You try it in chrome? It works for me though in the companion app and chrome both via iframes.

Tried with Chrome, Firefox & Companion app - no luck! Doesn’t seem to be a permissions issue either. Just can’t figure out what the issue is!

Hi, I have an AIO which i plan to be used for lovelace, 4 cams frigate (direct on debian) and HA supervised…
The AIO is n4020 based and without HA its already hitting 80-90% with nativefier - made browser running 2 webrtc streams…
So,
I was wondering if this could help me reduce cpu usage detection by frigate… or browser running webrtc streams… if its possible care to elaborate?
Especially for the first one… cpu detection takes about 60-70%. I’m waiting for coral to be available at reasonable price but if this could help then i’d gladly try it.

go2RTC has been a great improvement overall in terms of video latency and CPU usage on the backend. However, I am seeing an issue with the video feeds are freezing on my lovelace dashboard after a certain period of time, usually a few hours. A refresh of the page resolves the issues. I don’t have to restart the go2rtc container. I’m using the cameras passed from the Frigate integration. I thought it might be that the computer seeing the issue was on WiFi, but it happened to another computer hardwired in.

  • Chrome Web Browser
  • Frigate Card

Is anyone else seeing this? What should my next steps be to provide information for troubleshooting the issue?

This is a pure coincidence, I noticed the same this morgning for a longer period of time and was planning to post this too.

I’m using go2rtc for a while now, just plain RTSP camera’s into the integration (manually added), 4 camera’s originate from the mqtt-ring plugin (but no live feed on my loveance dashboard), and they keep working but the one from my Foscam experiences exactly the same as @rogerquake is describing (this one has a live feed on my dashboard). The loveance card doesn’t work anymore. There is just no image. Refreshing page sometimes helps, but not always. Sometimes I need to restart the HA container, sometimes the Go2RTC container helps. There is no apparent error in the logs of the Go2RTC neither is there any entry in the logs of HA.

I’m using an iPad, iPhone and Windows 11 with Chrome as endpoints. They all have the same issue. My question would be the same; how do I go into troubleshooting mode. I already have added the logging part to Go2rtc, but nothing goes by. And besides that; my best bet would be it has more to do with the loveance card than Go2rtc.

Debug logging Go2rtc:

log:
  level: info  # default level
  api: debug
  rtsp: debug
  streams: debug
  webrtc: debug

Card i’m using:

camera_view: live
type: picture-glance
image: https://home-assistant.io/images/cast/splash.png
title: Camera
camera_image: camera.test_camera_go2rtc
You can add camera entity_id to go2rtc config if you need transcoding:

streams:
  "camera.hall": ffmpeg:{input}#video=copy#audio=opus

or

  "camera.kitchen_display": 
    - "{input}"
    - ffmpeg:{input}#audio=opus

This is beautiful (although I haven’t actually tested it yet). Thanks for that!

Edit: tested it. Works great.

It works for me as well! Fixed my Nest audio issue.

I was trying to get iframes to work, but I’m having some trouble exposing the api using nginx. The iframe works great if I use the local link, http://192.168.0.201:1984/webrtc.html?src=baby_cam_1, but that obviously doesn’t work remotely.

I tried exposing 192.168.0.201:1984 as a subdirectory of my domain using nginx and wasn’t able to get it working. I’m guessing there may be some special nginx settings that I have to put in, but I’m not sure exactly which. I tried setting the custom location without any special settings and got a 404 error. I then tried the following settings and also got a 404 error.

location /go2rtc/ {
   proxy_read_timeout 300;
   proxy_pass_header  X-Transmission-Session-Id;
   proxy_set_header   X-Forwarded-Host   $host;
   proxy_set_header   X-Forwarded-Server $host;
   proxy_set_header   X-Forwarded-For    $proxy_add_x_forwarded_for;       
   proxy_pass         http://192.168.0.201:1984;
   }

I also tried adding the settings to the Advanced tab, and again 404 error.

Hey @nprez83 , this is how I’ve got mine setup and it works. Although I can’t get 2-way audio via Home Assistant yet (However, 2 way audio works by going directly to the url: https://mydomain.org/go2rtc/webrtc.html?src=frontdoor )
I just need to figure out how to get 2 way audio working through Home Assistant!

go2rtc.subfolder.conf:

location /go2rtc/ {
  include /config/nginx/authelia-location.conf; 
  proxy_set_header Host $host;
  proxy_set_header X-Ingress-Path "/go2rtc";
  proxy_set_header X-Forwarded-Scheme $scheme;
  proxy_set_header X-Forwarded-Proto $scheme;
  proxy_set_header X-Forwarded-For $remote_addr;
  proxy_pass http://192.168.0.22:1984/;
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection "upgrade";
}
rewrite /go2rtc/(.*) /$1 break;

image

That’s all you need. This is temporary for me though. Be sure you understand this exposes your cameras to the internet.

I will be using the create link feature that’s in the current webrtc when it’s available to go2rtc.

I’m guessing that has to do with how you have your cameras added to home assistant. If you use an iframe it should be the same as just using this directly.


            - camera_view: auto
              type: picture-glance
              title: null
              entities:
                - entity: input_select.tts_door_text_selection
                - entity: input_text.tts_door_text
                - entity: lock.front_door
              camera_image: camera.front_door_main
              hold_action:
                action: fire-dom-event
                browser_mod:
                  service: browser_mod.popup
                  data:
                    title: frontdoor_main Live
                    size: wide
                    content:
                      type: iframe
                      url: /go2rtc/webrtc.html?src=frontdoor_main
                      aspect_ratio: 75%

Yeah I’ve added that (https://mydomain.org/go2rtc/webrtc.html?src=frontdoor ) as a direct iframe but I don’t get the prompt to give permission access for microphone. This is the same when I access Home Assistant over both local (http://192.168.0.22:8123) and remote (https://homeassistant.mydomain.org)

It won’t work over http. Browser limitations.

But we long as it’s a good cert, it should over https. Mine is a letsencrypt cert but i doubt that matters.

What device are you using for the companion app? I’m on Android.

Yeah I’m aware it needs to be https for microphone to work, my cert is also letsencrypt - I’m using the Swag docker container for my nginx reverse proxy solution.

I’ve attempted the iframe & 2-way audio on both Firefox & Edge on Mac and Android Companion app & Chrome on my phone. None of them work, I just see the video feed but no 2-way communication.

Try using a rewrite like mine instead of the way you are handling it. Only to rule out things. And your location doesn’t need a trailing slash.

https://forum.nginx.org/read.php?11,286648

This is the way the actual nginx config looks like as written by nginx proxy manager in its actual conf files…

  location /go2rtc {
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Scheme $scheme;
    proxy_set_header X-Forwarded-Proto  $scheme;
    proxy_set_header X-Forwarded-For    $remote_addr;
    proxy_set_header X-Real-IP		$remote_addr;
    proxy_pass       http://10.100.1.183:1984;

    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $http_connection;
    proxy_http_version 1.1;
    rewrite /go2rtc/(.*) /$1 break;
  }

This is perfect! Works like a charm. Between having my iframes working now, and the recent fix to the Nest audio in beta 6, I now have two options for my cameras:

  1. Skip the RTSPtoWeb integration, use built in conversion for Nest cam, and iframes for my Foscams
  2. Use RTSPtoWeb integration, which allows the Foscams to work right off the bat, and use transcoding for Nest Cam.

Gotta love options, thanks again @calisro

In order for this to work without the rewrite, I Believe you would have had to change your ‘basedir’ for the api in the go2rtc config. Revert it and try the rewrite I used instead.