blakeblackshear / frigate

NVR with realtime local object detection for IP cameras
https://frigate.video
MIT License
17.99k stars 1.64k forks source link

[Camera Support]: Amcrest AD410 stops working as doorbell when connected to Frigate via go2rtc #7093

Closed jay-kub closed 1 year ago

jay-kub commented 1 year ago

Describe the problem you are having

TLDR: after starting Frigate my Amcrest AD410 Doorbell goes into "intercom" mode and no longer functions as a doorbell.

After starting Frigate the Amcrest AD410 stops operating as a doorbell. Pushing the doorbell button does not send a notification to my phone, it does not register a ringing sound to the person at the doorbell, and it does not cause my mechanical doorbell chime to ring. Frigate does receive the rtsp feed from the doorbell camera and functions normally.

After Frigate completes it startup process, the LED status light on the AD410 changes from solid green to solid blue. When the LED is solid blue all doorbell functions listed above cease entirely. When I shut down the Frigate docker container, the LED immediately switches back to solid green and all doorbell functions are restored.

I was unable to find any documentation for the AD410 status lights, but it appears that solid blue LED indicates that the doorbell is in "call" or "intercom" mode. I tested this by shutting down Frigate, ringing the doorbell, and answering the video call notification received via Amcrest. When the call begins the LED status light changes to solid blue and pushing the doorbell button does not elicit any response.

My guess is that the connection from Frigate via go2rtc/rtsp is triggering the AD410 to believe it is in call/intercom mode. When I connect the AD410 to Surveillance Station via rtsp I do not run into the same issues. I'm not sure if this is truly a Frigate issue or if it's go2rtc/Synology, but for what it's worth I did open a ticket with Amcrest who determined that the device needed to be RMAd. Shortly thereafter I came to realize the issue was tied to Frigate. As a workaround I have setup Surveillance Station to receive the rtsp feed and am passing that feed through to Frigate.

Version

0.12.1-367D724

Frigate config file

mqtt:
  host: <REDACTED>
  user: <REDACTED>
  password: <REDACTED>

detectors:
  coral:
    type: edgetpu
    device: usb

go2rtc:
  streams:
    backyard: 
      - rtsp://<REDACTED>/cam/realmonitor?channel=1&subtype=0&authbasic=64
    frontyard:
      - rtsp://<REDACTED>/cam/realmonitor?channel=1&subtype=0&authbasic=64
    doorbell:
      - rtsp://<REDACTED>/cam/realmonitor?channel=1&subtype=0&authbasic=64
cameras:
  backyard: 
    ffmpeg:
      inputs:
        - path: rtsp://<REDACTED>/backyard
          roles:
            - record
          input_args: preset-rtsp-restream-low-latency
        - path: rtsp://<REDACTED>/cam/realmonitor?channel=1&subtype=1&authbasic=64
          roles:
            - detect
    detect:
      width: 640
      height: 480
      fps: 5
    motion:
      mask:
        - 640,0,640,134,365,50,157,34,0,54,0,0
        - 640,480,505,480,640,0
        - 47,333,92,480,0,480,0,60
    mqtt:
      timestamp: False
      bounding_box: False
      crop: True
      quality: 100
      height: 500

  frontyard: 
    ffmpeg:
      inputs:
        - path: rtsp://<REDACTED>/frontyard
          input_args: preset-rtsp-restream-low-latency
          roles:
            - record
        - path: rtsp://<REDACTED>/cam/realmonitor?channel=1&subtype=1&authbasic=64
          roles:
            - detect
    detect:
      width: 640 
      height: 480
      fps: 5
    motion:
      mask:
        - 0,0,38,0,57,199,99,218,89,480,0,480
        - 0,0,640,0,445,68,0,236
        - 640,480,536,480,570,226,565,0,640,0
    zones:
      zone2:
        coordinates: 221,159,48,256,164,480,532,480,560,266
    mqtt:
      timestamp: False
      bounding_box: False
      crop: True
      quality: 100
      height: 500

  doorbell: 
    ffmpeg:
      inputs:
        - path: rtsp://<REDACTED>/doorbell
          input_args: preset-rtsp-restream-low-latency
          roles:
            - record
        - path: rtsp://<REDACTED>/Sms=1.unicast
          roles:
            - detect
    detect:
      width: 640
      height: 480
      fps: 5
    motion:
      mask:
        - 0,284,284,320,640,313,640,0,0,0
    zones:
      zone1:
        coordinates: 558,480,508,348,110,349,87,480
    mqtt:
      timestamp: False
      bounding_box: False
      crop: True
      quality: 100
      height: 500

objects:
  track:
    - person
    - dog
    - cat
    - bird
    - car

snapshots:
  enabled: true
  timestamp: false
  bounding_box: true
  retain:
    default: 90

record:
  enabled: True
  retain:
    days: 90
    mode: motion

ffmpeg:
  hwaccel_args: -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format yuv420p
  output_args:
    record: preset-record-generic-audio-aac

Relevant log output

s6-rc: info: service s6rc-fdholder: starting
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service s6rc-fdholder successfully started
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service log-prepare: starting
s6-rc: info: service log-prepare successfully started
s6-rc: info: service nginx-log: starting
s6-rc: info: service go2rtc-log: starting
s6-rc: info: service frigate-log: starting
s6-rc: info: service nginx-log successfully started
s6-rc: info: service go2rtc-log successfully started
s6-rc: info: service go2rtc: starting
s6-rc: info: service frigate-log successfully started
s6-rc: info: service go2rtc successfully started
s6-rc: info: service go2rtc-healthcheck: starting
s6-rc: info: service frigate: starting
s6-rc: info: service go2rtc-healthcheck successfully started
s6-rc: info: service frigate successfully started
s6-rc: info: service nginx: starting
s6-rc: info: service nginx successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
2023-07-08 00:40:30.161310430  [INFO] Starting Frigate...
2023-07-08 00:40:30.161962036  [INFO] Preparing go2rtc config...
2023-07-08 00:40:30.162312398  [INFO] Starting NGINX...
2023-07-08 00:40:30.577984481  [WARN] Using go2rtc binary from '/config/go2rtc' instead of the embedded one
2023-07-08 00:40:30.577992042  [INFO] Starting go2rtc...
2023-07-08 00:40:30.705557265  00:40:30.705 INF go2rtc version 1.5.0 linux/amd64
2023-07-08 00:40:30.705832424  00:40:30.705 INF [api] listen addr=:1984
2023-07-08 00:40:30.706180408  00:40:30.706 INF [rtsp] listen addr=:8554
2023-07-08 00:40:30.706567621  00:40:30.706 INF [srtp] listen addr=:8443
2023-07-08 00:40:30.706792638  00:40:30.706 INF [webrtc] listen addr=:8555/tcp
2023-07-08 00:40:31.721467085  [2023-07-08 00:40:31] frigate.app                    INFO    : Starting Frigate (0.12.1-367d724)
2023-07-08 00:40:31.777125030  [2023-07-08 00:40:31] peewee_migrate                 INFO    : Starting migrations
2023-07-08 00:40:31.783788645  [2023-07-08 00:40:31] peewee_migrate                 INFO    : There is nothing to migrate
2023-07-08 00:40:31.805706023  [2023-07-08 00:40:31] frigate.app                    INFO    : Output process started: 289
2023-07-08 00:40:31.807179473  [2023-07-08 00:40:31] detector.coral                 INFO    : Starting detection process: 288
2023-07-08 00:40:31.815375693  [2023-07-08 00:40:31] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as usb
2023-07-08 00:40:34.429684135  [2023-07-08 00:40:31] frigate.app                    INFO    : Camera processor started for backyard: 296
2023-07-08 00:40:34.430864373  [2023-07-08 00:40:31] frigate.app                    INFO    : Camera processor started for frontyard: 298
2023-07-08 00:40:34.430999523  [2023-07-08 00:40:31] frigate.app                    INFO    : Camera processor started for doorbell: 299
2023-07-08 00:40:34.431134450  [2023-07-08 00:40:31] frigate.app                    INFO    : Capture process started for backyard: 301
2023-07-08 00:40:34.431237313  [2023-07-08 00:40:31] frigate.app                    INFO    : Capture process started for frontyard: 302
2023-07-08 00:40:34.431366124  [2023-07-08 00:40:31] frigate.app                    INFO    : Capture process started for doorbell: 304
2023-07-08 00:40:34.431577527  [2023-07-08 00:40:34] frigate.util                   ERROR   : Unable to poll intel GPU stats: Failed to initialize PMU! (Invalid argument)
2023-07-08 00:40:34.431581016  
2023-07-08 00:40:34.436923395  [2023-07-08 00:40:34] frigate.detectors.plugins.edgetpu_tfl INFO    : TPU found
2023-07-08 00:40:37.497087648  172.21.0.1 - - [08/Jul/2023:00:40:37 -0600] "GET /api/stats HTTP/1.1" 200 2773 "-" "HomeAssistant/2023.7.1 aiohttp/3.8.4 Python/3.11" "-"
2023-07-08 00:40:40.130182803  [INFO] Starting go2rtc healthcheck service...

FFprobe output from your camera

[rtsp @ 0x5597e1ca7140] method SETUP failed: 461 Unsupported transport
Input #0, rtsp, from 'rtsp://127.0.0.1:8554/doorbell':
  Metadata:
    title           : go2rtc/1.5.0
  Duration: N/A, start: 0.070000, bitrate: N/A
  Stream #0:0: Video: h264 (Baseline), yuv420p(progressive), 2560x1920, 15 fps, 100 tbr, 90k tbn
root@frigate:/opt/frigate# ^C
root@frigate:/opt/frigate#

Frigate stats

{"backyard":{"camera_fps":5.1,"capture_pid":301,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":314,"pid":296,"process_fps":5.1,"skipped_fps":0.0},"cpu_usages":{"%Cpu(s):":{"cpu":"id,","mem":"0.3"},"1":{"cpu":"0.0","mem":"0.0"},"1120":{"cpu":"0.0","mem":"0.0"},"116":{"cpu":"0.0","mem":"0.1"},"1178":{"cpu":"0.0","mem":"0.0"},"1194":{"cpu":"0.0","mem":"0.0"},"1205":{"cpu":"0.0","mem":"0.0"},"1209":{"cpu":"0.3","mem":"0.0"},"134":{"cpu":"0.0","mem":"0.0"},"135":{"cpu":"0.0","mem":"0.0"},"136":{"cpu":"0.0","mem":"0.0"},"137":{"cpu":"0.0","mem":"0.0"},"15":{"cpu":"0.0","mem":"0.0"},"17":{"cpu":"0.0","mem":"0.0"},"24":{"cpu":"0.0","mem":"0.0"},"25":{"cpu":"0.0","mem":"0.0"},"26":{"cpu":"0.0","mem":"0.0"},"27":{"cpu":"0.0","mem":"0.0"},"28":{"cpu":"0.0","mem":"0.0"},"281":{"cpu":"0.0","mem":"0.3"},"287":{"cpu":"0.3","mem":"0.1"},"288":{"cpu":"0.0","mem":"0.5"},"289":{"cpu":"0.7","mem":"0.4"},"29":{"cpu":"0.0","mem":"0.0"},"296":{"cpu":"0.3","mem":"0.4"},"297":{"cpu":"0.0","mem":"0.1"},"298":{"cpu":"0.3","mem":"0.4"},"299":{"cpu":"0.7","mem":"0.4"},"30":{"cpu":"0.0","mem":"0.0"},"300":{"cpu":"0.0","mem":"0.1"},"301":{"cpu":"0.7","mem":"0.4"},"302":{"cpu":"0.7","mem":"0.4"},"304":{"cpu":"1.0","mem":"0.4"},"31":{"cpu":"0.0","mem":"0.0"},"311":{"cpu":"1.3","mem":"0.1"},"312":{"cpu":"0.7","mem":"0.1"},"313":{"cpu":"0.0","mem":"0.1"},"314":{"cpu":"1.0","mem":"0.2"},"319":{"cpu":"1.0","mem":"0.1"},"32":{"cpu":"0.0","mem":"0.0"},"322":{"cpu":"0.0","mem":"0.1"},"323":{"cpu":"1.0","mem":"0.1"},"324":{"cpu":"1.0","mem":"0.1"},"40":{"cpu":"0.0","mem":"0.0"},"42":{"cpu":"0.0","mem":"0.0"},"582":{"cpu":"0.0","mem":"0.0"},"80":{"cpu":"0.0","mem":"0.0"},"81":{"cpu":"0.0","mem":"0.0"},"82":{"cpu":"0.0","mem":"0.0"},"86":{"cpu":"10.6","mem":"0.1"},"93":{"cpu":"0.0","mem":"0.0"},"94":{"cpu":"9.0","mem":"0.9"},"MiB":{"cpu":"8726.7","mem":"avail"},"PID":{"cpu":"%CPU","mem":"%MEM"},"Tasks:":{"cpu":"stopped,","mem":"0"},"top":{"cpu":"users,","mem":"load"}},"detection_fps":0.0,"detectors":{"coral":{"detection_start":0.0,"inference_speed":9.12,"pid":288}},"doorbell":{"camera_fps":5.0,"capture_pid":304,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":311,"pid":299,"process_fps":5.0,"skipped_fps":0.0},"frontyard":{"camera_fps":5.0,"capture_pid":302,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":312,"pid":298,"process_fps":5.0,"skipped_fps":0.0},"gpu_usages":{"error-gpu":{"gpu":-1,"mem":-1}},"service":{"last_updated":1688799071,"latest_version":"0.12.1","storage":{"/dev/shm":{"free":131.2,"mount_type":"tmpfs","total":134.2,"used":3.0},"/media/frigate/clips":{"free":6327149.3,"mount_type":"btrfs","total":11508794.4,"used":5181645.1},"/media/frigate/recordings":{"free":6327149.3,"mount_type":"btrfs","total":11508794.4,"used":5181645.1},"/tmp/cache":{"free":981.1,"mount_type":"tmpfs","total":1000.0,"used":18.9}},"temperatures":{},"uptime":640,"version":"0.12.1-367d724"}}

Operating system

Other Linux

Install method

Docker Compose

Coral version

USB

Network connection

Wired

Camera make and model

Amcrest AD410

Any other information that may be helpful

No response

NickM-27 commented 1 year ago

You need to add #backchannel=0to the end of the go2rtc stream for the doorbell to disable the two way talk connection

jay-kub commented 1 year ago

That worked! Thank you so much for the help and for everything you guys are doing to put this great project together.

lordbah commented 1 year ago

Where did you find that URL rtsp://REDACTED/Sms=1.unicast for the AD410? Or is that a go2rtc thing? My AD410 is always exceeding fps limit and putting out streams that Frigate/ffpmeg don't like (non-monotonous DTS and such).