Open luisiam opened 1 year ago
The issue for many people (including me) seems to be that the audio can't be transmitted without encryption. I'm running my home assistant (+ mqtt, frigate and zigbee2mqtt) in separate docker containers. I would like to be able to connect the different services on my local network (and not via the internet).
What do you recommend for creating a locally encrypted connection between my HA and Frigate container? Thank you in advance.
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 :)
You would want to add this option to the FFmpeg stream as:
ffmpeg:rtsp://admin:ndr1808@192.168.1.183:554/h264Preview_01_sub#audio=pcm#audio=volume#audio=async
Where you get #audio=volume
and #audio=async
options? They are not from go2rtc.
Go2rtc not required encryption. Browsers require HTTPS if webpage request access to microphone. Audio data will be encrypted anyway via WebRTC technology.
Oops,
The option is just #async, not #audio=async
On Mon, Jul 31, 2023, 9:50 AM Alex X @.***> wrote:
Go2rtc not required encryption. Browsers require HTTPS if webpage request access to microphone. Audio data will be encrypted anyway via WebRTC technology.
— Reply to this email directly, view it on GitHub https://github.com/AlexxIT/go2rtc/issues/331#issuecomment-1658646084, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAILPFAKVZPBB74YQO26RP3XS7H2TANCNFSM6AAAAAAWSFVP4Q . You are receiving this because you were mentioned.Message ID: @.***>
Oops, The option is just #async, not #audio=async …
Sorry, so is this wrong?
ffmpeg:rtsp://admin:ndr1808@192.168.1.183:554/h264Preview_01_sub#audio=pcm#audio=volume#audio=async
Yeah, should just be
ffmpeg:rtsp:// @.***:554/h264Preview_01_sub#audio=pcm#audio=volume#async
On Tue, Aug 1, 2023, 1:32 AM NdR91 @.***> wrote:
Oops, The option is just #async, not #audio=async … <#m5455444377387294798>
Sorry, so is this wrong?
ffmpeg:rtsp:// @.:554/h264Preview_01_sub#audio=pcm#audio=volume#audio=async @.:554/h264Preview_01_sub#audio=pcm%23audio=volume%23audio=async>
— Reply to this email directly, view it on GitHub https://github.com/AlexxIT/go2rtc/issues/331#issuecomment-1659731680, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAILPFGED3SMAHOBMFBNQMTXTCWHVANCNFSM6AAAAAAWSFVP4Q . You are receiving this because you were mentioned.Message ID: @.***>
Go2rtc not required encryption. Browsers require HTTPS if webpage request access to microphone. Audio data will be encrypted anyway via WebRTC technology.
Does this mean that if I connect to my HA instance via HTTPS and the connection from HA to the webcam on Frigate (via WebRTC) I should be able to see the microphone appear? Because this is what I tried but I still can't find the output of the doorbell nor the microphone of the computer.
@markkvdb go2rtc has special web page with two way audio. WebRTC integration doesn't support it yet
Correct. Though you have to update Frigate's older go2rtc version to at least 1.5.0 I believe.
On Tue, Aug 1, 2023, 7:21 AM Mark van der Broek @.***> wrote:
Go2rtc not required encryption. Browsers require HTTPS if webpage request access to microphone. Audio data will be encrypted anyway via WebRTC technology.
Does this mean that if I connect to my HA instance via HTTPS and the connection from HA to the webcam on Frigate (via WebRTC) I should be able to see the microphone appear? Because this is what I tried but I still can't find the output of the doorbell nor the microphone of the computer.
— Reply to this email directly, view it on GitHub https://github.com/AlexxIT/go2rtc/issues/331#issuecomment-1660304759, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAILPFE5UCNKFMSOY7BPTWLXTD7D7ANCNFSM6AAAAAAWSFVP4Q . You are receiving this because you were mentioned.Message ID: @.***>
Correct. Though you have to update Frigate's older go2rtc version to at least 1.5.0 I believe. …
Sorry, I'm still a bit lost. I added the Frigate custom card to my HA instance and I set the live view provider to go2rtc with WebRTC as the go2rtc mode. I'm running a recent (dev) version of Frigate with go2rtc version 1.6.1. The live feed is showing up but the (enabled) microphone menu is not showing up (even when connecting to HA via HTTPS).
Do I have to provide more information to be able to analyse my setup and why it's not working?
Well. Of you have questions about Frigate card, you need to create issue in that project repo.
Well. Of you have questions about Frigate card, you need to create issue in that project repo.
That makes perfect sense. Is there a way I can check with just go2rtc if my setup is working? If go2rtc works as expected I can focus my attention on Frigate.
Correct. Though you have to update Frigate's older go2rtc version to at least 1.5.0 I believe. …
Sorry, I'm still a bit lost. I added the Frigate custom card to my HA instance and I set the live view provider to go2rtc with WebRTC as the go2rtc mode. I'm running a recent (dev) version of Frigate with go2rtc version 1.6.1. The live feed is showing up but the (enabled) microphone menu is not showing up (even when connecting to HA via HTTPS).
Do I have to provide more information to be able to analyse my setup and why it's not working?
I finally managed to resolved the issue of the microphone and audio not showing up. The problem I was facing was that HomeAssistant didn't have access to the microphone and didn't request access. I had to explicitly give access to the microphone and after the audio and microphone started showing up.
Beta firmware that tries to address audio issue https://www.reddit.com/r/reolinkcam/comments/15h2kar/testers_wanted_for_doorbell_camera_new_firmware/
I used to use
But now i see this being recommended
Does
replace
BOTH
Or does it just replace
As a Second Question I have Frigate (0.12.1-367d724) GO2RTC 1.6.2
FrontDoorBell_rtsp:
https://frigate.xxxx.com/live/webrtc/ Under chrome Camera, microphone Sound are all enabled
If i click on stream i hear audio but i cant use microphone
If i click on links > WebRTC Magic > video+audio+microphone = two way audio from camera > webrtc.html local WebRTC viewer
I can use my mic but i cant hear audio
Don't use #audio=volume#audio=async
. It doesn't do anything.
In conjunction with this:
ffmpeg:
bin: ffmpeg
volume: "-af \"volume=30dB\""
The doorbell volume gets boosted when you use #audio=volume
I find that using the async option actually creates distortion.
2 way audio is working for me with the stream with this config:
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\""
Ensure you are using https to access the microphone.
@strumluff, are your settings compatible with Home Assistant's Media Player component mentioned here? Waiting for my camera to arrive, so I cannot test at the moment, but I really want to enable TTS Automations.
The doorbell volume gets boosted when you use
#audio=volume
But @AlexxIT in this post above said that is not a go2rtc valid option.
Is there a list of ALL the available options (and the meaning) for go2rtc?
List of available options in documentation. This can be some custom option from some user setup. It will work only for his setup. And can do wrong things in other setups.
This can be some custom option from some user setup. It will work only for his setup. And can do wrong things in other setups.
looks like it's an ffmpeg filter command. So it should be standard for every ffmpeg setup.
The only thing is that 30dB value, looks arbitrary...
Is anyone of you, who has got the two way audio working, also experiencing a huge delay in the audio transmitted to the doorbell? The video seems to be working with very low delay. But the spoken words have a delay of about 2-3 seconds when they receive the doorbell.
@mrukas yup. IIRC, the app had a similar delay.
@rbray89 It appears to me, that the android app does not have such a high delay. Thats whats making me curious. The delay via go2rtc seems a lot higher than with the android app, when it comes to mic audio. It also appears that only the direction TO the doorbell has such a high delay. The direction FROM the doorbell to the other device does not seem so hugely affected.
Well i finally got 2 way audio working on my web browser on my desktop and web browser on my cell phone
I dont know if it matters for you guys but i HAD TO PUT " " around the ffmpeg like this
"ffmpeg:rtsp://user:pw@192.168.0.52:554/h264Preview_01_main#audio=pcm"
im assuming its because the #audio=pcm would not get read if it isnt in quotes and for sure
ffmpeg:rtsp://user:pw@192.168.0.52:554/h264Preview_01_main wasnt working by itself
So my config looks like this
FrontDoorBell:
rtsp://user:pw@192.168.0.52:554/h264Preview_01_main
FrontDoorBell_sub:
Am i missing anything?
So my config looks like this
FrontDoorBell: - "ffmpeg:rtsp://user:pw@192.168.0.52:554/h264Preview_01_main#audio=pcm" - rtsp://user:pw@192.168.0.52:554/h264Preview_01_main
FrontDoorBell_sub: - "ffmpeg:rtsp://user:pw@192.168.0.52:554/h264Preview_01_sub#audio=pcm" - rtsp://user:pw@192.168.0.52:554/h264Preview_01_sub
Am i missing anything?
Your config looks quite different from what I have:
reolink:
- rtsp://admin:password@192.168.0.5:554/h264Preview_01_sub
- ffmpeg:reolink#audio=opus
My full description of what I did for 2-way-audio on the reolink doorbeel is here: https://github.com/AlexxIT/go2rtc/issues/331#issuecomment-1536053855 Any benefits to your approach? Do you also have quite a lag between the moment you try to open the stream and when it is finally active?
@quizzical86 I want to start this by saying I am a complete noob at this I literally just figure things out by bumping my head over and over again
My best guess is
ffmpeg:reolink#audio=opus
The word "reolink" is probably a shortcut to
rtsp://admin:password@192.168.0.5:554/h264Preview_01_sub
So even though it looks different it's literally the same thing you're just using a shortcut and I'm just typing out the whole thing like an unkept wild animal
I love someone more knowledgeable than me to Chime in
As far as the difference between PCM and opus I have not tried opus yet
Is there a reason you use opus over PCM
I can try to see if there's a difference when I get home
So the video maybe has at most a second lag But from me speaking to the doorbell producing sound is probably like 3 to 5 seconds I'll have more info till later today
So even though it looks different it's literally the same thing you're just using a shortcut and I'm just typing out the whole thing like an unkept wild animal
it is not the same thing. when "ffmpeg:reolink#audio=..." is used it is connecting to the go2rtc restream. When "ffmpeg:rtsp://..." is used it is connecting directly to the camera. This can lead to more connections to the camera, more network bandwidth used, etc.
@NickM-27 Thank you so much for clarifying this for me It makes much more sense now
ffmpeg:reolink#audio=opus
Is a much more efficient way for audio Do you think there would be a difference in lag from
ffmpeg:reolink#audio=opus Compared to rtsp://admin:password@192.168.0.5:554/h264Preview_01_sub
For anyone coming across this thread later with new versions of go2rtc I had to modify my two-way link from:
https://FQDN/live/webrtc/webrtc.html?src=front_door_twoway
to:
https://FQDN/live/webrtc/webrtc.html?src=front_door_twoway&media=video+audio+microphone
and also reset the permissions of the site in my phone's browser.
@aneisch you can't access mic with HTTP. Only if you set custom browser permissions for this page
@aneisch you can't access mic with HTTP. Only if you set custom browser permissions for this page
Sorry, that's was a typo. It's https for both.
Meine Konfiguration sieht also so aus FrontDoorBell: – „ffmpeg:rtsp://user:pw@192.168.0.52:554/h264Preview_01_main#audio=pcm“ – rtsp://user:pw@192.168.0.52:554/h264Preview_01_main
FrontDoorBell_sub: - "ffmpeg:rtsp://user:pw@192.168.0.52:554/h264Preview_01_sub#audio=pcm" - rtsp://user:pw@192.168.0.52:554/h264Preview_01_sub
Vermisse ich etwas?
Deine Konfiguration sieht ganz anders aus als die, die ich habe:
reolink: - rtsp://admin:password@192.168.0.5:554/h264Preview_01_sub - ffmpeg:reolink#audio=opus
Meine vollständige Beschreibung dessen, was ich für 2-Wege-Audio auf der Reolink-Türklingel getan habe, finden Sie hier: #331 (Kommentar) Hat Ihr Ansatz Vorteile? Gibt es bei Ihnen auch eine ziemliche Verzögerung zwischen dem Moment, in dem Sie versuchen, den Stream zu öffnen, und dem Moment, in dem er endlich aktiv ist?
Is there already a solution for the fact that mp3/TTS are not played reliably and completely?
As this was all pretty new to me I thought I'd write down the steps I took to integrate the doorbell with 2-way audio support using go2rtc as it wasn't trivial, in the hope that it can help someone. Steps I took:
- Install WebRTC in Home Assistant using HACS (which then itself takes care of installing go2rtc) and then adding it as an integration.
- Add a new "custom:webrtc-camera" card in the Home Assistant dashboard (aka lovelace) with the following content:
type: custom:webrtc-camera url: rtsp://admin:password@192.168.0.5:554/h264Preview_01_sub
This allows me to see my camera and hear the audio from the doorbell microphone, but not speak trough the doorbell speaker. I understand this is because no current Lovelace cards support that. The only alternative to my understanding is to install separately the go2rtc addon (instead of having WebRTC take care of it.
- In the main config folder in home assistant create "go2rtc.yaml" with the following content:
streams: reolink: - rtsp://admin:password@192.168.0.5:554/h264Preview_01_sub - ffmpeg:reolink#audio=opus webrtc: candidates: - stun:8555 # if you have dynamic public IP-address. This allows you to connect to the stream when you're not home. log: # Here you define what you want to see in the logging section in the addon page (where you install/configure the go2rtc addon). level: info # default level api: info exec: info ngrok: info rtsp: debug streams: debug webrtc: debug
- In configuration.yaml add the following content:
media_player: - platform: webrtc #to set up the reolink doorbell as a media player using webrtc which supports 2-way audio. Thus I can play sounds on the camera. name: Deurbel stream: reolink audio: pcma
This adds the doorbell's built in speaker as a media player enabling TTS, playing MP3 files,... It doesn't work for me because I see the embedded WebRTC is v1.2.0 while I should use 1.5.0
- For the 2 reasons in italics above I then proceeded to install the go2rtc in Home Assistant.
- go2rtc didn't want to start (the log remained empty) so I removed the WebRTC integration, then removed WebRTC from HACS as well. After a reboot of Home Assistant I saw that in the folder /config the file "go2rtc-1.2.0" was still present so I deleted that.
- Now the go2rtc addon was willing to start. It picked up the "go2rtc.yaml" settings correctly.
- Go to the webpage of the add-on. It's important not to use the default add-on link for that (so don't use https://yourdomain/a889bffc_go2rtc/dashboard), instead use http://localhost:1984/. If you use the wrong link it will give an error if you try to open the URL directly rather than clicking it in Home Assistant.
- The default 'stream' link on the go2rtc webpage allowed me to see video from the doorbell camera and hear audio from it's microphone. However it didn't give a possibility to use the doorbell speaker or ask to activate my phone's microphone.
- On the "links" subpage, at the bottom I could click "video+audio+microphone = two way audio from camera" and then the webrtc.html link. This time it did ask for access to my phone's microphone but it never loaded the video stream or audio
- I then proceed to open port 8555 (UDP and TCP) in my router and forward it to my Home Assistant IP.
- Now it works on my android smartphone using the Chrome browser and my voice can be heard trough the doorbell speaker, after close to 10 seconds of loading. Any tips on how to have the sound unmuted by default (currently I have to manually tap a button to unmute the sound coming from the doorbell)?
- To make it work externally I used the NGINX Proxy manager add-on in home assistant. The go2rtc does not have any sort of security so I first had to create in NGINX a login and password requirement for anyone who tries to access go2rtc.
1: go to Access Lists 2: create a new one and name it 3: click satisfy any 4: go to authorization and choose a login and password 5: save
Then create the proxy that will enable the external access:
1: go to Hosts and add a new proxy host 2: fill in the URL with which you want to access go2rtc and all the other settings as you see on this screen. 3: also enable the Access List you just created which requires setting a username and password 4: under SSL choose "request a new SSL certificate" and select 'force SSL'. Then Save Now you can navigate from anywhere to the URL you just created and after filling in the username and password you will reach the GO2RTC addon and also use the direct link to open the stream with two way audio. If you want to avoid having to regularly fill in the username and password then you can include this in the URL of the stream like this: https://username:password@go2rtc.yourdomain.com/webrtc.html?src=doorbellname&media=video+audio+microphone
I'm using a Home Assistant automation that opens that URL on my smartphone automatically whenever someone rings the door. It's super simple and looks like this in Node Red:
Here's the code that you can copy into Node Red.
[{"id":"823df126e62785d5","type":"server-state-changed","z":"34843a6c.50d986","name":"Doorbell pressed","server":"5c29d263.09d2ac","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.reolink_video_doorbell_poe_visitor","entityidfiltertype":"substring","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":false,"for":"","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":1420,"y":760,"wires":[["33113cdc4d83de39"],[]]},{"id":"33113cdc4d83de39","type":"api-call-service","z":"34843a6c.50d986","name":"Launch twowaytalk on mobile","server":"5c29d263.09d2ac","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_mobile_john","areaId":[],"deviceId":[],"entityId":[],"data":"{\"message\":\"command_activity\",\"data\":{\"intent_package_name\":\"com.android.chrome\",\"intent_action\":\"android.intent.action.VIEW\",\"intent_uri\":\"https://username:password@go2rtc.yourdomain.com/webrtc.html?src=doorbellname&media=video+audio+microphone\",\"importance\":\"high\",\"priority\":\"high\"}}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1640,"y":760,"wires":[[]]},{"id":"5c29d263.09d2ac","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]
Also with the native Home Assistant it should be super easy.
- I then reinstalled WebRTC through HACS and as an integration. Playing media files: This seems to work more or less. It sometimes plays the mp3 file and sometimes doesnt and it doesn't play the full file (the moment it stops playing differs from file to file, but for each individual file it is always at the same moment). I notice that if in the reolink app I use the 'quick reply" feature to have the reolink doorbell speak a message (e.g. to leave the package at the door) and during that moment I use Home Assistant to play an mp3 file on the doorbell, it does interrupt the "quick reply" (but often does not play the mp3 itself). TTS: Doesn't work most of the time and when it does work it only plays part of the text.
Any insights on how to improve the issues in bold would be very welcome :)
Is there already a solution for the fact that mp3/TTS are not played reliably and completely?
I'm struggling to get both a stable connection and 2 way. If I use rtsp the camera keeps losing connection. FLV works well, but I can't get 2 way audio. Is there a truck to get both? Can someone post their config?
@Aggro600
Is there already a solution for the fact that mp3/TTS are not played reliably and completely?
I haven't managed to solve this so far
@Aggro600
Is there already a solution for the fact that mp3/TTS are not played reliably and completely?
I haven't managed to solve this so far
I have an issue opened for something similar: https://github.com/AlexxIT/go2rtc/issues/659
Hi, this configuration that work for me. I have created two cameras as suggested by other comments with the audio opus option.
streams:
reolink_main:
- rtsp://admin:password@192.168.0.5:554/h264Preview_01_main
- ffmpeg:reolink_main#audio=opus
reoling_sub:
- rtsp://admin:password@192.168.0.5:554/h264Preview_01_sub
- ffmpeg:reolink_sub#audio=opus
I have added this URL to the webrtc card with options media: video, audio, microphone
:
URL: rtsp://example.com:8554/reolink_main
or
URL: rtsp://example.com:8554/reolink_sub
It's working with audio and micophone support.
I have been finding the rtsp protocol just stops responding about once a day on my doorbell and I need to reboot it to fix it.. I am recording over the http / flv steam as that seems to be stable.
I have tested the two way and it works but only for a few hours before the rtsp stops responding again.
Reolink support sent me firmware v3.0.0.2602_23081801 and the RTSP feed isn't failing anymore it seems.
However have a new question.. Is there any way for us to adjust the audio we are sending back to the doorbell from our mic?
I am testing from my iPhone with the frigate card and the output sound very blown out and there is a lot of his background noise.. I am wondering if we can tune our output at all.
Reolink support sent me firmware v3.0.0.2602_23081801 and the RTSP feed isn't failing anymore it seems.
However have a new question.. Is there any way for us to adjust the audio we are sending back to the doorbell from our mic?
I am testing from my iPhone with the frigate card and the output sound very blown out and there is a lot of his background noise.. I am wondering if we can tune our output at all.
Is that firmware stable? Interesting they didn't release that on their site yet.
They apparently release in between firmware to users a lot. However taking to support was frustrating as they were hyper focused on if it was working OK with the Reolink Aps or if I had a Reolink NVR. Trying to get support for a 3rd party NVR I had to focus on it not working even in VLC which is something they also use in their support docs.
After about 3-4 back and forth exchanges they said they were going to escalate to an engineer but instead sent me a firmware to test.
They have it over on Reddit as well, it's been working well for me though I don't use two way audio often
Be careful.... they sent me a firmware to test. Whole the RTSP seems to work the doorbell never stops ringing once started. They said they found the bug but I'll just have to wait for firmware release now and I can't revert.... worth no ETA..
On Sat, Nov 11, 2023, 09:23 bagobones @.***> wrote:
They apparently release in between firmware to users a lot. However taking to support was frustrating as they were hyper focused on if it was working OK with the Reolink Aps or if I had a Reolink NVR. Trying to get support for a 3rd party NVR I had to focus on it not working even in VLC which is something they also use in their support docs.
After about 3-4 back and forth exchanges they said they were going to escalate to an engineer but instead sent me a firmware to test.
— Reply to this email directly, view it on GitHub https://github.com/AlexxIT/go2rtc/issues/331#issuecomment-1806829950, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADAEABABC2PKGGXZO775AWTYD6C4RAVCNFSM6AAAAAAWSFVP4SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBWHAZDSOJVGA . You are receiving this because you commented.Message ID: @.***>
not sure what you mean by can't revert, I've reverted the doorbell firmware many times while they were working through their initial two way talk issues
Tried several times and it just won't. They don't even know what to tell me. They offered me some money while I wait....
About doorbell ring, try to use backchannel=0
About doorbell ring, try to use backchannel=0
Isn't that effectively disable 2-way audio?
yes, you should have a secondary stream that supplies two way audio so it is not always running
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