AlexxIT / go2rtc

Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc.
https://github.com/AlexxIT/Blog
MIT License
3.79k stars 307 forks source link

Reolink Video Doorbell discussion #331

Open luisiam opened 1 year ago

luisiam commented 1 year ago

The latest FW 1859 enables 2-way audio via ONVIF profile T. I checked with Happytimesoft ONVIF client and 2-way audio works. Is there any chance to get it working in go2rtc?

Output from info page

{
  "producers": [
    {
      "type": "RTSP active producer",
      "url": "rtsp://192.168.10.21//",
      "remote_addr": "192.168.10.21:554",
      "user_agent": "go2rtc/1.3.1",
      "medias": [
        "video, recvonly, H.264 High 5.1",
        "audio, recvonly, MPEG4-GENERIC/16000"
      ],
      "receivers": [
        "96 H264, bytes=129455539, senders=1",
        "97 MPEG4-GENERIC/16000, bytes=1984536, senders=1"
      ],
      "recv": 132603331
    },
    {
      "type": "RTSP passive producer",
      "url": "rtsp://localhost:8554/fb75e35d718d1e0379580b00d5fcc0e7",
      "remote_addr": "127.0.0.1:43364",
      "user_agent": "ffmpeg/go2rtc",
      "medias": [
        "audio, recvonly, OPUS/48000/2"
      ],
      "receivers": [
        "96 OPUS/48000/2, bytes=2800207, senders=1"
      ],
      "recv": 2949215
    }
  ],
  "consumers": [
    {
      "type": "RTSP passive consumer",
      "url": "rtsp://localhost:8554/doorbell_test?audio",
      "remote_addr": "127.0.0.1:43354",
      "user_agent": "go2rtc/ffmpeg",
      "medias": [
        "audio, sendonly, ANY"
      ],
      "senders": [
        "96 MPEG4-GENERIC/16000, bytes=1984536, receivers=1"
      ],
      "send": 2046072
    },
    {
      "type": "WebRTC/WebSocket async passive consumer",
      "remote_addr": "tcp4 prflx 192.168.10.183:65337 related :0",
      "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.62",
      "medias": [
        "video, sendonly, VP8, RTX, VP9, H264, AV1, RED, ULPFEC, FLEXFEC-03",
        "audio, recvonly, OPUS/48000/2, RED/48000/2, G722/8000, PCMU/8000, PCMA/8000, CN/8000, TELEPHONE-EVENT/48000, TELEPHONE-EVENT/8000",
        "audio, sendonly, OPUS/48000/2, RED/48000/2, G722/8000, PCMU/8000, PCMA/8000, CN/8000, TELEPHONE-EVENT/48000, TELEPHONE-EVENT/8000"
      ],
      "receivers": [
        "111 OPUS/48000/2, bytes=812126, senders=0"
      ],
      "senders": [
        "96 H264, bytes=124447151, receivers=1",
        "96 OPUS/48000/2, bytes=2679873, receivers=1"
      ],
      "recv": 1054116,
      "send": 128596160
    }
  ]
}
fflorens commented 1 year ago

I am unable to make the go2rtc integration work via frigate, there is some errors inside go2rtc log (using 1.5.0 version) The "normal" live stream view based on webrtc does not work (stays in loading state and there are the errors of ithe interlevaed frame thing) , but the "debug" view works ok it seems. Everything goes through a https enabled nginx proxy with a "real" certificate ofc Full log from go2rtc :

2023-05-10 08:59:36.237962468 [INFO] Preparing go2rtc config... 2023-05-10 08:59:36.416114729 [INFO] Got IP address from supervisor: XXX.XXX.XXX.XXX 2023-05-10 08:59:36.519483119 [INFO] Got WebRTC port from supervisor: 8555 2023-05-10 08:59:37.027207834 [WARN] Using go2rtc binary from '/config/go2rtc' instead of the embedded one 2023-05-10 08:59:37.027213571 [INFO] Starting go2rtc... 2023-05-10 08:59:37.104339150 10:59:37.104 INF go2rtc version 1.5.0 linux/amd64 2023-05-10 08:59:37.105313481 10:59:37.105 INF [api] listen addr=:1984 2023-05-10 08:59:37.106433145 10:59:37.106 INF [rtsp] listen addr=:8554 2023-05-10 08:59:37.107778670 10:59:37.107 INF [srtp] listen addr=:8443 2023-05-10 08:59:37.108598603 10:59:37.108 INF [webrtc] listen addr=:8555/tcp 2023-05-10 08:59:38.742150003 10:59:38.741 DBG [rtsp] new consumer stream=sonette 2023-05-10 08:59:38.823826719 10:59:38.823 DBG [streams] can't stop none producer 2023-05-10 08:59:38.823834570 10:59:38.823 DBG [streams] start producer url=rtsp://:@XXX.XXX.XXX.YYY:554/Preview_01_main 2023-05-10 08:59:46.256716280 [INFO] Starting go2rtc healthcheck service... 2023-05-10 09:01:15.733093535 11:01:15.732 DBG [webrtc] new consumer src=sonette 2023-05-10 09:01:15.752377081 11:01:15.750 DBG [exec] run url="exec:ffmpeg -hide_banner -v error -fflags nobuffer -flags low_delay -timeout 5000000 -user_agent go2rtc/ffmpeg -rtsp_transport tcp -i rtsp://127.0.0.1:8554/sonette?audio -vn -c:a libopus -ar:a 48000 -ac:a 2 -application:a voip -compression_level:a 0 -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp {output}" 2023-05-10 09:01:15.771153133 11:01:15.770 DBG [rtsp] new consumer stream=sonette 2023-05-10 09:01:15.904504950 11:01:15.904 DBG [exec] run launch=153.171281ms 2023-05-10 09:01:15.916595174 11:01:15.916 DBG [streams] start producer url=ffmpeg:sonette#audio=opus 2023-05-10 09:01:52.388865432 11:01:52.388 DBG [streams] stop producer url=ffmpeg:sonette#audio=opus 2023-05-10 09:01:52.393137622 av_interleaved_write_frame(): Broken pipe 2023-05-10 09:01:52.393147651 Last message repeated 1 times 2023-05-10 09:01:52.395731478 11:01:52.395 DBG [rtsp] handle=EOF 2023-05-10 09:01:52.397258054 11:01:52.395 DBG [streams] can't stop none producer 2023-05-10 09:01:52.397267342 11:01:52.395 DBG [rtsp] disconnect stream=sonette 2023-05-10 09:01:52.898918397 11:01:52.895 DBG [webrtc] new consumer src=sonette 2023-05-10 09:01:52.928922353 11:01:52.928 DBG [exec] run url="exec:ffmpeg -hide_banner -v error -fflags nobuffer -flags low_delay -timeout 5000000 -user_agent go2rtc/ffmpeg -rtsp_transport tcp -i rtsp://127.0.0.1:8554/sonette?audio -vn -c:a libopus -ar:a 48000 -ac:a 2 -application:a voip -compression_level:a 0 -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp {output}" 2023-05-10 09:01:53.001567974 11:01:53.001 DBG [rtsp] new consumer stream=sonette 2023-05-10 09:01:53.162266387 11:01:53.162 DBG [exec] run launch=229.971627ms 2023-05-10 09:01:53.165525024 11:01:53.162 DBG [streams] start producer url=ffmpeg:sonette#audio=opus 2023-05-10 09:01:54.417515088 11:01:54.416 DBG [rtsp] new consumer stream=sonette 2023-05-10 09:05:18.597517069 [aac @ 0x564bf8749940] channel element 1.10 is not allocated 2023-05-10 09:05:18.597526989 Error while decoding stream #0:0: Invalid data found when processing input 2023-05-10 09:05:26.787926041 [aac @ 0x564bf8749940] Input buffer exhausted before END element found 2023-05-10 09:05:26.787934397 Error while decoding stream #0:0: Invalid data found when processing input

frigate.yml:

mqtt:
  host: XXX.XXX.XXX.ZZZ
  port: 1883
  user: frigate
  password: 
  topic_prefix: frigate
go2rtc:
  streams:
    sonette:
      - rtsp://:@XXX.XXX.XXX.YYY:554/Preview_01_main
      - ffmpeg:sonette#audio=opus
  log:
    level: debug # default level
    api: debug
    exec: debug
    ngrok: info
    rtsp: debug
    streams: debug
    webrtc: debug

cameras:
  sonette:
    enabled: True
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
        - path: rtsp://127.0.0.1:8554/sonette
          input_args: preset-rtsp-restream
          roles:
            - detect
    detect:
      enabled: False
Ferry1994 commented 1 year ago

I managed to get the doorbell "working" in go2rtc and home assistant.

Is anyone else experiencing the doorbell does not ring anymore after you played a sound through home assistant media? (E.g. tts) The led around the button stays blue..

savage7 commented 1 year ago

@Ferry1994 yes I have the same problem.

NdR91 commented 1 year ago

I managed to get the doorbell "working" in go2rtc and home assistant.

Is anyone else experiencing the doorbell does not ring anymore after you played a sound through home assistant media? (E.g. tts) The led around the button stays blue..

This is a big limitation related to the Doorbell itself. If you notice, the visitor can't even press the button the second time after some seconds from the first one: the Doorbell stays in an "Active" state for a lot of time.

sammyke007 commented 1 year ago

I managed to get the doorbell "working" in go2rtc and home assistant. Is anyone else experiencing the doorbell does not ring anymore after you played a sound through home assistant media? (E.g. tts) The led around the button stays blue..

This is a big limitation related to the Doorbell itself. If you notice, the visitor can't even press the button the second time after some seconds from the first one: the Doorbell stays in an "Active" state for a lot of time.

Isn't that by design? Settings > Pushnotifications > Interval (20sec)

savage7 commented 1 year ago

If've tried scrypted and go2rtc 2 way audio. Scrypted works great seams to have the same audio lag as the reolink app, about 1s. with go2rtc it works, but I have about 2-3s audio delay. I've updated to the latest firmware.

quentindavid commented 1 year ago

Hi ! I'm very interested in the 2-way audio for Reolink Video Doorbell but it seems I can't get it to work. I have the following configuration in go2rtc :

reolink:
  - rtsp://login:password@192.168.x.xxx:554/h264Preview_01_sub
  - ffmpeg:reolink#audio=opus

But when I click on "video+audio+microphone = two way audio from camera", then webrtc.html, I can see the video and hear the sound coming, but the browser does not ask for microphone. I tried on my laptop with Brave, on my pixel with Brave and Chrome, but none has worked.

Is there something I'm missing ?

Do I need to push the button of the doorbell ? Or maybe this is because the doorbell and go2rtc are not within the same subnet ?

I have checked the logs but the only thing I can see is:

02:00:01.237 WRN github.com/AlexxIT/go2rtc/internal/streams/producer.go:159 > error=EOF url=rtsp://login:password@192.168.x.xxx:554/h264Preview_01_sub
02:00:06.134 WRN github.com/AlexxIT/go2rtc/internal/streams/producer.go:159 > error=EOF url=ffmpeg:reolink#audio=opus

The version of the camera is v3.0.0.2033_23041302

savage7 commented 1 year ago

@quentindavid You have to access webrtc.html via https, then it works. The browser blocks microphone access via http.

quentindavid commented 1 year ago

Hi @savage7 , indeed it works with https ! Thanks for your help !

AlexxIT commented 1 year ago

For test purposes, you can allow any site for access to mic with Google Chrome: https://stackoverflow.com/questions/52759992/how-to-access-camera-and-microphone-in-chrome-without-https

Daniel-dev22 commented 1 year ago

For test purposes, you can allow any site for access to mic with Google Chrome: https://stackoverflow.com/questions/52759992/how-to-access-camera-and-microphone-in-chrome-without-https

Would be cool if the companion app could automatically switch to https (external url) when the mic is needed.

NickM-27 commented 1 year ago

There's no need for that if the companion app natively supports mic permission, which they said is being worked on.

Cytomax55 commented 1 year ago

There's no need for that if the companion app natively supports mic permission, which they said is being worked on.

Are you saying that a companion app is being worked for video door bells that will hopefully support 2 way audio hopefully for the reolink door bell?

Having a secondary home assistant app specific for the doorbell would be awesome so i can make it have a special ring tone on my phone, this is EPIC news!

Do you have any links where i can monitor the progress of the app?

Iceman248 commented 1 year ago

I think he was saying that feature was going to be added to the companion app, not that there was going to be an additional app.

Cytomax55 commented 1 year ago

@Iceman248 Thank you for clarifying, where can i get this companion app?

Iceman248 commented 1 year ago

Home Assistant Companion App. In the app store of whatever type of device you have.

Cytomax55 commented 1 year ago

@Iceman248 Well i feel dumb, i just call it the Home Assistant App, didnt know it was called the "Home Assistant Companion App", I thought there was a secondary APP that just worked with door bells, that way i could customize the ringer on my phone so i know it was a door alert instead of a just a random HA alert

Thank you for clarify it for me

Iceman248 commented 1 year ago

It's alright. There are different notification channels, but I would imagine whichever one you would use to notify you about the doorbell would be the same you would use to notify you about anything else.

Daniel-dev22 commented 1 year ago

@Iceman248 Well i feel dumb, i just call it the Home Assistant App, didnt know it was called the "Home Assistant Companion App", I thought there was a secondary APP that just worked with door bells, that way i could customize the ringer on my phone so i know it was a door alert instead of a just a random HA alert

Thank you for clarify it for me

You should read up on the notifications docs for the companion app. There's a lot of customization.

Cytomax55 commented 1 year ago

I am using go2rtc 1.2 (default) that comes with frigate, i am unable to upgrade to 1.5 for some reason

I am running frigate docker container

I went to https://docs.frigate.video/configuration/advanced#custom-go2rtc-version to find out the steps needed to upgrade go2rtc

I then got go2rtc version 1.5 https://github.com/AlexxIT/go2rtc/releases/download/v1.5.0/go2rtc_linux_amd64

renamed it to go2rtc

placed it in the config folder of frigate /frigate/config

chmod +x go2rtc

ls -al shows

5241 -rwxr-xr-x 1 user root 5356360 May 29 23:11 go2rtc

Restarted frigate and i keep seeing 1.2 being loaded instead of 1.5 What am i doing wrong?

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

I am able to hear audio from the Reolink POE Doorbell on my PC using chrome BUT I am NOT able to speak from my computer to the Reolink POE Doorbell using chrome

as per Frigat Documentation recommendations

On, fluency first this sets the camera to CBR (constant bit rate)
Interframe Space 1x this sets the iframe interval to the same as the frame rate

I made the following changes to the Reolink video door bell Stream > Clear > Interframe Space > 1x Stream > Fluent > Interframe Space > 1x Stream > Frame Rate Mode > Fixed Frame Rate

Config Version v3.0.0.0 Firmware Version v3.0.0.2033_23041302

Mic is enabled

My SETUP

I am using SWAG from linuxserver.io as my reverse proxy for all my containers They both have certificates with the little lock sign when accessing using HTTPS

The 3 docker containers are

SWAG Home Assistant Frigate

Using this

go2rtc
  streams
    FrontDoorBell:
      - http://192.168.0.52/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=XXXXXX
      - ffmpeg:FrontDoorBell#audio=opus

Going to https://mydomain.com/live/webrtc/ Opening in Chrome, making sure my mic is enabled Using Stream > I get Video and INCOMING audio to my PC from the Doorbell, but nothing outgoing Using 2-way-aud > i get NO video and NO audio

+++++++++++++++++++++++++++++++

Using this

go2rtc
  streams
    FrontDoorBell:
      - rtsp://admin:XXXXX@192.168.0.52:554/Preview_01_main

Going to https://mydomain.com/live/webrtc/ Opening in Chrome, making sure my mic is enabled Using Stream > I get Video and INCOMING audio to my PC from the Doorbell, but nothing outgoing Using 2-way-aud > i get NO video and NO audio

What am i missing?

quizzical86 commented 1 year ago

@AlexxIT! is there a way to be able to launch a 2-way-audio stream without first having to go to the go2rtc page in Home Assistant, then click the links button, then select "video+audio+microphone = two way audio from camera" and finally click "webrtc.html"? I'd think having an easier way of launching the stream would greatly increase it's usefulness. For example – whenever someone rings the door – I could have Home Assistant send a command to my phone so that it opens a URL that loads the 2-way-audio stream so I can start talking. Currently, by the time I have clicked my way to the stream, the people will have left...

quentindavid commented 1 year ago

@Cytomax55 not sure what you doing wrong, but if version 1.2 is displayed, it's that you don't use 1.5 version, thus 2-way audio is not working @quizzical86 you can access the page directly with URL https://domain_name:5000/live/webrtc/webrtc.html?src=Camera_Name and it should ask for microphone permission directly

NickM-27 commented 1 year ago

@quizzical86 the url is static, you can easily just save the URL and then open it in an automation, there is no need to use the go2rtc UI to do that

Cytomax55 commented 1 year ago

I solved my problem in another thread ... When I get home I'm going to try and help update or modify the wiki to help the next guy https://github.com/blakeblackshear/frigate/discussions/6646#discussioncomment-6037537

quizzical86 commented 1 year ago

@quentindavid I tried that URL (and all kinds of variations for it) filling in of course my specific info, but it doesn't work. I also couldn't find any documentation on that URL sturcture (except for linked to frigate but I'm not using frigate). Where did you get that link from.

@NickM-27 the static URL does not work for me and isn't supposed to work as explained by @AlexxIT here . The static URL is: "https://linktomyhomeassistant.com/api/hassio_ingress/allkindsofnumbersandletters/webrtc.html?src=reolink&media=video+audio+microphone" and apparently any link with 'hassio_ingress' is not supposed to work except if you click it directly from within the Home Assistant page... Maybe you are talking about a different static URL that I could use?

NickM-27 commented 1 year ago

Yes, it won't work via ingress. You need to setup using your own domain or local IP:port with https

quizzical86 commented 1 year ago

Yes, it won't work via ingress. You need to setup using your own domain or local IP:port with https

I guess I'm overlooking some info on how to do that. I of course have my own domain with https so that I can access Home Assistant externally, I would appreciate it a lot if you could explain what I need to do more (or point me to a link with more information).

rbray89 commented 1 year ago

Just to let everyone know, the frigate card from HACS allows in-dashboard two-way audio now. Works well with my reolink doorbell.

On Tue, May 30, 2023, 9:11 AM quizzical86 @.***> wrote:

Yes, it won't work via ingress. You need to setup using your own domain or local IP:port with https

I guess I'm overlooking some info on how to do that. I of course have my own domain with https so that I can access Home Assistant externally, I would appreciate it a lot if you could explain what I need to do more (or point me to a link with more information).

— Reply to this email directly, view it on GitHub https://github.com/AlexxIT/go2rtc/issues/331#issuecomment-1568616373, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAILPFHBOM3EBSMVYAOLGMDXIYE2NANCNFSM6AAAAAAWSFVP4Q . You are receiving this because you were mentioned.Message ID: @.***>

Cytomax55 commented 1 year ago

Here are my steps for upgrading to go2rtc 1.5

Steps for getting newer version of go2rtc

Go to https://github.com/AlexxIT/go2rtc/releases

Download go2rtc_linux_amd64

Rename it to go2rtc

Go to the Frigate container directory and paste go2rtc inside of /frigate/config directory

Make the file executable chmod +x go2rtc

Edit your docker-compose file

Restart the frigate container

Go to frigate > System > go2rtc dashboard (upper right hand side) > Check your version

tarangill commented 1 year ago

Edit your docker-compose file

* /LocationOfContainer/frigate/config/config.yml:/config/config.yml #This should already be in your docker compose file

* /LocationOfContainer/frigate/config/go2rtc:/config/go2rtc #This is what you need to add

I had to actually replace the '/usr/local/go2rtc/bin/go2rtc' file in the container with the new one to make it work.

Cytomax55 commented 1 year ago

@tarangill

That seems like an easier option

are there any chances that go2rtc file gets overwritten when you pull a new container on an update?

nprez83 commented 1 year ago

I got 2-way audio working in my Reolink wifi doorbell through the go2rtc addon webui, as well as through the frigate card as described above. I've noticed the frigate addon consumes a fair bit of cpu resources despite not doing any detection or recording (I'm running hassos in a RPi4) so I went ahead and added a hostname to my Cloudflare tunnel to point to port 1984 and I'm calling that using an iframe as https://go2rtc.mydomain/webrtc.html?src=reolink_doorbell&media=video+audio+microphone. I did have an issue with the standard iframe not requesting mic access for some reason, so I followed the advice here and instead I'm using the following html code for the browser_mod popup under content.

<iframe src="https://go2rtc.mydomain/webrtc.html?src=reolink_doorbell&media=video+audio+microphone" allow="microphone *" frameborder="0" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;height:100%;width:100%;position:absolute;top:0%;left:0px;right:0px;bottom:0px" height="100%" width="100%"></iframe> 
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

I have noticed an issue with the volume though, regardless of how I do the 2-way audio (go2rtc webui, frigate, iframe). When I watch the webrtc stream the volume is great, but when I switch to the 2-way audio mode the volume on my end becomes really low. Has anything else noticed this? @ondoteam described the same here, but unfortunately that issue didn't get much activity, so hoping someone here can help. I played around with the "-af volume=" ffmpeg filter but couldn't get it to work.

ondoteam commented 1 year ago

Hello! I have updated my issue right now. I hope it helps.

quizzical86 commented 1 year ago

Using some of the pointers in the posts above I was finally able to get 2-way audio working externally. I have updated my comment here with detailed instructions, including how to configure NGINX Proxy manager: https://github.com/AlexxIT/go2rtc/issues/331#issuecomment-1536053855

Hope this can help others.

NickM-27 commented 1 year ago

It is better to use the /config/go2rtc method because the internal location could change in a future update and break things where as the /config/go2rtc will be supported.

Edit your docker-compose file

  • /LocationOfContainer/frigate/config/config.yml:/config/config.yml #This should already be in your docker compose file
  • /LocationOfContainer/frigate/config/go2rtc:/config/go2rtc #This is what you need to add

Or you could just add - /LocationOfContainer/frigate/config/:/config/

nprez83 commented 1 year ago

Hello! I have updated my issue right now. I hope it helps.

Thanks @ondoteam, I can confirm my volume is better now. Here's my final go2rtc config. Two key pointers, in order to make this work I could no longer use the stream name inside the ffmpeg stream, had to define the rtsp. I also tried opus, pcma, and pcm, and I felt pcm was the least distorted of all.


streams:
  reolink_doorbell:
    - ffmpeg:rtsp://username:password@192.168.0.194:554/h264Preview_01_sub#audio=pcm#audio=volume
    - rtsp://username:password@192.168.0.194:554/h264Preview_01_sub

ffmpeg:
  bin: ffmpeg
  volume: "-af \"volume=30dB\""
quizzical86 commented 1 year ago

OK so I solved one more issue which is how to avoid having to fill in a user and password when launching the two-way audio stream when someone rings the door. You can pass the username and pass in the link itself: https://username:password@go2rtc.yourdomain.com/webrtc.html?src=doorbellname&media=video+audio+microphone

I updated my full description on how to set up a two-way audio stream here: https://github.com/AlexxIT/go2rtc/issues/331#issuecomment-1536053855 I also added a bit of info on the automation to open the camera stream when someone rings the doorbell. The audio (from the person ringing the door and speaking to the doorbell) is still muted by default when the stream opens so if someone has any insights on how I can have it unmuted by default that would be awesome.

koshisan commented 1 year ago

Just to let everyone know, the frigate card from HACS allows in-dashboard two-way audio now. Works well with my reolink doorbell. On Tue, May 30, 2023, 9:11 AM quizzical86 @.> wrote: Yes, it won't work via ingress. You need to setup using your own domain or local IP:port with https I guess I'm overlooking some info on how to do that. I of course have my own domain with https so that I can access Home Assistant externally, I would appreciate it a lot if you could explain what I need to do more (or point me to a link with more information). — Reply to this email directly, view it on GitHub <#331 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAILPFHBOM3EBSMVYAOLGMDXIYE2NANCNFSM6AAAAAAWSFVP4Q . You are receiving this because you were mentioned.Message ID: @.>

Can you elaborate how you got it working? I have to admit that I am kind of new to HA, but somehow the link between WebRTC/go2rtc and the frigate card is missing - all parts work individually, but neither WebRTC nor go2rtc create cameras on their own in HA - nevertheless the card asks for an existing entity...

Iceman248 commented 1 year ago

Trying everything I see here and elsewhere, all I can get is 1-way audio, either I can hear or I can talk, but not both. It's like we all have different doorbells. Very frustrating. At least scrypted works. I've been having to just use it.

alexdelprete commented 1 year ago

This thread was invaluable to have 2-way audio working on my wifi doorbell. I'm using go2rtc in a separate docker container, and HA Core as a container in another docker with WebRTC custom component and its webrtc-camera lovelace card. RTC is working fine both internally and externally (had to configure port forwarding on my OPNsense fw).

The only missing piece is that the webrtc-camera card doesn't support 2-way audio (yet). I've seen how people have used iframe or launch the browser, but I don't really like it as a solution and prefer to wait for @AlexxIT to implement the functionality in the card.

Thanks to all contributors of this thread.

VinvarLaLece commented 1 year ago

The only missing piece is that the webrtc-camera card doesn't support 2-way audio (yet). I've seen how people have used iframe or launch the browser, but I don't really like it as a solution and prefer to wait for @AlexxIT to implement the functionality in the card.

I think the solution is to have a SSL certificate in place within the webportal of the Go2RTC stand alone instance. With that, all applications using Go2RTC would be able to estabilish a secure (https) connection.

As the documentation states, we need to use https to allow the browser to 'forward' our microphone input (to the Reolink doorbell). So, my assumption is the having a stand alone Go2RTC instance with SSL certificate on the API should allow us to load the https://[ip]:[port]/webrtc.html?dst=[stream_id]&media=camera+microphone.

Would love to verify this, but I am without a clue how to add an SSL certificate to the stand alone webportal. Anyone ideas how to achieve this via the config file, docker container, or ...?

NickM-27 commented 1 year ago

I don't think go2rtc needs to be the one to orchestrate that, this could easily be done with nginx or traefik

savage7 commented 1 year ago

I forgot to add fix when audio starts sending only after response on play command. Maybe that's why sometimes two way audio doesn't work

@AlexxIT any change the problem when playing files via tts is fixed? Its mentiond by multiple people "TTS: Doesn't work most of the time and when it does work it only plays part of the text."

alexdelprete commented 1 year ago

I think the solution is to have a SSL certificate in place within the webportal of the Go2RTC stand alone instance. With that, all applications using Go2RTC would be able to estabilish a secure (https) connection.

I already have that, through Traefik. I don't think it should be part of the embedded web portal.

I was referring specifically to the webrtc-camera card in Home Assistant. I read somewhere @AlexxIT saying it doesn't support 2-way audio "yet". That leads me to think he will implement it. So it's just a matter of waiting now.

I don't think go2rtc needs to be the one to orchestrate that, this could easily be done with nginx or traefik

I agree, and I'm using Traefik for that.

VinvarLaLece commented 1 year ago

I already have that, through Traefik. I don't think it should be part of the embedded web portal.

My apologies for misunderstanding. With your guidance I was able to fix my SSL issue. Thanks @NickM-27 & @AlexxIT! At the moment, I am trying to get it to work with the standard HA 'webpage' card while hoping the webrtc card will be updated.

I've seen how people have used iframe or launch the browser,

I know about the security risks with iframes. Might I ask what you mean when you say 'launch the browser'? Am I missing somehting here when I use the 'webpage' card? I prefer not to punch a hole in my security. Which is sometimes difficult as a non security specialist. :)

Off topic: I do not want to hijack this topic. Let me know if you would qualify my repsond as such.

alexdelprete commented 1 year ago

My apologies for misunderstanding. With your guidance I was able to fix my SSL issue.

No need to apologize for anything, glad you fixed that.

NdR91 commented 11 months ago

Hello guys, i still have some issue when trying to use the 2WayAudio for my Reolink Doorbell.

I'm using the latest HA Integration (with go2rtx 1.6 built in). Here is my configuration:

streams:

  campanello:
    - ffmpeg:rtsp://xxx:xxx@192.168.1.183:554/h264Preview_01_sub#audio=pcm#audio=volume
    - rtsp://xxx:xxx@192.168.1.183:554/h264Preview_01_sub

ffmpeg:
  bin: ffmpeg
  volume: "-af \"volume=30dB\""    

webrtc:
  candidates:
    - stun:8555  
log: 
  level: info  # default level
  api: info
  exec: info
  ngrok: info
  rtsp: debug
  streams: debug
  webrtc: debug

Now I'm still trying to test the 2wayaudio, using the link i find here: immagine

The point is that I can see the stream, I can hear the volume, but I cant speak though the Mic.

Can someone help me? Thank you :)

NdR91 commented 11 months ago

Ok at the end of all I managed to do it with Frigate (can't understand why it works with it and not with go2rtc itself...).

Thst's what I've done:

On the config.yml of Frigate

go2rtc:
  streams:

    campanello:
      - ffmpeg:rtsp://xxx:xxxx@192.168.1.183:554/h264Preview_01_sub#audio=pcm#audio=volume
      - rtsp://xxx:xxxx@192.168.1.183:554/h264Preview_01_sub

  ffmpeg:
    bin: ffmpeg
    volume: "-af \"volume=30dB\""    

The strange thing is that is the same configuration I used on go2rtc configuration file.

I then installed both Frigate integrations (Integration + Card) on HA.

It works BUT:

rbray89 commented 11 months ago

You want to add #audio=async to fix the distortion issues.

On Mon, Jul 31, 2023, 4:54 AM NdR91 @.***> wrote:

Ok at the end of all I managed to do it with Frigate (can't understand why it works with it and not with go2rtc itself...).

Thst's what I've done:

On the config.yml of Frigate

go2rtc: streams:

campanello:
  - ***@***.***:554/h264Preview_01_sub#audio=pcm#audio=volume ***@***.***:554/h264Preview_01_sub#audio=pcm%23audio=volume>
  - ***@***.***:554/h264Preview_01_sub

ffmpeg: bin: ffmpeg volume: "-af \"volume=30dB\""

The strange thing is that is the same configuration I used on go2rtc configuration file.

I then installed both Frigate integrations (Integration + Card) on HA.

It works BUT:

-

I must use the external link due to the fact mofers OS are blocking Microphone on http connections. That's a bit frustrating: I don't like having a doorbell working only of internet access is ok. I would prefer a local solution;

The audio coming from the doorbell is so distorted. This is not an acceptable quality imho. I am missing something?

— Reply to this email directly, view it on GitHub https://github.com/AlexxIT/go2rtc/issues/331#issuecomment-1658133670, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAILPFE6HEZZES34K5PWPNLXS6FF5ANCNFSM6AAAAAAWSFVP4Q . You are receiving this because you were mentioned.Message ID: @.***>

NdR91 commented 11 months ago

You want to add #audio=async to fix the distortion issues.

Thank you for your reply. It's not clear to me where I need to add that value.

Thank you :)