blakeblackshear / frigate

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

[Camera Support]: Amcrest AD110 & AD410 #9693

Closed sokol99 closed 7 months ago

sokol99 commented 7 months ago

Describe the problem you are having

Hi, I have been using frigate with different Amcrest devices successfully but have run into an issue with both of their doorbell models - AD110 and AD410.

Oddly, when I activate frigate (via docker) and start pulling in the rtsp video feed on either model this causes the doorbell chime function to stop working. Meaning I push the button and there is neither a 'ring' from the Amcrest speaker nor a ring of the physical chime in the house. As soon as I stop frigate it returns to proper functioning. This is true for at least frigate versions 0.12.1-367D724 & 0.13.1-34FB1C2 which I again tested today with an AD110 camera. (Called 'front_door' in the config below.)

I have a support ticket into Amcrest as well (518578) that is under investigation.

Again, oddly, I can pull the rtsp feed via other applications such as the Amcrest App, Onvier Android App and VLC without impacting the function of the doorbell/chime.

..I came to this conclusion after tearing my house apart thinking it was a power issue... :)

I will update this ticket if there is a resolution from the Amcrest side but wanted to raise awareness.

Version

0.13.1-34FB1C2

Frigate config file

#mqtt:
#  enabled: False
mqtt:
  host: tron.localdomain
  user: bot
  password: xxxxxx

detectors:
  coral:
    type: edgetpu
    device: usb

#detectors:
#  ov:
#    type: openvino
#    device: GPU
#    model:
#      path: /openvino-model/ssdlite_mobilenet_v2.xml

#model:
#  width: 300
#  height: 300
#  input_tensor: nhwc
#  input_pixel_format: bgr
#  labelmap_path: /openvino-model/coco_91cl_bkgr.txt

objects:
  track:
    - person
    - car
    - bicycle
    - motorcycle
    - cat
    - dog

birdseye:
  enabled: True
  mode: continuous

record:
  enabled: True
  retain:
    days: 3
    mode: motion
  events:
    retain:
      default: 14
      mode: active_objects

snapshots:
  enabled: True
  retain:
    default: 30

ffmpeg:
  global_args: '-hide_banner -loglevel info' 
  hwaccel_args: preset-intel-qsv-h264
#  output_args:
#    record: preset-record-generic-audio-aac

#ffmpeg:
#  global_args: '-hide_banner -loglevel info' 
#  hwaccel_args: 
#    - '-hwaccel'
#    - qsv
#    - '-qsv_device'
#    _gpu_selector.get_selected_gpu()
##    - /dev/dri/renderD128
#    - '-hwaccel_output_format'
#    - qsv
#    - '-c:v'
#    - h264_qsv
#  input_args: 
#    - -avoid_negative_ts 
#    - make_zero 
#    - -fflags 
#    - nobuffer 
#    - -flags 
#    - low_delay 
#    - -strict 
#    - experimental 
#    - -fflags 
#    - +genpts+discardcorrupt 
#    - -rw_timeout 
#    - '5000000' 
#    - -use_wallclock_as_timestamps 
#    - '1'
  output_args:
   record: preset-record-generic-audio-aac

######################
#       go2trc       #
######################
go2rtc:
#  rtsp:
#    username: "user"
#    password: "xxxxx"
  streams:
    eye:
      - rtsp://ubnt:xxxx@192.168.1.5:554/s0
      - "ffmpeg:eye#audio=opus"
    front_door:
      - rtsp://admin:xxxxxx@192.168.1.18:554/cam/realmonitor?channel=1&subtype=0&authbasic=64
      - "ffmpeg:front_door#audio=opus"
    deck:
      - rtsp://admin:xxxxx@192.168.1.19:554/cam/realmonitor?channel=1&subtype=0&authbasic=64
      - "ffmpeg:deck#audio=opus"
    side_door:
      - rtsp://admin:xxxxxxx@192.168.1.26:554/cam/realmonitor?channel=1&subtype=0&authbasic=64
      - "ffmpeg:side_door#audio=opus"
    bob:
      - rtsp://admin:xxxxxx5@192.168.1.28:554/cam/realmonitor?channel=1&subtype=0&authbasic=64
      - "ffmpeg:side_door#audio=opus"

  webrtc: #Note: I didn't set up external port forwarding for webrtc since I don't really need it externally.  Phone browsers can just use mse. 
    candidates:
      - 192.168.1.77:8555
      - stun:8555

######################
#       CAMERAS      #
######################

cameras:
  eye:
    ffmpeg:
      inputs:
#        - path: rtsp://ubnt:xxxx@192.168.1.5:554/s0
        - path: rtsp://127.0.0.1:8554/eye
          input_args: preset-rtsp-restream
          roles:
            - detect                                               
    detect:
      width: 1920
      height: 1080
      fps: 5
    motion:
      mask:
       - 1920,0,1920,331,1435,401,981,367,0,458,0,0
       - 324,542,233,617,252,710,438,804,589,778,659,520,522,421,373,458
       - 1482,496,1416,581,1405,667,1439,741,1503,802,1584,818,1688,822,1710,786,1774,724,1791,691,1837,648,1840,572,1831,509,1757,423,1631,367

  front_door:
    ffmpeg:
      inputs:
#        - path: rtsp://admin:xxxxx@192.168.1.18:554/cam/realmonitor?channel=1&subtype=0&authbasic=64
        - path: rtsp://127.0.0.1:8554/front_door
          input_args: preset-rtsp-restream
          roles:
            - detect
    detect:
      width: 1280 #1920
      height: 720 #1080
      fps: 5

  deck:
    ffmpeg:
      inputs:
#        - path: rtsp://admin:xxxxx@192.168.1.19:554/cam/realmonitor?channel=1&subtype=0&authbasic=64
        - path: rtsp://127.0.0.1:8554/deck
          input_args: preset-rtsp-restream
          roles: 
            - detect
    detect:
      width: 1280 #1920
      height: 720 #1080
      fps: 5

  side_door:
    ffmpeg:
      inputs:
#        - path: rtsp://admin:xxxxxx@192.168.1.26:554/cam/realmonitor?channel=1&subtype=0&authbasic=64
        - path: rtsp://127.0.0.1:8554/side_door
          input_args: preset-rtsp-restream
          roles:
            - detect
#          hwaccel_args: preset-vaapi #preset-intel-qsv-h265
    detect:
      width: 1280 #1920
      height: 720 #1080
      fps: 5

    motion:
      mask:
        - 1280,720,823,720,835,720,853,0,1280,0

    objects:
      filters:
        person:
          mask:  
            - 265,720,637,720,641,206,282,206
            - 0,0,476,0,714,0,270,427,83,720,0,720
  bob:
    ffmpeg:
      inputs:
#        - path: rtsp://admin:xxxxxxx@192.168.1.19:554/cam/realmonitor?channel=1&subtype=0&authbasic=64
        - path: rtsp://127.0.0.1:8554/bob
          input_args: preset-rtsp-restream
          roles:
            - detect
    detect:
      width: 1280 #1920
      height: 720 #1080
      fps: 5
    birdseye:
      enabled: False

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
2024-02-05 17:04:20.821086453  [INFO] Preparing Frigate...
2024-02-05 17:04:20.822680235  [INFO] Starting NGINX...
s6-rc: info: service legacy-services successfully started
2024-02-05 17:04:20.827217092  [INFO] Preparing new go2rtc config...
2024-02-05 17:04:20.834538277  [INFO] Starting Frigate...
2024-02-05 17:04:21.112170076  [INFO] Not injecting WebRTC candidates into go2rtc config as it has been set manually
2024-02-05 17:04:21.116013536  2024/02/05 17:04:21 [error] 145#145: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.1, server: , request: "GET /live/webrtc/api/ws?src=front_door HTTP/1.1", upstream: "http://127.0.0.1:1984/api/ws?src=front_door", host: "eye.my.domain"
2024-02-05 17:04:21.116125913  192.168.1.1 - user [05/Feb/2024:17:04:21 -0700] "GET /live/webrtc/api/ws?src=front_door HTTP/1.1" 502 559 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "104.200.131.246"
2024-02-05 17:04:21.154516370  [INFO] Starting go2rtc...
2024-02-05 17:04:21.260908570  17:04:21.260 INF go2rtc version 1.8.4 linux/amd64
2024-02-05 17:04:21.261273571  17:04:21.261 INF [rtsp] listen addr=:8554
2024-02-05 17:04:21.261287342  17:04:21.261 INF [api] listen addr=:1984
2024-02-05 17:04:21.261821201  17:04:21.261 INF [webrtc] listen addr=:8555
2024-02-05 17:04:21.319534098  2024/02/05 17:04:21 [error] 146#146: *3 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.1, server: , request: "GET /api/labels?camera=front_door HTTP/1.1", upstream: "http://127.0.0.1:5001/labels?camera=front_door", host: "eye.my.domain", referrer: "https://eye.my.domain/cameras/front_door"
2024-02-05 17:04:21.319538106  2024/02/05 17:04:21 [error] 147#147: *4 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.1, server: , request: "GET /api/config HTTP/1.1", upstream: "http://127.0.0.1:5001/config", host: "eye.my.domain", referrer: "https://eye.my.domain/cameras/front_door"
2024-02-05 17:04:21.319541585  192.168.1.1 - user [05/Feb/2024:17:04:21 -0700] "GET /api/config HTTP/1.1" 502 559 "https://eye.my.domain/cameras/front_door" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "104.200.131.246"
2024-02-05 17:04:21.319572023  192.168.1.1 - user [05/Feb/2024:17:04:21 -0700] "GET /api/labels?camera=front_door HTTP/1.1" 502 559 "https://eye.my.domain/cameras/front_door" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "104.200.131.246"
2024-02-05 17:04:22.031680142  [2024-02-05 17:04:22] frigate.app                    INFO    : Starting Frigate (0.13.1-34fb1c2)
2024-02-05 17:04:22.093976217  [2024-02-05 17:04:22] peewee_migrate.logs            INFO    : Starting migrations
2024-02-05 17:04:22.101923202  [2024-02-05 17:04:22] peewee_migrate.logs            INFO    : There is nothing to migrate
2024-02-05 17:04:22.102003005  [2024-02-05 17:04:22] frigate.app                    INFO    : Recording process started: 444
2024-02-05 17:04:22.104144026  [2024-02-05 17:04:22] frigate.app                    INFO    : go2rtc process pid: 89
2024-02-05 17:04:22.130736406  [2024-02-05 17:04:22] detector.coral                 INFO    : Starting detection process: 454
2024-02-05 17:04:24.773255364  [2024-02-05 17:04:22] frigate.app                    INFO    : Output process started: 456
2024-02-05 17:04:24.773664419  [2024-02-05 17:04:22] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as usb
2024-02-05 17:04:24.774659803  [2024-02-05 17:04:22] frigate.app                    INFO    : Camera processor started for eye: 466
2024-02-05 17:04:24.774967866  [2024-02-05 17:04:22] frigate.app                    INFO    : Camera processor started for front_door: 467
2024-02-05 17:04:24.775274470  [2024-02-05 17:04:22] frigate.app                    INFO    : Camera processor started for deck: 470
2024-02-05 17:04:24.775672097  [2024-02-05 17:04:22] frigate.app                    INFO    : Camera processor started for side_door: 473
2024-02-05 17:04:24.776000524  [2024-02-05 17:04:22] frigate.app                    INFO    : Camera processor started for bob: 475
2024-02-05 17:04:24.776316404  [2024-02-05 17:04:22] frigate.app                    INFO    : Capture process started for eye: 478
2024-02-05 17:04:24.776703897  [2024-02-05 17:04:22] frigate.app                    INFO    : Capture process started for front_door: 495
2024-02-05 17:04:24.777140140  [2024-02-05 17:04:22] frigate.app                    INFO    : Capture process started for deck: 499
2024-02-05 17:04:24.777351805  [2024-02-05 17:04:22] frigate.app                    INFO    : Capture process started for side_door: 504
2024-02-05 17:04:24.777652106  [2024-02-05 17:04:22] frigate.app                    INFO    : Capture process started for bob: 509
2024-02-05 17:04:24.783257164  [2024-02-05 17:04:24] frigate.detectors.plugins.edgetpu_tfl INFO    : TPU found
2024-02-05 17:04:25.740223245  192.168.1.1 - myuser [05/Feb/2024:17:04:25 -0700] "GET /live/webrtc/api/ws?src=front_door HTTP/1.1" 101 1045181 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "104.200.131.246"
2024-02-05 17:04:25.740786948  192.168.1.1 - user [05/Feb/2024:17:04:25 -0700] "GET /ws HTTP/1.1" 101 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "104.200.131.246"
2024-02-05 17:04:30.821505856  [INFO] Starting go2rtc healthcheck service...

FFprobe output from your camera

[user@mybox ~]$ ffprobe rtsp://admin:xxxxx@192.168.1.18
ffprobe version n6.1.1 Copyright (c) 2007-2023 the FFmpeg developers
  built with gcc 13.2.1 (GCC) 20230801
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-frei0r --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libharfbuzz --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librav1e --enable-librsvg --enable-librubberband --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpl --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-version3 --enable-vulkan
  libavutil      58. 29.100 / 58. 29.100
  libavcodec     60. 31.102 / 60. 31.102
  libavformat    60. 16.100 / 60. 16.100
  libavdevice    60.  3.100 / 60.  3.100
  libavfilter     9. 12.100 /  9. 12.100
  libswscale      7.  5.100 /  7.  5.100
  libswresample   4. 12.100 /  4. 12.100
  libpostproc    57.  3.100 / 57.  3.100
Input #0, rtsp, from 'rtsp://admin:xxxxxx@192.168.1.18':
  Metadata:
    title           : Media Server
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: h264 (Baseline), yuv420p(progressive), 2560x1920, 15 fps, 100 tbr, 90k tbn
  Stream #0:1: Audio: aac (LC), 8000 Hz, mono, fltp

Frigate stats

No response

Operating system

Other Linux

Install method

Docker CLI

Coral version

USB

Network connection

Wired

Camera make and model

Amcrest AD110

Any other information that may be helpful

I am running on Arch linux.

NickM-27 commented 7 months ago

Need #backchannel=0 to the end of the URLs in go2rtc

sokol99 commented 7 months ago

Whoa! I'm blown away! That actually fixed it! Thank you!

And now I have to ask.. Did I miss that somewhere and should I let Amcrest know it is a non-issue?

Thanks @NickM-27!

NickM-27 commented 7 months ago

Yes it's just because it uses two way audio by default.

NickM-27 commented 7 months ago

It's in the go2rtc docs