koush / scrypted

Scrypted is a high performance video integration and automation platform
https://scrypted.app
Other
4.14k stars 248 forks source link

DoorBird devices stop responding to live stream requests after a few days #757

Open michaelyork opened 1 year ago

michaelyork commented 1 year ago

I've observed this behavior across 3 different locations/installations and 5 separate DoorBird units. It seems that after some point (without anything odd in the plugin logs), the live camera stream stops working. Live streams/HKSV all stop operating at that point.

Restarting the plugin instantly resolves the issue. Nothing shows in "Pending Requests" when the plugin is in this bad state.

Let me know what else I can share to help debug!

cc @nanosonde, original plugin developer.

nanosonde commented 1 year ago

@michaelyork I can confirm this behavior. I also do not see any issues in the logs.

Could you please try it again with disabled prebuffering? This way a new connection is always created when requested.

I assume that the long running prebuffering ffmpeg has an issue when the incoming audio is not available from the Doorbird for some reason. Maybe we have to implement our own HTTP audio receiver here and then make this available to ffmpeg to have more control. However, it might be enough to add some timeout options to ffmpeg to make sure that it terminates as soon as possible if there is an issue with the HTTP audio stream.

michaelyork commented 1 year ago

Will test now, thanks @nanosonde!

I will say, the instant load times for prebuffered streams are really fantastic. Would love to see a solution that can continue to support them. :)

nanosonde commented 1 year ago

I used to use the following ffmpeg options in another project where I had an MJPEG stresm via the ffmpeg http module:

ffmpeg -timeout 2000 -reconnect 1 -reconnect_at_eof 1 -reconnect_streamed 1 -reconnect_on_network_error 1 -reconnect_on_http_error 1 -reconnect_delay_max 60

@koush Do you support these in the ffmpeg version in scrypted? I could try to set these options for the audio http stream.

koush commented 1 year ago

not sure, check in CLI in scrypted terminal. using ffmpeg prebuilt from a npm repo, which I think packages standard ffmepeg static libs.

Vicelow commented 1 year ago

Hi there, I just installed the the plugin for my Doorbird D1100E and am absolutely loving it - big thumbs up! I haven't come across the above described issue yet (hopefully won't) but just wanted to suggest to also include the doorbird relay as a subdevice in HK (similarly as the Homebridge plugin offers). Other than that, HKSV, two-way audio and speed is just amazing, many thanks for the great work!

rabh commented 1 year ago

Absolutely loving the plugin, I've been waiting years for this.

I've also just encountered the issue, which gets resolved after a restart of Scrypted. Happy to help with logs or any debug if its needed. I've not tried disabling pre-buffering yet.

t1ll commented 1 year ago

can also confirm this behaviour

djfanatix commented 1 year ago

I also have this issue, I will now try with prebuffering off

t1ll commented 12 months ago

@djfanatix any success with prebuffering turned off?

marbon87 commented 9 months ago

I have the same problem and need to restart the Doorbird plugin every 4-6 hours. Has anyone solved this problem?

digitalentropy commented 4 months ago

I'm also observing the problem and have not been able to find a solution besides restarting the plugin manually.

marbon87 commented 4 months ago

My workaround is to restart scrypted automatically if the snapshot-Uri for the DoorBird camera does not respond within 2s seconds. Would be cool if i could restart the DoorBird plugin only. or if the plugin works stable ☺️

Vicelow commented 4 months ago

Could you share how you configured this automatic restart? Thanks!

marbon87 commented 4 months ago

You need to enable the webhook plugin for the doorbird camera.

I am using a home assistant sensor to call the api with this sensor template:

- platform: rest
  name: Camera Door Snapshot
  method: GET
  resource: "http://192.168.5.2:11080/endpoint/@scrypted/webhook/public/33/xxxxxxxxxxxxxxx/takePicture"
  timeout: 3  
  scan_interval: 60
  value_template: true

and this is my Home Assistant automation:

alias: Restart Scrypted
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.camera_doorbird_snapshot
    to: unavailable
condition: []
action:
  - service: hassio.addon_restart
    data:
      addon: 09e60fb6_scrypted
mode: single
digitalentropy commented 4 months ago

What's the advantage of using the Doorbird plugin over ONVIF? I just tried switching to ONVIF a few days ago and have not had any of the hanging issues that appear to be present with the Doorbird plugin.

marbon87 commented 4 months ago

ONVIF doesn‘t support two-way audio, does it?

nanosonde commented 4 months ago

To my knowledge the current doorbird firmware does not support ONVIF Profile-T type video doorbells as it does not support RTSP audio backchannel.