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.27k stars 349 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
    }
  ]
}
dlarkinsPonderosa commented 4 weeks ago

Thanks @a-d-r-i-a-n-d ,

Is your config similar to this (assuming you are using the Frigate card?):

image

Config:

type: custom:frigate-card
cameras:
  - camera_entity: camera.outside_gate_doorbell_v1_1
    live_provider: go2rtc
    icon: mdi:gate
live:
  draggable: false
  zoomable: false
  controls:
    builtin: true
    next_previous:
      style: none
    thumbnails:
      mode: none
  layout:
    fit: contain
  auto_unmute: selected
  preload: false
  lazy_load: false
  transition_effect: none
  show_image_during_load: false
  microphone:
    always_connected: true
performance:
  features:
    animated_progress_indicator: false
  style:
    border_radius: false
    box_shadow: false
timeline:
  show_recordings: false
menu:
  style: overlay
  buttons:
    frigate:
      enabled: false
    cameras:
      enabled: false
    live:
      enabled: false
    snapshots:
      enabled: false
    clips:
      enabled: false
    media_player:
      enabled: false
    microphone:
      enabled: true
      priority: 60
      type: toggle
    mute:
      enabled: true
      priority: 55
    screenshot:
      enabled: false
    timeline:
      enabled: false
    fullscreen:
      icon: mdi:overscan
  alignment: right
  position: top
  button_size: 70

My mic button does nothing, should it toggle on and off? I'd have thought so.

My microphone icon looked like that (and did not work) when is was accessing home assistant locally (and therefore using HTTP and by IP). If I changed to using my external URL (HTTPS) it worked ok.

a-d-r-i-a-n-d commented 4 weeks ago

Indeed HTTPS is also a requirement for 2-way audio to work.

AlexxIT commented 3 weeks ago

Browsers disable mic for HTTP sites. This is default behaviour. Hass mobile app is also a browser.

vexersa commented 3 weeks ago

Browsers disable mic for HTTP sites. This is default behaviour. Hass mobile app is also a browser.

This makes sense, reverse proxy it is. Do you know if webrtc is required if SSL is present?

vexersa commented 3 weeks ago

Thanks @a-d-r-i-a-n-d , Is your config similar to this (assuming you are using the Frigate card?): image Config:

type: custom:frigate-card
cameras:
  - camera_entity: camera.outside_gate_doorbell_v1_1
    live_provider: go2rtc
    icon: mdi:gate
live:
  draggable: false
  zoomable: false
  controls:
    builtin: true
    next_previous:
      style: none
    thumbnails:
      mode: none
  layout:
    fit: contain
  auto_unmute: selected
  preload: false
  lazy_load: false
  transition_effect: none
  show_image_during_load: false
  microphone:
    always_connected: true
performance:
  features:
    animated_progress_indicator: false
  style:
    border_radius: false
    box_shadow: false
timeline:
  show_recordings: false
menu:
  style: overlay
  buttons:
    frigate:
      enabled: false
    cameras:
      enabled: false
    live:
      enabled: false
    snapshots:
      enabled: false
    clips:
      enabled: false
    media_player:
      enabled: false
    microphone:
      enabled: true
      priority: 60
      type: toggle
    mute:
      enabled: true
      priority: 55
    screenshot:
      enabled: false
    timeline:
      enabled: false
    fullscreen:
      icon: mdi:overscan
  alignment: right
  position: top
  button_size: 70

My mic button does nothing, should it toggle on and off? I'd have thought so.

My microphone icon looked like that (and did not work) when is was accessing home assistant locally (and therefore using HTTP and by IP). If I changed to using my external URL (HTTPS) it worked ok.

Thank you πŸ™

I will try and do this and update the thread if it works.

AlexxIT commented 3 weeks ago

Do you know if webrtc is required if SSL is present?

WebRTC can work on HTTP sites.

brdva commented 3 weeks ago

@Cytomax55 yes it’s working with the configuration above and the latest firmware from Reolink.

Hi @a-d-r-i-a-n-d, happy to find someone that made the 2-way audio work.... I'm planning to set this up in a few days, so since I started searching for this feature, I found a lot of users and some different tutorials and a lot of users stating that didn't work.... Which tutorial did you follow to get this working, and also which HTTPS/SSL configuration did you set?

Just to get a direction, thanks a lot

AlexxIT commented 3 weeks ago

You can skip HTTPS requirements for testing purpose https://stackoverflow.com/questions/52759992/how-to-access-camera-and-microphone-in-chrome-without-https

b0ddu commented 3 weeks ago

I'm able use the reolink doorbell flv with two way audio using go2rtc webrtc-camera card. Anyone successfully able to cast the video using notify on android/chromecast screens?

luisiam commented 3 weeks ago

I'm able use the reolink doorbell flv with two way audio using go2rtc webrtc-camera card. Anyone successfully able to cast the video using notify on android/chromecast screens?

I use dashcast that comes with webrtc camera integration and I can cast it to any nest hub or chromecast w/ google tv.

bagobones commented 2 weeks ago

I use PIPup on android TV and use Home Assistant to trigger a picture in picture feed when the doorbell rings. I am just using rtsp, I am not using FLV on any of my newer reolink devices.

AlexxIT commented 2 weeks ago

Reolink RTSP problem depends on device firmware. They know how to fix it. But the firmware upgrade process is laid out horribly. Only by contacting technical support.

bagobones commented 2 weeks ago

The current public firmware for the black wifi doorbell fully works over RTSP and has working two way

The duo2 poe also fully works over RTSP.

vexersa commented 2 weeks ago

The current public firmware for the black wifi doorbell fully works over RTSP and has working two way

The duo2 poe also fully works over RTSP.

Would it be possible to share your config please? πŸ™

I've tried many different configs and I just can't get the two way audio to work. I can hear the audio from the doorbell, but can't send audio back to it.

n3xus1 commented 2 weeks ago

The current public firmware for the black wifi doorbell fully works over RTSP and has working two way The duo2 poe also fully works over RTSP.

Would it be possible to share your config please? πŸ™

I've tried many different configs and I just can't get the two way audio to work. I can hear the audio from the doorbell, but can't send audio back to it.

This is my lovelace card config that works for me

type: custom:frigate-card
cameras:
  - camera_entity: camera.front_door
    engine: frigate
    live_provider: go2rtc
    icon: mdi:doorbell-video
    go2rtc:
      modes:
        - webrtc
live:
  transition_effect: slide
  microphone:
    always_connected: true
  controls:
    builtin: true
    title:
      mode: none
  show_image_during_load: false
  preload: true
  zoomable: false
  auto_mute: all
view:
  default: live
dimensions:
  aspect_ratio_mode: static
  aspect_ratio: '4:3'
menu:
  style: overlay
  buttons:
    microphone:
      enabled: true
      type: toggle
    frigate:
      enabled: false
    cameras:
      enabled: false
    substreams:
      enabled: false
    clips:
      enabled: true
    timeline:
      enabled: false
    mute:
      enabled: false
timeline:
  enabled: false
ltctceplrm commented 1 week ago

I've got 2 way audio working with the frigate lovelace card but when I try to play an audio file whether it's through webrtc or on the go2rtc server inside frigate (port 1984) it just doesn't work. This is what the logs say:

[api] POST /api/streams?dst=Doorbell&src=ffmpeg%3Ahttps%3A%2F%2Ffile-examples.com%2Fstorage%2Ffef44df12666d835ba71c24%2F2017%2F11%2Ffile_example_MP3_700KB.mp3%23audio%3Dpcma%23input%3Dfile 192.168.23.77:49967

[exec] run url=exec:ffmpeg -hide_banner -v error -re -i https://file-examples.com/storage/fef44df12666d835ba71c24/2017/11/file_example_MP3_700KB.mp3 -c:a pcm_alaw -ar:a 8000 -ac:a 1 -vn -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp rtsp://127.0.0.1:8554/5c672577da7911e16aaef7f4e26da2fc cmd=ffmpeg -hide_banner -v error -re -i https://file-examples.com/storage/fef44df12666d835ba71c24/2017/11/file_example_MP3_700KB.mp3 -c:a pcm_alaw -ar:a 8000 -ac:a 1 -vn -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp rtsp://127.0.0.1:8554/5c672577da7911e16aaef7f4e26da2fc

And chrome console gives

links.html?src=Doorbell:98 POST http://192.168.23.55:1984/api/streams?dst=Doorbell&src=ffmpeg%3Ahttps%3A%2F%2Ffile-examples.com%2Fstorage%2Ffef44df12666d835ba71c24%2F2017%2F11%2Ffile_example_MP3_700KB.mp3%23audio%3Dpcma%23input%3Dfile 500 (Internal Server Error)

Does anyone have an idea why it won't work?

Edit: I manually updated the go2rtc binary in frigate and now I can send an mp3 through this url: http://192.168.23.55:1984/api/ffmpeg?dst=Doorbell&file=https://file-examples.com/storage/fef44df12666d835ba71c24/2017/11/file_example_MP3_700KB.mp3 it looks like the format changed but it does work now.

The only thing I still need to get working is using webrtc as a media player in home assistant