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
4.1k stars 329 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
    }
  ]
}
luisiam commented 9 months ago

yes, you should have a secondary stream that supplies two way audio so it is not always running

Is it something like that?

streams:
  reolink_main:
    - rtsp://admin:password@192.168.0.5:554/h264Preview_01_main#backchannel=0
    - rtsp://admin:password@192.168.0.5:554/h264Preview_01_main#video=copy#audio=copy#audio=opus
NickM-27 commented 9 months ago

you can't use #video=#audio= without ffmpeg: and you can't use two way talk with ffmpeg:

I would suggest

go2rtc:
  streams:
    your_reolink_camera:
      - "ffmpeg:http://reolink_ip/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=username&password=password#video=copy#audio=copy#audio=opus"
      - rtsp://admin:password@192.168.0.5:554/h264Preview_01_sub
dfilkovi commented 8 months ago

I followed this thread and I successfully set up two way audio using webrtc but cannot get audio from the doorbell (visitors speaking) onto go2rtc in RTC mode, only on MSE mode. What did I do wrong?

Edit: solved it, ffmpeg issue, not a go2rtc

TurboTronix commented 8 months ago

Is 192.168.0.5:554 the reolink IP?

dtalens commented 8 months ago

Is 192.168.0.5:554 the reolink IP?

It depends on your local network. You can use for reolink app to check IP of your camera.

TurboTronix commented 8 months ago

Yeah I used the ip from my reolink app but it doesn't work. I have the camera linked to BlueIris, could that creater an issue?

TurboTronix commented 8 months ago

so got this in go2rtc:

streams:
  reolink_doorbell:
    - rtsp://admin:pass@192.168.#.###:554/h264Preview_01_main
    - onvif://admin:pass@192.168.#.###:8000
    - 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

But for the life of me I can't get the custom webrtc to work. All I want is to monitor the doorbell button (when someone presses it). Also be able to talk back via Hassio.

I have this camera presently set up via BlueIris which I am using via Hassio, not sure if there's an easier way to just get all that directly from BlueIris.

nprez83 commented 8 months ago

so got this in go2rtc:

streams:
  reolink_doorbell:
    - rtsp://admin:pass@192.168.#.###:554/h264Preview_01_main
    - onvif://admin:pass@192.168.#.###:8000
    - 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

But for the life of me I can't get the custom webrtc to work. All I want is to monitor the doorbell button (when someone presses it). Also be able to talk back via Hassio.

I have this camera presently set up via BlueIris which I am using via Hassio, not sure if there's an easier way to just get all that directly from BlueIris.

This is my current setup, which works great for 2 way speech

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

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

webrtc:
  listen: ":39760"  # address of your local server (TCP)
  candidates:
    - stun:39760  # if you have dynamic public IP-address
maxistviews commented 7 months ago

What is the current user experience for this? I recall reading that the two way audio starts as soon as the card is loaded in lovelace - is this still the case? Or is there a possibility of a push to talk feature through lovelace?

NdR91 commented 7 months ago

This is my current setup, which works great for 2 way speech

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

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

webrtc:
  listen: ":39760"  # address of your local server (TCP)
  candidates:
    - stun:39760  # if you have dynamic public IP-address

Thanks @nprez83 for sharing your working code. I'm a bit confused cause I already created the go2rtc container and I'm using the same configuration, but now I miss the last step: I don't understand how to integrate it in my HA instance. Do I need to work on my config or just add it in the webrtc card? And if yes, can you share your card config?

Thanks :)

nprez83 commented 7 months ago

I use the webrtc card. Tried using the integration previously, but I prefer one of my cameras (the Nest camera) to not go through go2rtc, so by using the webrtc card I can decide which cameras use the native integration vs go2rtc.

NdR91 commented 7 months ago

Thanks again @nprez83 That's the point which is confusing me: doesn't the card comes with the integration?

Sorry if i'm bothering you, but do you mind sharing the card full code? This would help me understanding...

nprez83 commented 7 months ago

It does, but you can also install the go2rtc addon separately and do the configuration of the streams through it, outside of the webrtc card altogether. This way you can make sure the go2rtc version is always the most updated regardless of which version webrtc has built in.

By the way, I should have been more clear, when I said I tried running it using the integration, I meant the RTSPtoWebRTC home assistant integration, which can automatically feed camera streams into go2rtc and receive the WebRTC streams back from it. The other method of using go2rtc is by using the webrtc card to selectively choose the camera streams that use it. You can additionally install the go2rtc addon if you'd like as I described above. This is the way I run it. I basically use it for my Reolink doorbell and 3 Foscam cameras. The Nest cam I run through the built-in integration. Hope this helps.

nprez83 commented 7 months ago

And here's the code for my doorbell webrtc card. The stream itself is defined within the go2rtc.yaml. I'm using the latest feature added to the card to support 2-way audio directly through it.

type: custom:webrtc-camera
streams:
  - url: reolink_doorbell
  - url: reolink_doorbell
    mode: webrtc
    media: video,audio,microphone
muted: true
intersection: 0.75
background: false
ui: true
poster: https://stateandfed.com/wp-content/uploads/2017/08/please-stand-by.png
style: >-
  .shortcuts {left: unset; top: 5px; right: 5px; display: flex; flex-direction:
  column; opacity: 0.8} .mode {display: none} .screenshot {display: none}
  .pictureinpicture {display: none}
NdR91 commented 7 months ago

And here's the code for my doorbell webrtc card. The stream itself is defined within the go2rtc.yaml. I'm using the latest feature added to the card to support 2-way audio directly through it.

Ok, now I have the exactly same setup. A question: you mention this code:

type: custom:webrtc-camera
streams:
  - url: reolink_doorbell
  - url: reolink_doorbell

But you have only one stream added of your doorbell:

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

So are you using only one stream?

bednim commented 7 months ago

it seems that one stream is view camera only, second stream is for two way talk.

On Fri, 5 Jan 2024 at 08:33, NdR91 @.***> wrote:

And here's the code for my doorbell webrtc card. The stream itself is defined within the go2rtc.yaml. I'm using the latest feature added to the card to support 2-way audio directly through it.

Ok, now I have the exactly same setup. A question: you mention this code:

type: custom:webrtc-camera streams:

  • url: reolink_doorbell
  • url: reolink_doorbell

But you have only one stream added of your doorbell:

streams: reolink_doorbell:

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

So are you using only one stream?

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

NdR91 commented 7 months ago

it seems that one stream is view camera only, second stream is for two way talk.

Sure, but the "stream name" is only one: "reolink_doorbell"

bednim commented 7 months ago

correct but you switch between those - S0 S1 bottom left corner of the webrtc card.

On Fri, 5 Jan 2024 at 10:50, NdR91 @.***> wrote:

it seems that one stream is view camera only, second stream is for two way talk.

Sure, but the "stream name" is only one: "reolink_doorbell"

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

nprez83 commented 7 months ago

Exactly what @bednim said.

NdR91 commented 7 months ago

Guys, thanks, now I got it.

So S0 is only for video+audio, S1 would be pressed in order to use video+audio+mic?

bednim commented 7 months ago

Correct.

On Fri, 5 Jan 2024 at 11:15, NdR91 @.***> wrote:

Guys, thank, now I got it. So S0 is only for video+audio, S1 would be pressed in order to use video+audio+mic?

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

NdR91 commented 7 months ago

First of all, thank's for the support @bednim and @nprez83.

Right now I'm on Chrome and the video stream is working both via local access and external url (I didn't test the 2wayaudio yet).

This is the strange thing: it's not workin from mobile both on iOS and Android. Some suggestion?

EDIT: a reboot of go2rtc container solved the problem, probably it didn't take some old the last edits

Going to test the 2way audio

jovanyeo commented 7 months ago

And here's the code for my doorbell webrtc card. The stream itself is defined within the go2rtc.yaml. I'm using the latest feature added to the card to support 2-way audio directly through it.

type: custom:webrtc-camera
streams:
  - url: reolink_doorbell
  - url: reolink_doorbell
    mode: webrtc
    media: video,audio,microphone
muted: true
intersection: 0.75
background: false
ui: true
poster: https://stateandfed.com/wp-content/uploads/2017/08/please-stand-by.png
style: >-
  .shortcuts {left: unset; top: 5px; right: 5px; display: flex; flex-direction:
  column; opacity: 0.8} .mode {display: none} .screenshot {display: none}
  .pictureinpicture {display: none}

Hello nprez83,

I need help with this 2 way audio setup for Reolink POE doorbell camera

nprez83 commented 7 months ago

You'll have to be more specific as to what you need help with

jovanyeo commented 7 months ago

You'll have to be more specific as to what you need help with

Hi Nprez83,

Sorry for not indicating well with my issue.

Basically,I got myself a Reolink door Camera POE version and would like to integrate to Home assistant.

My target for this integration, as follows:- 1) 2 way audio 2) hopefully the live video is not lagging more than 2 sec comparison with using the actual reolink apps.

Please allow me to aligned myself to be same page as you.

Could you advise what are the adds-on is needed:-

1) Frigate? I saw Frigate has a go2rtc. Am I required to install a standalone go2rtc component?

2) standalone go2rtc? ( which appeared on the sidebar of the HA.

3) Webrtc?

4) RTSPtoWebrtc?

####### FYI######################## My current setup,I am able to have the mic icon appeared in Frigate Lovelace card and able to toggle the mic but is not working. #####################################

NdR91 commented 7 months ago

@jovanyeo my suggestion is to start from this comment by nprez

We are talking about go2rtc and webrtc card. It's working on frigate too, but you need to manually update the go2rtc version

jovanyeo commented 7 months ago

@jovanyeo my suggestion is to start from this comment by nprez

We are talking about go2rtc and webrtc card. It's working on frigate too, but you need to manually update the go2rtc version

@NdR91 my frigate is not working( mic button is there and i am able to switch on/off but no audio output).. and I did manually update frigate ( go2rtc version from 1.2 to 1.5)

Could you advise what are the actual adds on is needed?

And I confused some of codes you guys are talking about: like where this code is located,need to manually created( like what we did when we installed the frigate)

So this is the reason why I ask what are the add on is needed so will be easier to understand and raise my question/issue properly.

jovanyeo commented 7 months ago

@NdR91 and @nprez83

Is my setup correct:

go2rtc:-
streams:
  reolink_doorbell:
    - ffmpeg:rtsp://admin:admin@192.168.3.135:554/h264Preview_01_sub#audio=pcm#audio=volume
    - rtsp://admin:admin@192.168.3.135:554/h264Preview_01_sub

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

webrtc:
  listen: ":39760"  # address of your local server (TCP)
  candidates:
    - stun:39760  # if you have dynamic public IP-address

Webrtc: lovelace card


   type: custom:webrtc-camera
streams:
  - url: reolink_doorbell
  - url: reolink_doorbell
    mode: webrtc
    media: video,audio,microphone
muted: true
intersection: 0.75
background: false
ui: true
poster: https://stateandfed.com/wp-content/uploads/2017/08/please-stand-by.png
style: >-
  .shortcuts {left: unset; top: 5px; right: 5px; display: flex; flex-direction:
  column; opacity: 0.8} .mode {display: none} .screenshot {display: none}
  .pictureinpicture {display: none}
jovanyeo commented 7 months ago
{
  "producers": [
    {
      "type": "RTSP passive producer",
      "url": "rtsp://127.0.0.1:8554/bf6df8231dd39201cf62e1e1fb9e3ebb",
      "remote_addr": "127.0.0.1:45916",
      "user_agent": "ffmpeg/go2rtc",
      "sdp": "v=0\r\no=- 0 0 IN IP4 127.0.0.1\r\ns=Session streamed by \"preview\"\r\nc=IN IP4 127.0.0.1\r\nt=0 0\r\na=tool:libavformat 60.16.100\r\nm=audio 0 RTP/AVP 96\r\nb=AS:128\r\na=rtpmap:96 L16/8000/1\r\na=control:streamid=0\r\n",
      "medias": [
        "audio, recvonly, L16/8000"
      ],
      "receivers": [
        "96 L16/8000, bytes=17736672, senders=1"
      ],
      "recv": 17950684
    },
    {
      "type": "RTSP active producer",
      "url": "rtsp://192.168.3.135/h264Preview_01_sub/",
      "remote_addr": "192.168.3.135:554",
      "user_agent": "go2rtc/1.8.5",
      "sdp": "v=0\r\no=- 1704641998760543 1 IN IP4 192.168.3.135\r\ns=Session streamed by \"preview\"\r\ni=h264Preview_01_sub\r\nt=0 0\r\na=tool:LIVE555 Streaming Media v2020.08.12\r\na=type:broadcast\r\na=control:*\r\na=range:npt=0-\r\na=x-qt-text-nam:Session streamed by \"preview\"\r\na=x-qt-text-inf:h264Preview_01_sub\r\nm=video 0 RTP/AVP 96\r\nc=IN IP4 0.0.0.0\r\nb=AS:8192\r\na=rtpmap:96 H264/90000\r\na=fmtp:96 packetization-mode=1;profile-level-id=640033;sprop-parameter-sets=Z2QAM6wVFKCgPZA=,aO48sA==\r\na=control:track1\r\nm=audio 0 RTP/AVP 97\r\nc=IN IP4 0.0.0.0\r\nb=AS:8192\r\na=rtpmap:97 MPEG4-GENERIC/16000\r\na=fmtp:97 streamtype=5;profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1408\r\na=control:track2\r\n",
      "medias": [
        "video, recvonly, H.264 High 5.1",
        "audio, recvonly, MPEG4-GENERIC/16000"
      ],
      "receivers": [
        "96 H264, bytes=4625155, senders=1"
      ],
      "recv": 4668295
    }
  ],
  "consumers": [
    {
      "type": "WebRTC/WebSocket async passive consumer",
      "remote_addr": "udp4 srflx 119.56.100.125:48431 related 10.152.91.193:48431",
      "user_agent": "Mozilla/5.0 (Linux; Android 13; SM-S908E Build/TP1A.220624.014; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/120.0.6099.145 Mobile Safari/537.36 Home Assistant/2023.12.4-11898 (Android 13; SM-S908E)",
      "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, PCML"
      ],
      "senders": [
        "102 H264, bytes=1525660, receivers=1",
        "8 PCMA/8000, bytes=371712, receivers=1"
      ],
      "send": 1732240
    }
  ]
}
jovanyeo commented 7 months ago

Thanks @NdR91 and @nprez83.

I managed to sort out the issue..

mpeterson commented 7 months ago

@jovanyeo can you say how? I can't seem to find the way to solve it

jovanyeo commented 7 months ago

@jovanyeo can you say how? I can't seem to find the way to solve it

Hello @mpeterson ,

What components has you installed to your HA.

You only need go2rtc and webrtc.

Basically go2rtc is to pull the stream( video/ audio) from camera.

And Webrtc is the user GUI to interact with the camera.

Which part do you got stuck with?

mpeterson commented 7 months ago

@jovanyeo thanks for the good predisposition! I just got it to work (partially), it was a networking configuration issue, the ports were not exposed correctly. Now I can do 2-way audio from the card, however the media_player doesn't work still :(

MaxDomo commented 6 months ago

Hi @jovanyeo ! Downgrade the doorbell firmware to this version "v3.0.0.1859_23030902". It's work perfectly :)

jovanyeo commented 6 months ago

Hi @jovanyeo ! Downgrade the doorbell firmware to this version "v3.0.0.1859_23030902". It's work perfectly :)

Hello Max,

Fyi.

v3.0.0.2033_23041302, this firmware is fine too

jovanyeo commented 6 months ago

@jovanyeo thanks for the good predisposition! I just got it to work (partially), it was a networking configuration issue, the ports were not exposed correctly. Now I can do 2-way audio from the card, however the media_player doesn't work still :(

What is the media player for?

MaxDomo commented 6 months ago

@jovanyeo this is my configuration in "configuration.yaml"

media_player:
  - platform: webrtc
    name: interphone
    stream: doorbell

My go2rtc version is 1.8.5.

My frigate docker-compose

version: "3.9" services: frigate: container_name: frigate privileged: true # this may not be necessary for all setups restart: unless-stopped

image: ghcr.io/blakeblackshear/frigate:stable

image: ghcr.io/blakeblackshear/frigate:0.13.0-beta7 shm_size: "512mb" # update for your cameras based on calculation above devices:

  • /dev/bus/usb:/dev/bus/usb # passes the USB Coral, needs to be modified for other versions
  • /dev/dri/renderD128:/dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
  • /dev/dri/card0:/dev/dri/card0 volumes:
  • /etc/localtime:/etc/localtime:ro
  • /media/data/config/go2rtc:/config/go2rtc
  • /media/data/config:/config
  • /media/data:/media/frigate
  • type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear target: /tmp/cache tmpfs: size: 1000000000 tmpfs:
  • /tmp/cache,size=1G ports:
  • "1935:1935"
  • "1984:1984" #expose go2rtc :)
  • "5000:5000"
  • "8554:8554" # RTSP feeds
  • "8555:8555/tcp" # WebRTC over tcp
  • "8555:8555/udp" # WebRTC over udp

You have an error when you play sound with the media_player ?

AlexxIT commented 6 months ago

I can't see codec name in your config

MaxDomo commented 6 months ago

Oups thx @AlexxIT !

media_player:
  - platform: webrtc
    name: interphone
    stream: doorbell
    audio: pcma
nprez83 commented 3 months ago

Is 2-way audio still working for people after upgrading to firmware v3.0.0.3215_2401262240? No longer working for me, would love not having to downgrade the firmware if possible. @jovanyeo

roelvdwater commented 3 months ago

Is 2-way audio still working for people after upgrading to firmware v3.0.0.3215_2401262240? No longer working for me, would love not having to downgrade the firmware if possible. @jovanyeo

I have confirmed that the 2-way audio broke between version v3.0.0.2033_23041302 and v3.0.0.3215_2401262240. When I reverted to v3.0.0.2033_23041302 using this firmware archive repository, I managed to get it working.

jovanyeo commented 3 months ago

Is 2-way audio still working for people after upgrading to firmware v3.0.0.3215_2401262240? No longer working for me, would love not having to downgrade the firmware if possible. @jovanyeo

I have confirmed that the 2-way audio broke between version v3.0.0.2033_23041302 and v3.0.0.3215_2401262240. When I reverted to v3.0.0.2033_23041302 using this firmware archive repository, I managed to get it working.

Thank u!!!!

nprez83 commented 3 months ago

Is 2-way audio still working for people after upgrading to firmware v3.0.0.3215_2401262240? No longer working for me, would love not having to downgrade the firmware if possible. @jovanyeo

I have confirmed that the 2-way audio broke between version v3.0.0.2033_23041302 and v3.0.0.3215_2401262240. When I reverted to v3.0.0.2033_23041302 using this firmware archive repository, I managed to get it working.

Thanks. I only realized because I was trying to get 2-way audio working on a new Reolink E1 Zoom, which I figured would be the same setup as the doorbell, only to find out neither of them work 😕

bezmi commented 2 months ago

Hi All, using the latest version (1.9.2) of go2rtc, I have managed to use the 2 way talk functionality in QuantumEntangledAndy/neolink with the exec source in go2rtc. Instead of approx 3 seconds, my 2 way audio delay is close to the reolink app now.

Here is the script I'm using (neolink_talk.sh):

#!/usr/bin/env bash

ffmpeg -fflags nobuffer -f alaw -ar 8000 -i - -f wav - | ./neolink talk Doorbell -c config.toml --volume=1.0 -m -i "fdsrc fd=0"

go2rtc.yaml:

streams:
  doorbell_sub:
  - ffmpeg:http://doorbell_ip/flv?port=1935&app=bcs&stream=channel0_sub.bcs&user=admin&password=PASS#video=copy#audio=opus
  - exec:/config/neolink/neolink_talk.sh#backchannel=1

I'm using it now with frigate, but that involves installing gstreamer, etc into the docker container, as well as using the latest go2rtc instead of the included v1.8.4. An easier way to test is using Alex's WebRTC card/integration and setting media: video,audio,microphone.

The ffmpeg pipe into neolink is faster than using fdsrc fd=0 ! audio/x-alaw,rate=8000,channels=1 in the neolink command from my testing. I'm sure there is a gstreamer pipeline option which will make it just as fast, but I don't know what it is. Please tell me everything wrong with the command above and help make it better :)

aryanakh commented 2 months ago

Hi All, using the latest version (1.9.2) of go2rtc, I have managed to use the 2 way talk functionality in QuantumEntangledAndy/neolink with the exec source in go2rtc. Instead of approx 3 seconds, my 2 way audio delay is close to the reolink app now.

Here is the script I'm using (neolink_talk.sh):

#!/usr/bin/env bash

ffmpeg -fflags nobuffer -f alaw -ar 8000 -i - -f wav - | ./neolink talk Doorbell -c config.toml --volume=1.0 -m -i "fdsrc fd=0"

go2rtc.yaml:

streams:
  doorbell_sub:
  - ffmpeg:http://doorbell_ip/flv?port=1935&app=bcs&stream=channel0_sub.bcs&user=admin&password=PASS#video=copy#audio=opus
  - exec:/config/neolink/neolink_talk.sh#backchannel=1

I'm using it now with frigate, but that involves installing gstreamer, etc into the docker container, as well as using the latest go2rtc instead of the included v1.8.4. An easier way to test is using Alex's WebRTC card/integration and setting media: video,audio,microphone.

The ffmpeg pipe into neolink is faster than using fdsrc fd=0 ! audio/x-alaw,rate=8000,channels=1 in the neolink command from my testing. I'm sure there is a gstreamer pipeline option which will make it just as fast, but I don't know what it is. Please tell me everything wrong with the command above and help make it better :)

This is great news! Just so I am clear on what I need to do.... Can you give some instructions in sequence?

  1. Install gsteamer + latest go2rtc and other requirements into frigate docker
  2. Setup Neolink Docker? Or simply use the neolink script within frigate?
  3. Adjust frigate go2rtc steam and use MQTT?
bezmi commented 2 months ago

This is great news! Just so I am clear on what I need to do.... Can you give some instructions in sequence?

  1. Follow the steps in the frigate documentation to use the latest go2rtc
  2. Install QuantumEntangledAndy/neolink, inside the frigate docker container making sure to enter the container and install the dependencies. I put the neolink executable and config file in the /config/neolink directory.
  3. Add your camera config to /config/neolink/config.toml file
  4. Create a script /config/neolink/neolink_talk.sh and paste the contents from my initial comment.
  5. Adjust the frigate go2rtc doorbell config to use neolink_talk.sh for the backchannel audio - it's essentially identical to the go2rtc.yaml config from my initial comment, but in the frigate config.yaml.

Edit: I originally posted another comment with more detailed instructions, but I've moved it to the frigate discussions.

luisiam commented 2 months ago

This is great news! Just so I am clear on what I need to do.... Can you give some instructions in sequence?

  1. Follow the steps in the frigate documentation to use the latest go2rtc
  2. Install QuantumEntangledAndy/neolink, inside the frigate docker container making sure to enter the container and install the dependencies. I put the neolink executable and config file in the /config/neolink directory.
  3. Add your camera config to /config/neolink/config.toml file
  4. Create a script /config/neolink/neolink_talk.sh and paste the contents from my initial comment.
  5. Adjust the frigate go2rtc doorbell config to use neolink_talk.sh for the backchannel audio - it's essentially identical to the go2rtc.yaml config from my initial comment, but in the frigate config.yaml.

Edit: I originally posted another comment with more detailed instructions, but I've moved it to the frigate discussions.

I am getting this error in go2rtc log

2024-06-12 20:59:52.694773170  20:59:52.694 WRN github.com/AlexxIT/go2rtc/internal/streams/producer.go:171 > error="exit status 127" url=exec:/config/neolink/doorbell.sh#backchannel=1
bezmi commented 2 months ago

Did you make the script executable? chmod +x /config/neolink/neolink_talk.sh, forgot to add that! Make sure that the script is accessible at that path and can be launched from a shell inside the frigate container.

luisiam commented 2 months ago

Did you make the script executable? chmod +x /config/neolink/neolink_talk.sh, forgot to add that!

Yes I did. When I run the script directly from CLI it seems working without throwing any error

bezmi commented 2 months ago

Yes I did. When I run the script directly from CLI it seems working without throwing any error.

If you do the following inside the frigate docker container to play a test MP3, does it work?

cd /config/neolink

./neolink talk Doorbell --config config.toml -m -i "souphttpsrc location=https://rhasspy.github.io/piper-samples/samples/en/en_US/lessac/high/speaker_0.mp3"