Go2rtc project - help thread

This one from WebRTC

Go2rtc has public link to any camera by default. If you need HTTPS instead of HTTP, you need to use any reverse proxy.

THe only secure way to access the cameras through is through home assistantā€™s proxy service. If you want to use any of these cameras outside of the go2rtc GUI, then you need to look at port forwarding the entire GUI through a reverse proxy to the internet which is a huge exposure (but cane be locked down). Youā€™d need to lock it down with some authentication or other means and all cameras at that point are exposed behind it.

In my use case, iā€™ve wanted to use this same service so I can create secure temporary links in the same way I used in webrtc.

There isnā€™t a good way, currently, to simulate what that link service did to expose these cameras outside of the go2rtc UI.

It would be really helpful to have that service work again to create temporary links to cameras.

EDIT: Honestly though, the only reason I need this service at the moment is because I am using an iframe to do 2-way audio. Once the frigate card supports 2-way audio, I wouldnā€™t even have a use-case for needing that weblink service since itā€™ll all be contained in the home assistant dashboard directly. till then, iā€™ve had to expose just that camera to the internet through the reverse proxy like this:

if ($request_uri = "/go2rtc/webrtc.html?src=frontdoor_call") {
   rewrite /go2rtc/(.*) /$1 break;
}
if ($request_uri = "/go2rtc/api/ws?src=frontdoor_call") {
   rewrite /go2rtc/(.*) /$1 break;
}

Not the most secure but its only my front door. So waiting patiently for frigate.

So we are on the same page and yet I donā€™t see something different from security point.
Beside the 2 way doorbel you mentioned, my other 2 use cases are receive footage when door bell rings in alexa echo devices and pip on my android Tvs when something odd is triggered in my yard cameras.
Thats why i asked AlexIT if this is planned to be included in go2RTC :slight_smile:

both of these donā€™t require public links btw. the normal rtsp (or go2rtc UI links reverse proxied) links (http or https depending) work fine.

Mine uses this for android tv:

  - variables:

      linkurl: http://xxxxxxxxxx:1984/webrtc.html?src=frontdoor
                  - service: rest_command.pipup_video
                    data:
                      title: Front Door
                      duration: 40
                      message: ""
                      titleColor: white
                      position: 2
                      width: 355
                      height: 280
                      ip: 10.100.1.204
                      url: "{{ linkurl }}"

Do I need to do port forwarding on my router if I am using Ngrok?

Calisro your example made me re-check pipup git and it seems I was really outdatedā€¦ There is a new forked APK that support simple http! I use http inside and https outside. Thatā€™s why I wanted the public link for the doorbell camera.
So you are right. Minus one use case for ā€œcreate_linkā€!

No. Ngrok create tunnel from private networks.

I have Ngrok set up and noticed that it didnā€™t work all the time. For example, WebRTC wonā€™t work when I am on my mobile network but it works if I am connected to Windscribe VPN while still on mobile network. Does that mean I will need to forward port 8555 to make it work all the time?

No. You donā€™t need to forward any ports in case of using Ngrok.

So if it doesnā€™t work on some network then it will never work?

I started yesterday with Frigate and so far, so good.

This is my setup:
HA OS is running behind a reverse proxy https://.**.be
My nginx reverse proxy is running on a NAS on 192.168.1.190
The internal HA OS IP is 192.168.1.6
Frigate (+ internal go2rtc) is installed in an LXC with IP 192.168.1.21
I use Frigate in HA OS using the Frigate Proxy and the Frigate integration.

In my network I can access RTC streams perfectly fine, but external it uses MSE.
Iā€™ve read that it needs extra configuration, which Iā€™ve tried, but it doensā€™t seem to work.

I have a static public IP so Iā€™ve added this in my conf.yaml:

go2rtc:
  streams:
    voordeur:
      - rtsp://***:***@192.168.1.***:554/videoMain
    tuin:
      - rtsp://***:***@192.168.1.***:554/user=***_password=***_channel=1_stream=0.sdp?real_stream
    tuin_sub:
      - rtsp://***:***@192.168.1.***:554/user=***_password=***_channel=1_stream=1.sdp?real_stream
    living:
      - rtsp://***:***@192.168.1.***:554/videoMain
    pakjes:
      - rtsp://***:***@192.168.1.***:554/videoMain
  webrtc:
    candidates:
    - 192.168.1.190:8555
    - 78.22.212.185:8555
    - 192.168.1.21:8555

What is the correct candidate and where do I have to forward port 8555 to from my router? To my reverse proxy (.190), to my Frigate instance (.21) or to my HA OS (.6)?

Just use network host for main Frigate container. You need only pubic IP candidate and port forward to main Frigate server.

1 Like

Hello,

I want to use my Ring Doorbell with use of go2rtc in my Home Assitant Dashboard. In Addition to go2rtc i have installed the Add-On ā€œRing MQTT with Video Streamingā€ which provides me a RTSP Link for Live View. Basicly that Live Stream is working fine but not in Realtime without go2rtc. When Streaming with go2rtc it uses ā€œMSEā€ and latency is perfect. How would i be able to use that on by using a Picture Glance Card because i dont want to have a permanent Stream in my Dashboard with my Ring Doorbell as when Iā€™m using WebRTC Camera Integration / Card. I want to have a picture of my Ring which provides me a Screenshot every 10 seconds and only if i click on it I want to see Live-Video - exactly what Picture Glance does when choosing ā€œAutoā€ Option.
But at the moment when using Picture Glance it will use WebRTC which seems to have problems with the RTSP Ring Stream cause there is no picture.
Any ideas?

1 Like

Please tell me how to get me a permanent link to:
video+audio+microphone = two way audio from camera
image

2 Likes

Yeah, it would be nice if somebody, who has it working , could share how to get permanent link , because i still didnā€™t figured it out too.

https://mydomain.duckdns.org/a889bffc_go2rtc/webrtc.html?src=camera.tapo_camera_8431_hd&media=video+audio+microphone

It doesnā€™t work for me- i mean this link doesnā€™t connect to the stream

Iā€™ve been playing with the 0.12.0 release of frigate with tensorrt built-in (using Nvidia CUDA). It works great! Iā€™ve started to play around with the go2rtc options and Iā€™ve read on the go2rtc docs that the hardware acceleration stuff is built into a different docker image (alexxit/go2rtc:master-hardware). It seems when I try to enable the hardware accel on the input using #hardware or #hardware=cuda, after restarting frigate that camera is borked.

Iā€™m left wondering: is the master-hardware version of go2rtc was included in the tensorrt image of frigate?


My goal is to rotate one of my cameras 90Ā° using hardware transcoding. The current working config looks like this (without the rotation attempted):

Iā€™m using Reolink cameras so I have to use the ffmpeg to stream the RTMP to RTSP restream.

go2rtc:
  streams:
    storage_room:
      - ffmpeg:rtmp://192.168.0.119/bcs/channel0_main.bcs?channel=0&stream=0&user={FRIGATE_RTSP_USERNAME}&password={FRIGATE_RTSP_PASSWORD}
      - "ffmpeg:storage_room#audio=opus"

Iā€™ve tried adding the #video=h265#hardware=cuda#rotate=90 to the end of the top ffmpeg item and the bottom ffmpeg item. When I add it to the bottom one it seems to have no effect, the camera comes up but itā€™s not rotated. When I add it to the top line it results in no video from that camera and looking at the go2rtc logs I see:

2023-04-30 15:55:26.420734616  15:55:26.420 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:53 > error="exec: exit status 1" url=ffmpeg:rtmp://192.168.0.119/bcs/channel0_main.bcs?channel=0&stream=0&user=redacted&password=redacted#video=h265#hardware=cuda#rotate=90

ā€¦ like it thinks the URL is broken but my syntax looks like the recommendation from the go2rtc github docs.
Format: ffmpeg:{input}#{param1}#{param2}#{param3}

Even if I add just #video=h265#hardware=cuda without the rotate, onto the first line it never comes up.

What am I doing wrong?

Check GitHub issues. There was one about rotation via Nvidia. Itā€™s not possible because Nvidia rules.

Itā€™s possible with Intel GPU.

1 Like

Hope someone can help me out. I am using go2rtc within Frigate. I was able to set up my unifi cameras no problem to utilize go2rtc, and the stream has the mse, webrtc, and jsmpeg options. I just got an amcrest 410 doorbell, and no matter what I do, I am stuck with jsmpeg and no options (at least within the Frigate GUI) to utilize any of the other streams as they are not an option. My setup is as follows:

go2rtc:
  streams:
    Garage:
      - rtspx://192.168.10.2:7441/VbYexiA2CYQtuU3E
      - "ffmpeg:Garage#audio=opus"
    Garage_sub:
      - rtspx://192.168.10.2:7441/H1vZlsABSSsDfaQZ
    Front_door:
      - rtsp://user:[email protected]:554/cam/realmonitor?channel=1&subtype=0#backchannel=0
      - "ffmpeg:Front_door#audio=opus"
    Front_door_sub:
      - rtsp://user:pass192.168.40.88:554/cam/realmonitor?channel=1&subtype=1#backchannel=0
  webrtc:
    candidates:
      - 192.168.20.34:8555
      - stun:8555

In the go2rtc dashboard for the front door, I have this:


{
  "producers": [
    {
      "type": "RTSP source",
      "url": "rtsp://192.168.40.88:554/cam/realmonitor?channel=1\u0026subtype=0/",
      "remote_addr": "192.168.40.88:554",
      "user_agent": "go2rtc/1.2.0",
      "medias": [
        "video, sendonly, 96 H264/90000",
        "audio, sendonly, 0 PCMU/8000"
      ],
      "tracks": [
        "96 H264/90000, sinks=1",
        "0 PCMU/8000, sinks=0"
      ],
      "recv": 727052707
    },
    {
      "url": "ffmpeg:Front_door#audio=opus"
    }
  ],
  "consumers": [
    {
      "type": "RTSP client",
      "url": "rtsp://127.0.0.1:8554/Front_door",
      "remote_addr": "127.0.0.1:42168",
      "user_agent": "FFmpeg Frigate/0.12.0-da3e197",
      "medias": [
        "video, recvonly, 96 H264/90000",
        "audio, recvonly, 0 MPEG4-GENERIC/0"
      ],
      "tracks": [
        "96 H264/90000, sinks=1"
      ],
      "send": 721323280
    }

Iā€™v set up the doorbell to use 264 and g.711U, but still nothing.

]

1 Like

Help, Iā€™ve been trying to set up a WebTorrent permalink on Go2rtc for two days.
For reasons I donā€™t understand, the temporary link works, but the permanent one doesnā€™t.
Help set up.
Who has a working config skinte please.