Go2rtc project - help thread

You can’t do it to my knowledge through the HA proxy ‘a889bffc_go2rtc’ (you need tokens and such. See this link Using hass ingress for application login · Issue #249 · patzly/grocy-android · GitHub). I simply setup my nginx installation to reverse proxy for go2rtc as well and then allowed it through with a port forward. But be warned that then you have no password security and you’ll need to handle that.

I wish we had the ability to create temporary/permanent ondemand links just like we could do in the old webrtc but that currently doesnt exist.

Then my lovelace will look like this and go through the external link like this:

                  type: iframe
                  url: /go2rtc/webrtc.html?src=xxxxxxx
                  aspect_ratio: 75%

I do wish someone would figure out how to generate the auth in order to connect through the HA proxy ‘a889bffc_go2rtc’ though. Then I can rely on HA to secure it. But thats a mess. Using hass ingress for application login · Issue #249 · patzly/grocy-android · GitHub

2 Likes

Did you change the audio stream to

Ah frigate github helped and I realized I had a mismatch in the stream name and camera name. [Support]: Frigate not detecting WebRTC or MSE options on Amcrest 410 · Issue #6364 · blakeblackshear/frigate · GitHub

Hi, I am having some issues and would appreciate some help.
My setup:

  • Home Assistant install on Virtualbox on a windows PC.
  • DuckDNS
  • Reverse proxy using Caddy to direct traffic to Home assistant VM
  • Dahua IP cameras

I have go2rtc installed in home assistant as an add-on and I can get Video and audio when I click on the “stream” link in the go2rtc tab. I also have RSTPtoWeb installed and I am able to get video when I setup my cameras using “generic camera” integration but there is no Audio in my generic camera entity.

  1. How do I get the audio to work?
  2. And also, how can I get 2 way audio to work?
  3. My generic video setups work only on the local network and not when I try to access my home assistant remotely. How do I get the video streams to work when I’m outside my local network?

Cameras need to be added only through Go2rts.yaml, this is the most adequate way, and viewing the Lovelace card through the webrtc camera works without delay.
For two-way audio to work, you need https, but Go2rts does not support it, so it’s best to use the go2rts WebTorrent server permalink setting. It allows you to open the camera’s https link in any browser with two-way audio.
Lovelace cards with two-way audio have not yet been invented.
By the way, HA does not even support audio in standard camera integrations.

Where do I find info on this “WebTorrent server permalink setting”?

Is 2 way audio still working for everyone in the latest 1.5.0 release? I am usinga AD410. Been working for a LONG time and all of a sudden, it no longer works and doesn’t prompt for the microphone in chrome either.

I figured it out because of this issue:

There was a breaking change with webrtc.html

Hello everyone. I’m kinda noob in all that streaming stuff, but I want to play audio on my doorbell Dahua VTO2111D-P-S2. I already aware that there is some problem with audio codec in my doorbell, so I changed it to PCMA/8000 by script, and I even could use 2-way audio via HTTPS between my browser and doorbell, but I’m still don’t understand how to send audio file on it. According to guide from webrtc github page, I have to create virtual media_player using my doorbell from go2rtc addon, so I did it:

  - platform: webrtc
    name: Dahua Camera
    stream: dahua
    audio: pcma

I used pcma because Alex said that there is no PCMA/8000 for that case, and I also used that in my go2rtc config:

  dahua:
    - rtsp://admin:[email protected]:554/cam/realmonitor?channel=1&subtype=0
    - ffmpeg:rtsp://admin:[email protected]:554/cam/realmonitor?channel=1&subtype=0#audio=pcma

As far as I understand, ffmpeg should “convert” audio to right format or something like that.
But in the end, I have media_player.dahua_camera object with unknown state and when I trying to play file/tts it gives me this error:

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/webrtc/media_player.py:74
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 01:46:22 (2 occurrences)
Last logged: 01:55:57

[140510124775680]

Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py”, line 199, in handle_call_service await hass.services.async_call( File “/usr/src/homeassistant/homeassistant/core.py”, line 1849, in async_call task.result() File “/usr/src/homeassistant/homeassistant/core.py”, line 1889, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File “/usr/src/homeassistant/homeassistant/helpers/entity_component.py”, line 226, in handle_service await service.entity_service_call( File “/usr/src/homeassistant/homeassistant/helpers/service.py”, line 798, in entity_service_call future.result() # pop exception if have File “/usr/src/homeassistant/homeassistant/helpers/entity.py”, line 980, in async_request_call await coro File “/usr/src/homeassistant/homeassistant/helpers/service.py”, line 838, in _handle_entity_call await result File “/config/custom_components/webrtc/media_player.py”, line 74, in async_play_media assert r.ok AssertionError

Can someone help me with that please?

Can you define which “mode” to stream with picture-glance card?

I.e. If I want to continue using picture-glance card instead of custom:webrtc-camera and use RTC mode instead of MSE or MP4, how do I set it so that the stream is always in RTC mode?

Hello,
Could someone please post an example of using the go2rtc api to play a local mp3 file on a two way audio doorbell. I have managed to use an external mp3:
POST http://192.168.0.219:1984/api/streams?dst=test&src=ffmpeg:example.com/audio.mp3%23audio=pcma%23input=file#audio=pcma
Thanks is advanced

Do you mind sharing your go2rtc config for AD410 2-way? I can get audio in my browser from webrtc link but I can’t seem to send any. The microphone in my browser is never requested

Browser must have https://

1 Like

I have an automation that streams a Reolink doorcam to my Google Homes when a person is spotted by the camera.

test go2rtc.yaml:

streams:
  doorbell_rtsp: rtsp://admin:[email protected]:554/h264Preview_01_sub
- platform: webrtc
  name: Door Camera rtsp
  stream: doorbell_rtsp
  audio: aac/48000

This works with no audio (no AAC w/webrtc?) and if I only send to one media player. What’s the correct way?

service: webrtc.dash_cast
entity_id:
  - media_player.google_study
  - media_player.google_kitchen
  - media_player.google_family
  - media_player.google_bedroom
  - media_player.google_game_room
data:
  entity: camera.doorbell_reo
  extra:
    mode: webrtc,mse

hoo my god… one command fixed my all issues !
Thank you ! why this is not writen in the documentation ?!

It’s written in the documentation.

I guess i missed it :slight_smile:

But anyway, thank you - I love this project!
Much appriciate!

1 Like

I have a simple question, I want to share a camera over the wan but I also need to disable the built in gui on port 1984, however when doing so i cant stream my stream .
how do i password protect the ui but not the streams ?

does anyone have an html example of streaming directly from port 8555?

@AlexxIT - thanks for the great project, it really makes a huge difference in terms of latency.

Trying to setup 2way audio from HA…without luck so far.

What I have so far:

  1. HA instance, duckdns + nginx reverse proxy.
  2. go2rtc addon, x3 cameras in go2rtc.yaml. Cameras are Amcrest so x3 RTSP links.
  3. go2rtc gui - 2way audio is working fine via. link section.
  4. Added NGINX external access, I’m able to access:
    https://MYDNSADRESS/go2rtc/webrtc.html?src=CAM1&media=video+audio+microphone
    internally and externally.
    This works in chrome for 2 way audio.
  5. Cameras are integrated into lovelace dashboard using WebRTC integration - pulling from RTSP 8554 per go2rtc documentation. (Most of the time I see RTC connections but sometimes it’s MSE)
  6. Tried the iframe method created http file per @conorlap instructions but still can’t get 2way audio working in HA, tried both chrome and android companion app.

Hope someone can throw a bone, thanks guys.

@Saxin Using the Frigate-hass-card is your friend. It supports 2-way audio from go2rtc :slight_smile: