Go2rtc project - help thread

Unfortunately, part of the requirement for 2-way of that card is that it is a frigate backend camera. You can’t just use a regular go2rtc feed last I looked. Because of that, I am still using i-frame. :frowning:

@conorlap thanks for the reply, much appreciated.
I’ve tried but gave up given the complexity in setting up the this card.
Any chance you can share some basic config + 2way audio ?
Are you running frigate or just the card with go2rtc ?

@calisro thanks for your reply, much appriciated.
I’ve tried the i-frame method, but it won’t work from within HA dashboard.
Straight in chrome the link works fine, maybe I’m missing something, I’ve read this whole thread few times - not sure what to check next…

Hey @Saxin , no problem! I’m running Frigate yeah.

Here’s my Frigate-card config with working 2-way audio:

type: custom:frigate-card
cameras:
  - live_provider: go2rtc
    frigate:
      camera_name: frontdoor
    camera_entity: camera.frontdoor
    webrtc_card:
      url: rtsp://192.168.0.22:8554/frontdoor?video=all&audio=all
      ui: false
      muted: true
    go2rtc:
      stream: frontdoor
      modes:
        - webrtc
view:
  default: live
  camera_select: live
dimensions:
  aspect_ratio_mode: static
  aspect_ratio: '4:3'
live:
  controls:
    thumbnails:
      mode: none
      media: clips
    title:
      mode: none
    next_previous:
      style: none
    timeline:
      mode: none
    builtin: false
  show_image_during_load: true
  lazy_unload: hidden
  draggable: false
  zoomable: false
  auto_unmute: never
media_viewer:
  controls:
    title:
      mode: none
    thumbnails:
      mode: none
      show_timeline_control: false
    next_previous:
      style: chevrons
    builtin: true
  auto_unmute: never
  transition_effect: slide
  auto_mute: hidden
  draggable: false
  zoomable: false
  lazy_load: true
menu:
  buttons:
    frigate:
      enabled: false
    live:
      enabled: true
    clips:
      enabled: true
    snapshots:
      enabled: false
    download:
      enabled: true
    fullscreen:
      enabled: false
    timeline:
      enabled: false
    media_player:
      enabled: false
    image:
      enabled: false
    camera_ui:
      enabled: false
    cameras:
      enabled: false
    recordings:
      enabled: false
    substreams:
      enabled: false
    expand:
      enabled: true
    microphone:
      enabled: true
      priority: 42
      alignment: opposing
      type: toggle
    mute:
      enabled: true
      alignment: opposing
  style: overlay
  position: right
media_gallery:
  controls:
    thumbnails:
      show_details: false
      show_favorite_control: true
      show_timeline_control: false
    filter:
      mode: none
performance:
  profile: high

I really do wish the frigate card would support non-frigate cameras for 2-way but it is what it is. For now till I have something else, the i-frame works well for me within lovelace but there are a few things you need to do.

  1. your url to go2rtc needs to be ssl like this and passed directly from a reverse proxy. I don’t know how you have HA setup but here is my setup.

Lovelace:

            - type: custom:frigate-card-menu-icon
              icon: mdi:phone-forward
              title: Talk
              tap_action:
                action: fire-dom-event
                browser_mod:
                  service: browser_mod.popup
                  data:
                    title: Frontdoor Call
                    size: normal
                    content:
                      type: iframe
                      url: >-
                        /go2rtc/webrtc.html?src=frontdoor_call&media=video+audio+microphone&key=XXXXXXXXXXXXXXXXXXXXXXXXX
                      aspect_ratio: 75%

In order for that to work, i use go2rtc through a reverse proxy and I proxy that on the same port as home assistant itself but in a subdirectory of ‘/go2rtc’ (look at the link above)

I use nginx proxy manager and this the config to make that work:


All that does is pass ssl for that url directly to go2rtc port. I use that ‘key’ which is just a random long string of characters that match the lovelace entry. You don’t need to use it but there is no security with this method. So this works to obscure it.

  1. your camera needs to have a video/audio that go2rtc supports. I have a AD410 and changed it with a 3rd party tool since the app doesn’t let you change the codec. YMMV

I’m running Frigate too. I have added your card (tnx btw), but how do I push to talk? I have a reolink videodoorbell which should support this. Or is it when you click the card it should just open an audiostream?

I never see a talk button or something. I’m really confused. Everybody seems to be able to get this working :wink: .

go2rtc code:

go2rtc:
  streams:
    deurbel_sub:
      - http://192.168.2.5/flv?port=1935&app=bcs&stream=channel0_sub.bcs&user=admin&password=password
      - ffmpeg:deurbel_sub#audio=opus

camera code:

camera:
  deurbel:
    live:
      stream_name: deurbel_main
    ffmpeg:
      hwaccel_args: preset-vaapi
      inputs:
        - path: rtsp://127.0.0.1:8554/deurbel_main?video=copy&audio=aac
          input_args: preset-rtsp-restream
          roles:
            - record              
        - path: rtsp://127.0.0.1:8554/deurbel_sub?video=copy
          input_args: preset-rtsp-restream
          roles:
            - detect

I’m using NGINX proxy manager to make an SSL entry of it. Websockets are configured/ enabled. But still when going to https://frigate.domain.name with either Edge or Chrome on my Win11 laptop, I can’t get the stream goging. It keeps loading the stream.

Any idea of what i’m doing wrong?

edit -----

Just read some advise to switch to host network_mode on my frigate server. This seems to work a lot better, don’t understand why because all ports were opened. But, going to try more in comming few days.

You need to add the rtsp stream also for 2-way audio:

go2rtc:
  streams:
    deurbel_sub:
      - http://192.168.2.5/flv?port=1935&app=bcs&stream=channel0_sub.bcs&user=admin&password=password
      - ffmpeg:deurbel_sub#audio=opus
      - rtsp://admin:[email protected]:554/h264Preview_01_main
1 Like

going to try later this week, thanks

You using HTTP-FLV as main source. Is RTSP also awful for this model like other Reolink cameras?

Yeah, HTTP-FLV is much more stable than RTSP on the Reolink doorbell.

I now have the following:

deurbel_sub:
  - http://192.168.22.52/flv?port=1935&app=bcs&stream=channel0_sub.bcs&user=admin&password=password
  - ffmpeg:deurbel_sub#audio=opus
  - rtsp://admin:[email protected]:554/h264Preview_01_sub

The RTSP stream opens in VLC player so is correct.

With EDGE i can talk now. Only the record button doesn’t show up with the frigate card. I have copied the config above.

What I just don’t understand is it only works with https. When I browse to my ha instance it is https://ha.domainname.xxx which just works great. So both internally and externally it is a secure site. In the frigate card I type the IP address, how does Ha know it has to proxy that? Or does it just do that?

I don’t get a question in edge to allow microphone either, so it doesn’t seem to be requesting access. Should do that right?

with the microphone always connected the ring on the doorbell doesn’t light up blue like it does when going to the webpage from go2rtc.

Hey there,
quick question, Everything operates properly I am able to receive video and two-way audio, and I can answer and end calls via a web browser. (utilizing a frigate card with go2rtc)

But when I attempt the same via my iPhone, I can only listen but not speak.
In Settings → Home Assistant, there is no toggle option for the microphone, so I assume it is disabled.

any idea guys?

Thanks a lot much appreciated, I will try that.

1 Like

Hey @conorlap thanks a lot the info I will give Frigate a try.

Hey guys,
Got a new tablet to be used as HA dashboard, it’s Lenovo P11, TB-J606F. Tablet is nice good specs and nice screen but…

It won’t play any stream via. HA app I get black screen:


Stream info:

{
“producers”: [
{
“type”: “RTSP active producer”,
“url”: “rtsp://192.168.88.20:554/cam/realmonitor?channel=1\u0026subtype=0/”,
“remote_addr”: “192.168.88.20:554”,
“user_agent”: “go2rtc/1.6.2”,
“medias”: [
“video, recvonly, H.264 Main 5.0”,
“audio, recvonly, PCMA/8000”,
“audio, sendonly, PCMA/8000”
],
“receivers”: [
“96 H264, bytes=4543757, senders=2”,
“8 PCMA/8000, bytes=173120, senders=2”
],
“recv”: 4765237
}
],
“consumers”: [
{
“type”: “WebRTC/WebSocket async passive consumer”,
“remote_addr”: “udp4 prflx 192.168.88.104:42673 related :0”,
“user_agent”: “Mozilla/5.0 (Linux; Android 11; Lenovo TB-J606F Build/RKQ1.210303.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/115.0.5790.166 Safari/537.36 Home Assistant/2023.8.2-10992 (Android 11; Lenovo TB-J606F)”,
“medias”: [
“video, sendonly, VP8, RTX, VP9, AV1, H264, 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=4401876, receivers=1”,
“8 PCMA/8000, bytes=170880, receivers=1”
],
“send”: 4622968
},
{
“type”: “MSE/WebSocket passive consumer”,
“remote_addr”: “192.168.88.104, 127.0.0.1:45334”,
“user_agent”: “Mozilla/5.0 (Linux; Android 11; Lenovo TB-J606F Build/RKQ1.210303.002; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/115.0.5790.166 Safari/537.36 Home Assistant/2023.8.2-10992 (Android 11; Lenovo TB-J606F)”,
“medias”: [
“video, sendonly, H264, H265”,
“audio, sendonly, MPEG4-GENERIC, PCMA, PCMU, L16, PCML”
],
“senders”: [
“96 H264, bytes=4401876, receivers=1”,
“8 FLAC/8000, bytes=170560, receivers=1”
],
“send”: 4624898
}
]
}

It won’t play stream via. Chrome either go2rtc webui - stream:


Stream info:

{
“producers”: [
{
“type”: “RTSP active producer”,
“url”: “rtsp://192.168.88.20:554/cam/realmonitor?channel=1\u0026subtype=0/”,
“remote_addr”: “192.168.88.20:554”,
“user_agent”: “go2rtc/1.6.2”,
“medias”: [
“video, recvonly, H.264 Main 5.0”,
“audio, recvonly, PCMA/8000”,
“audio, sendonly, PCMA/8000”
],
“receivers”: [
“96 H264, bytes=37843531, senders=2”,
“8 PCMA/8000, bytes=1040000, senders=2”
],
“recv”: 39261075
}
],
“consumers”: [
{
“type”: “WebRTC/WebSocket async passive consumer”,
“remote_addr”: “udp4 host 192.168.88.104:60146”,
“user_agent”: “Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36”,
“medias”: [
“video, sendonly, VP8, RTX, VP9, AV1, H264, 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=37843531, receivers=1”,
“8 PCMA/8000, bytes=1040000, receivers=1”
],
“send”: 39309339
},
{
“type”: “MSE/WebSocket passive consumer”,
“remote_addr”: “192.168.88.104:43974”,
“user_agent”: “Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36”,
“medias”: [
“video, sendonly, H264, H265”,
“audio, sendonly, MPEG4-GENERIC, PCMA, PCMU, L16, PCML, OPUS”
],
“senders”: [
“96 H264, bytes=37843531, receivers=1”,
“8 FLAC/8000, bytes=1040000, receivers=1”
],
“send”: 40628829
}
]
}

I’m a bit lost here any guidance what can be done is much appreciated guys.

Try to check low res link. Main5 is hi profile. Some cheap or old devices may not handle it.

@AlexxIT - you are absolutely right, using substream or dropping main stream to 1080P makes it work and shows as H.264 Main 4.0.
I’m stocked as I have old samsung Galaxy S9 which displays the 5.0 profile fine.
What a shame Lenovo…and even more shame as it’s 100% software thing.

I guess transcoding video is not an option to have all devices have the high res and only tablet lower (1080P) ?

Hi, any idea if it is possible by go2rtc and how to extract only audio from stream, so I can cast it to Google Home Mini?
I already tried to proxy it through HAProxy, so it will be behind SSL, checked all possible options displayed in links, without luck.

ffmpeg:rtsp://127.0.0.1:8554/garage_main?audio

what url do you send to google home? http or https?