Go2rtc project - help thread

I believe it has to be a https connection. I believe it also has to be publicly lookupable as the google homes use google’s domain name servers and not your local dns.

really dumb simple question but I am using go2rtc bundled into frigate and that works great but I am wondering how I could access the go2rtc streams/restreams from another computer on the same local network with say vlc? To be clear I can access frigate from another machine and stream webtrc in that interface and use the go2rtc dashboard to stream in the browser but cannot for example use rtsp://192.168.0.25:8554/garage where the 192.168.0.25 is the ip of the system running frigate in docker to stream to VLC.

Hi I have started using go2rtc inside frigate. I can no longer play mp3 files through the api or ui. I was wondering if I could change the port of the go2rtc add on so I could run two instances:

  1. One inside frigate for recording and 2-way audio
  2. Outside frigate to send api requests with mp3 files to play
    Thanks :pray:

I was always thinking that go2rtc has full network access. (Not restricted to specific ports)

What address do you see on go2rtc dashboard?

I have the same problem. How did you solve it?

1 Like

Hi !

Can anyone help me set up the frigate card to work with go2rtc?

The stream from the camera is available in go2rtc
But I can’t configure the frigate card.

I don’t know if I need a camera entity in this case. I enter a camera entity in vain, because what the camera created in the HA does not provide an image.

type: custom:frigate-card
cameras:
  - live_provider: go2rtc
    go2rtc:
      modes:
        - webrtc
      stream: bejarat

I’m struggling with very slow loading of my stream within a WEBRTC card, and wondered if anyone could help me figure out what is causing the delay. As far as I can tell I’ve set things up correctly, however I’m totally new to all things IP Camera related, including all the different streaming protocols involved. I’ve read through the Go2rtc info but it was pretty overwhelming -although it’s gradually making more sense.

My camera is the Reolink Doorbell PoE Camera. I’ve read about Reolink’s poor RTSP implementation, so this is my first thought as to the issues. I’ve setup my Go2rtc config like this:

streams:
  FrontDoorBell:     rtsp://admin:[email protected]:554/h264Preview_01_main
  FrontDoorBell_sub: rtsp://admin:[email protected]:554/h264Preview_01_sub

I’ve setup the Reolink Integration in HA, and although both streams work, there is massive amount of lag when opening the streams in HA - around 10-15 seconds while the stream catches up with itself.

This was for this reason I found Go2rtc and read about using the WEBRTC card in HA in order to get much faster loading of the streams, using RTC. I’ve installed the WEBRTC Camera integration, and am using the WEBRTC Card in my dashboard. The problem is that even when specifying RTC mode, and I can see the picture is RTC in the top right corner, it takes anywhere between around 4 to 10 seconds to actually load even the sub stream. I just get the ‘Loading…’ message in the top right of my card until the picture finally loads. The loading speed varies considerably, but I can’t understand why, as I expected using RTC for it to be much faster, as HA is no longer in the equation, like it is with the Reolink integration, or creating a generic camera entity.

The picture loads slightly faster within the Go2rtc links section, when picking an RTC link, but still takes around 4-5 seconds to show. The link being used within the Go2rtc links section for an RTC stream is:

http://homeassistant.local:8123/a889bffc_go2rtc/ingress

Does this behaviour sounds like the ‘expected’ behaviour with Reolink and RTSP? If so, is there anything that I can do to improve things i.e specify something other than RTSP in the Go2rtc config?
I’m not looking to use 2 way audio, if that makes any difference.

The HTTP-FLV feed is much more reliable on the Reolink cams, try the below config in go2rtc. Note I’ve kept the rtsp stream also as I use this for 2-way audio.

You may have to login to the doorbell cam’s UI by visiting https://192.168.1.105 and going to Settings > Network > Advanced > Server Settings > turn on HTTP

go2rtc:
  streams:
    FrontDoorBell:
    - "ffmpeg:http://192.168.1.105/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=yourpassword#video=copy#audio=copy#audio=opus#raw=-avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -flags low_delay -strict experimental -analyzeduration 1000M -probesize 1000M -rw_timeout 5000000"
    - rtsp://admin:[email protected]:554/h264Preview_01_main
    FrontDoorBell_sub:
    - "ffmpeg:http://192.168.1.105/flv?port=1935&app=bcs&stream=channel0_ext.bcs&user=admin&password=yourpassword#video=copy#audio=copy#audio=opus#raw=-avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -flags low_delay -strict experimental -analyzeduration 1000M -probesize 1000M -rw_timeout 5000000"
 
3 Likes

Does anyone know why this doesn’t work well or how to make it work? Its an amcrest AD410 where I am trying to timestamp the snapshot and turn it into a mjpeg.

This works, but causes lots of EOF errors in the go2rtc logs and a massive amount of defunct FFMPEG processes in the go2rtc docker which eventually causes many issues.


streams:
  frontdoor_snapshot: 
    - ffmpeg:http://admin:[email protected]/cgi-bin/snapshot.cgi?channel=1#input=file#drawtext=timestamp#video=mjpeg

ffmpeg:
  timestamp: "fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf:text='%{localtime}':fontsize=62:[email protected]:x=(w-text_w)-7:y=7"

Essentially,i’ll get something like this in the logs:

15:48:18.571 WRN github.com/AlexxIT/go2rtc/internal/streams/producer.go:171 > error=EOF url="ffmpeg:http://admin:@10.100.1.143/cgi-bin/snapshot.cgi?channel=1#input=file#drawtext=timestamp#video=mjpeg#raw=-huffman 0"
15:48:18.571 DBG [streams] retry=0 to url=ffmpeg:http://admin:@10.100.1.143/cgi-bin/snapshot.cgi?channel=1#input=file#drawtext=timestamp#video=mjpeg#raw=-huffman 0
15:48:19.626 WRN github.com/AlexxIT/go2rtc/internal/streams/producer.go:171 > error=EOF url="ffmpeg:http://admin:@10.100.1.143/cgi-bin/snapshot.cgi?channel=1#input=file#drawtext=timestamp#video=mjpeg#raw=-huffman 0"
15:48:19.626 DBG [streams] retry=0 to url=ffmpeg:http://admin:@10.100.1.143/cgi-bin/snapshot.cgi?channel=1#input=file#drawtext=timestamp#video=mjpeg#raw=-huffman 0
15:48:20.585 WRN github.com/AlexxIT/go2rtc/internal/streams/producer.go:171 > error=EOF url="ffmpeg:http://admin:@10.100.1.143/cgi-bin/snapshot.cgi?channel=1#input=file#drawtext=timestamp#video=mjpeg#raw=-huffman 0"
15:48:20.585 DBG [streams] retry=0 to url=ffmpeg:http://admin:@10.100.1.143/cgi-bin/snapshot.cgi?channel=1#input=file#drawtext=timestamp#video=mjpeg#raw=-huffman 0
15:48:21.618 WRN github.com/AlexxIT/go2rtc/internal/streams/producer.go:171 > error=EOF url="ffmpeg:http://admin:@10.100.1.143/cgi-bin/snapshot.cgi?channel=1#input=file#drawtext=timestamp#video=mjpeg#raw=-huffman 0"
15:48:21.618 DBG [streams] retry=0 to url=ffmpeg:http://admin:@10.100.1.143/cgi-bin/snapshot.cgi?channel=1#input=file#drawtext=timestamp#video=mjpeg#raw=-huffman 0
15:48:22.562 WRN github.com/AlexxIT/go2rtc/internal/streams/producer.go:171 > error=EOF url="ffmpeg:http://admin:@10.100.1.143/cgi-bin/snapshot.cgi?channel=1#input=file#drawtext=timestamp#video=mjpeg#raw=-huffman 0"
15:48:22.562 DBG [streams] retry=0 to url=ffmpeg:http://admin:@10.100.1.143/cgi-bin/snapshot.cgi?channel=1#input=file#drawtext=timestamp#video=mjpeg#raw=-huffman 0
15:48:23.610 WRN github.com/AlexxIT/go2rtc/internal/streams/producer.go:171 > error=EOF url="ffmpeg:http://admin:@10.100.1.143/cgi-bin/snapshot.cgi?channel=1#input=file#drawtext=timestamp#video=mjpeg#raw=-huffman 0"
15:48:23.610 DBG [streams] retry=0 to url=ffmpeg:http://admin:@10.100.1.143/cgi-bin/snapshot.cgi?channel=1#input=file#drawtext=timestamp#video=mjpeg#raw=-huffman 0

and we can see lots of defunct processes. I am not sure how to do this correctly.

PID   USER     TIME  COMMAND
    1 root      0:00 /sbin/tini -- go2rtc -config /config/go2rtc.yaml
    7 root      0:00 go2rtc -config /config/go2rtc.yaml
   30 root      0:00 [ffmpeg]
   37 root      0:00 [ffmpeg]
   44 root      0:00 [ffmpeg]
   51 root      0:00 [ffmpeg]
   58 root      0:00 [ffmpeg]
   65 root      0:00 [ffmpeg]
   72 root      0:00 [ffmpeg]
   79 root      0:00 [ffmpeg]
   86 root      0:00 [ffmpeg]
   93 root      0:00 [ffmpeg]
  100 root      0:00 [ffmpeg]
  107 root      0:00 [ffmpeg]
  114 root      0:00 [ffmpeg]
  121 root      0:00 [ffmpeg]
  128 root      0:00 [ffmpeg]
  135 root      0:00 [ffmpeg]
  142 root      0:00 [ffmpeg]
  149 root      0:00 [ffmpeg]
  156 root      0:00 [ffmpeg]
  163 root      0:00 [ffmpeg]
  170 root      0:00 [ffmpeg]
  177 root      0:00 [ffmpeg]
  184 root      0:00 [ffmpeg]
  191 root      0:00 [ffmpeg]
  198 root      0:00 [ffmpeg]
  205 root      0:00 [ffmpeg]
  212 root      0:00 [ffmpeg]
  219 root      0:00 [ffmpeg]
  226 root      0:00 [ffmpeg]
  233 root      0:00 [ffmpeg]
  240 root      0:00 [ffmpeg]
  241 root      0:00 watch ps
  254 root      0:00 [ffmpeg]
  261 root      0:00 [ffmpeg]
  269 root      0:00 [ffmpeg]

Thanks for the advice. I’ve changed my config to match. Strangely, the stream loading is no different, even after clearing browser cache, restarting HA as well as restarting my host that HA runs on. It’s just a random amount of time of several seconds while the stream displays loading, before the picture appears - even when viewing from the Go2rtc links page.

An example of the info while using the - webrtc.html local WebRTC viewer link from the links page of Go2rtc (http://homeassistant.local:8123/api/hassio_ingress/SDZNeAeOBZ_wf-K1qskQIu6kglP2-ozJOt_PNw5zjcU/webrtc.html?src=FrontDoorBell_sub&media=video+audio)

{
  "producers": [
    {
      "type": "RTSP passive producer",
      "url": "rtsp://127.0.0.1:8554/d98e9e60777b25e20dbac3633550bf22",
      "remote_addr": "127.0.0.1:56344",
      "user_agent": "ffmpeg/go2rtc",
      "sdp": "v=0\r\no=- 0 0 IN IP4 127.0.0.1\r\ns=No Name\r\nc=IN IP4 127.0.0.1\r\nt=0 0\r\na=tool:libavformat 60.3.100\r\nm=video 0 RTP/AVP 96\r\na=rtpmap:96 H264/90000\r\na=fmtp:96 packetization-mode=1; sprop-parameter-sets=Z2QAM6wVFKDgFWQ=,aO48sA==; profile-level-id=640033\r\na=control:streamid=0\r\nm=audio 0 RTP/AVP 97\r\na=rtpmap:97 MPEG4-GENERIC/16000/1\r\na=fmtp:97 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3; config=1408\r\na=control:streamid=1\r\nm=audio 0 RTP/AVP 98\r\nb=AS:64\r\na=rtpmap:98 opus/48000/2\r\na=control:streamid=2\r\n",
      "medias": [
        "video, recvonly, H.264 High 5.1",
        "audio, recvonly, MPEG4-GENERIC/16000",
        "audio, recvonly, OPUS/48000/2"
      ],
      "receivers": [
        "96 H264, bytes=6238758, senders=1",
        "97 MPEG4-GENERIC/16000, bytes=330630, senders=0",
        "98 OPUS/48000/2, bytes=345799, senders=1"
      ],
      "recv": 7000063
    }
  ],
  "consumers": [
    {
      "type": "WebRTC/WebSocket async passive consumer",
      "remote_addr": "udp4 prflx 192.168.1.119:54687 related :0",
      "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36",
      "medias": [
        "video, sendonly, VP8, RTX, VP9, H264, AV1, RED, ULPFEC, FLEXFEC-03",
        "audio, sendonly, OPUS/48000/2, RED/48000/2, G722/8000, PCMU/8000, PCMA/8000, CN/8000, TELEPHONE-EVENT/48000, TELEPHONE-EVENT/8000, L16, PCML"
      ],
      "senders": [
        "102 H264, bytes=6238758, receivers=1",
        "111 OPUS/48000/2, bytes=345799, receivers=1"
      ],
      "send": 6680235
    }
  ]
}

and nothing other than the standard info in the regular Go2rtc log viewer:

10:33:04.263 INF go2rtc version 1.7.1 linux/amd64
10:33:04.270 INF [api] listen addr=0.0.0.0:1984
10:33:04.273 INF [rtsp] listen addr=0.0.0.0:8554
10:33:04.274 INF [webrtc] listen addr=0.0.0.0:8555/tcp

I may try uninstalling and reinstalling Go2rtc and use the config above and see if there is any difference adn report back. I’ve not found any similar loading issues while searching online yet but i’ll keep looking.

Uninstalling and reinstalling Go2rtc didn’t make any difference, neither did rebooting HA, my host machine, doorbell, or router. I keep seeing how quickly rtc streams load for others in clips here and there, so I’m wondering if I’m missing something obvious. My hardware should be OK, running HA OS as a VM in Proxmox on my Dell micro pc i5-8500T 16GB RAM (4GB for HA) .

Other than the ‘streams’ section of the Go2rtc.yaml, what else is the bare minimum required? I can see all the different modules that can be added, in the documentation on github, but are they ALL optional depending on requirements?

Doorbell hardware seems fine as it loads the clear main stream in Reolink app fine in under 2 seconds. There’s such a wide range of loading times with Go2rtc from the main links page. I have had the sub stream load in around 3 seconds on a couple of occasions, but then next time I try it can be 10 seconds before it loads. Is it worth grabbing some logging from Go2rtc? Not sure what I would be looking for exactly but happy to post logs here, or raise an issue on github with the logs asking for help?

I’m just now trying to get into this and I’m having some trouble not sure if I’m missing something.

So I have a few Wyze Cams v3’s using the MiniHack that has Go2RTC built in now and I can view the streams from my browser. So now I am looking to add these to Home Assistant and I believe I have something set up wrong or blocking due to my set up.

I am running NGINX to reverse proxy my Home Assistant. I believe this might be the cause of the issue or maybe it’s not.

I have added to the config this

streams:

  camera.test:
    - rtsp://192.168.1.168:8554/1080p

I can view through VLC without any issues.

I just get a endless loading and it never finds the stream. I one time got an error that says

1 Like

Guys, please tell me how to make a button to turn the microphone on/off in the latest update of the go2rtc web interface card, which supports two-way communication? Please tell me. In the homeassistant android application, if you set the mode to unpause and turn on the stream with the microphone, and then exit the tab, then the microphone will continue to work until you disable it in the resolution. Thank you.

foto
Hi there
I want to ask, is it possible to hide the sound / audio icon?

my config:

type: custom:webrtc-camera
url: rtsp://xxxxxxxxxx
style: '.screenshot {display: none} .mode {display: none} video {object-fit: fill;}'
ui: true
background: true
card_mod:
  style:
    .: |
      ha-card {
        --ha-card-border-radius: 0px;
      } 

I’m having problems as well but HASS was able to find the camera but it won’t authenticate. Adding the camera with Apple Home works.

Logger: homeassistant.components.homekit_controller.config_flow
Source: components/homekit_controller/config_flow.py:492
Integration: HomeKit Device ([documentation](https://www.home-assistant.io/integrations/homekit_controller), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+homekit_controller%22))
First occurred: 10:26:40 PM (11 occurrences)
Last logged: 11:12:46 PM

Pairing attempt failed with an unhandled exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/homekit_controller/config_flow.py", line 492, in async_step_pair
    self.finish_pairing = await discovery.async_start_pairing(self.hkid)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohomekit/controller/ip/discovery.py", line 67, in async_start_pairing
    request, expected = state_machine.send(response)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohomekit/protocol/__init__.py", line 135, in perform_pair_setup_part1
    raise InvalidError("M2: Accessory did not send public key")
aiohomekit.exceptions.InvalidError: M2: Accessory did not send public key

Is there any way to remove the overlay that shows the technology name, e.g RTC, MSE, etc?

I haven’t found anything in the docs, though I might just be blind

Hi,
I am trying to make an api call to play mp3 file on my reolink doorbell but it returns can't find consumerwhen I input http://192.168.0.219:1984/api/streams?dst=reolink&src=ffmpeg:http://192.168.0.219:8123/local/doorbell/d-parcel.mp3#audio=pcma#input=file

here is some info about the doorbell:

{"producers":[{"type":"RTSP active producer",
"url":"rtsp://192.168.0.33/Preview_01_sub/","remote_addr":"192.168.0.33:554",
"user_agent":"go2rtc/1.5.0",
"medias":["video, recvonly, H.264 High 5.1","audio, recvonly, MPEG4-GENERIC/16000","audio, sendonly, PCMA/8000"],
"receivers":["97 MPEG4-GENERIC/16000, bytes=311697024, senders=1","96 H264, bytes=1316595015, senders=1"],
"senders":["8 PCMA/8000, bytes=1274080, receivers=0"],
"recv":1649230271,"send":1293760},{"url":"ffmpeg:reolink#audio=pcma"}],
"consumers":[{"type":"RTSP passive consumer","url":"rtsp://ccab4aaf-frigate-fa:8554/reolink",
"remote_addr":"XXX.XX.XX.XX",
"user_agent":"Lavf58.76.100",
"medias":["video, sendonly, H264, H265","audio, sendonly, MPEG4-GENERIC"],
"senders":["96 H264, bytes=1316595015, receivers=1","97 MPEG4-GENERIC/16000, bytes=311697024, receivers=1"],
"send":1654974583}]}

Any help would be much apprecited

it seems to doesnt work behind a Reolink NVR…cant make it work.

it work great on PC on LAN but on my Android…it take 60 secondes to load the video, same in wifi and 4G+. I will have understand in 4G+ but in WIFI i dont understand why its so long to load the video…

Is someone have this problem?

My config is 8 cameras behind a reolink NVR 410, i have some D500, RLC-520, RLC-520-A, POE Doorbell, and 1 RLC-81PA.

my Go2RTC config is like this :

streams:

  cam_bureau_nvr_main: 
    - rtsp://xxxxxxxxxxx:[email protected]:554/h264Preview_01_main
    - ffmpeg:rtsp://xxxxxxxxx:[email protected]:554/h264Preview_01_main#audio=opus

Is it a “buffering” delay problem in HA?

i read a post from @AlexxIT who suggest to add a port config in Go2RTC, someone know which port and syntax please?

EDIT: ok found it :

webrtc:
  listen: ":8555"

but any difference on Mobile. Take exactly 46 secondes to start the video feed. After, its stable and fluent

If someone have an idea, thanks for some help :wink:

Guys im lost …

i was able to add the cameras to go2rtc and i can see the streams and hear them !.

But when i try to add them to the camera entity :confused:
For example, i took from the list the “Back_Kitchen_frigate_homekit”
I get this error:

Not sure why: Log

Using Zero trust and homekit
Please help :wink: any idea?