blakeblackshear / frigate

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

[Camera Support]: Frigate is Crippling Dahua/Amcrest Doorbells #5764

Closed austindetzel closed 1 year ago

austindetzel commented 1 year ago

Describe the problem you are having

I am not sure why at the moment but I have spent several days troubleshooting and making sure it is a repeatable issue. Here are the doorbells I have tested on (They use the Dahua API hence the title) Amcrest AD110 and Amcrest AD410. The issue is when frigate is connected to the camera(s) the api seems to get locked up. Through there app I get "Someone else is answering the call", and trough the API I get bombarded with errors in the API calls as well as no ability to access the sensors such as the button. I initially though, it must be an issue with the firmware on the camera not working when there's a rtsp stream, but I was able to successfully operate the camera while vlc was streaming so that wasn't the issue. I then thought that maybe streaming audio through frigate was the issue, so I removed the audio in the frigate config with no luck. So it seems as if frigate is doing something in addition to just a rtsp stream?

Version

0.12.0-E8D8CC4

Frigate config file

# yaml-language-server: $schema=http://192.168.40.10:5000/api/config/schema.json

#logger:
  #logs:
    #frigate.record: debug

database:
  path: /config/frigate.db

mqtt:
  host: 192.168.40.10
  port: 1883

#detectors:
#  cpu1:
#    type: cpu
#    num_threads: 4

detectors:
  tensorrt:
    type: tensorrt
    device: 0 #This is the default, select the first GPU

model:
  path: /trt-models/yolov4-tiny-416.trt
  input_tensor: nchw
  input_pixel_format: rgb
  width: 416
  height: 416

motion:
  threshold: 20

record:
    enabled: True
    retain:
        days: 14
        mode: all
    events:
        retain:
            default: 18
            mode: active_objects 

detect:
  enabled: True

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

go2rtc:
  #log:
  #  level: "trace"
  streams:
    Front_Door: 
      - rtsp://admin:[redacted]@192.168.40.22/cam/realmonitor?channel=1&subtype=0
      - "ffmpeg:Front_Door"
    Front_Yard:
      - rtsp://admin:[redacted]@192.168.40.23/cam/realmonitor?channel=1&subtype=0
      - "ffmpeg:Front_Yard#audio=aac"
    Shed_Camera:
      - rtsp://admin:[redacted]@192.168.40.21/cam/realmonitor?channel=1&subtype=0
      - "ffmpeg:Shed_Camera#audio=aac"
    Driveway_Doorbell:
      - rtsp://admin:[redacted]@192.168.40.24/cam/realmonitor?channel=1&subtype=0
      - "ffmpeg:Driveway_Doorbell#audio=aac"
    Living_Room:
      - rtsp://admin:[redacted]@192.168.40.20/live
      - "ffmpeg:Front_Door#audio=aac"
    Barn:
      - http://192.168.40.25/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=[redacted]
      - "ffmpeg:Barn#audio=aac"
    Septic_Shed:
      - http://192.168.40.26/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=[redacted]
      - "ffmpeg:Septic_Shed#audio=aac"
    Septic_Driveway:
      - http://192.168.40.28/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=[redacted]
      - "ffmpeg:Septic_Driveway#audio=aac"
    Septic_Inside:
      - http://192.168.40.27/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=admin&password=[redacted]
      - "ffmpeg:Septic_Inside#audio=aac"

ffmpeg:
  global_args: -hide_banner -loglevel warning
  hwaccel_args: preset-nvidia-h264
  output_args:
    record: preset-record-generic-audio-copy

cameras:
    Front_Door:
        ffmpeg:
            inputs:                
                - path:  rtsp://127.0.0.1:8554/Front_Door
                  input_args: preset-rtsp-restream
                  roles:
                    - record
                    - detect
        detect:
            width: 1920 
            height: 1080 
        zones:
          front_sidewalk:
            coordinates: 886,1080,1806,1080,1441,1050,1146,821,1016,755,871,703,870,757,870,825
          road:
            coordinates: 858,489,1806,516,1808,533,855,509
          front_yard_north:
            coordinates: 1556,521,1834,533,1738,1043,1462,1080,1096,783,856,711,868,517

    Front_Yard:
        ffmpeg:
            inputs:
                - path: rtsp://127.0.0.1:8554/Front_Yard
                  input_args: preset-rtsp-restream
                  roles:
                    - detect
                    - record
                  hwaccel_args: preset-nvidia-h265
        detect:
            width: 1920
            height: 1080

        zones:
          front_yard_north:
            coordinates: 1302,540,1468,543,1740,567,1853,566,1920,566,1920,1080,0,1080,0,496,972,505
          front_sidewalk:
            coordinates: 1828,571,1774,481,1415,465,1412,536

    Shed_Camera:
        ffmpeg:    
            inputs:
                - path: rtsp://127.0.0.1:8554/Shed_Camera
                  input_args: preset-rtsp-restream-low-latency
                  roles:
                    - detect
                    - record
        detect:
            width: 3840 
            height: 2160 

        zones:
          pool:
            coordinates: 0,2160,3840,2160,3840,1631,2513,663,1087,699,0,1272
          backyard:
            coordinates: 2513,666,3840,1607,3840,682,3179,530,2632,468,2390,504,1702,630,958,573,0,887,0,1310,1106,699,1496,687,1876,682,2069,675,2311,659
          driveway:
            coordinates: 1051,559,904,523,737,561,309,609,183,651,402,654,0,825,0,892
          road:
            coordinates: 0,654,868,466,863,509,0,704
          front_yard_south:
             coordinates: 0,801,290,711,385,647,157,659,0,706
          deck:
            coordinates: 2321,361,2335,556,1831,621,1555,625,1082,587,1094,418
          front_yard_north:
           coordinates: 851,499,849,561,659,599,316,618

    Driveway_Doorbell:
        ffmpeg:     
            inputs:
                - path: rtsp://127.0.0.1:8554/Driveway_Doorbell 
                  input_args: preset-rtsp-restream
                  roles:
                    - detect
                    - record
        detect:
            width: 1920 
            height: 1080       
        zones:
          driveway:
            coordinates: 1920,1080,1920,640,1447,694,911,673,496,674,837,741,449,1080
          road:
            coordinates: 1305,603,1920,592,1920,612,1291,627
          front_yard_south:
            coordinates: 1537,618,1920,608,1920,638,1776,674,1439,698,1125,693,930,671
          backyard:
            coordinates: 498,676,546,641,202,618,0,699,0,883,506,1022,823,744

    Living_Room:
        ffmpeg:
            inputs:
                - path: rtsp://127.0.0.1:8554/Living_Room
                  input_args: preset-rtsp-restream
                  roles:
                    - detect
                    - record
        detect:
            enabled: False
            width: 1920 
            height: 1080 
        birdseye:
          enabled: False

    Barn:
        ffmpeg:
            inputs:
                - path: rtsp://127.0.0.1:8554/Barn
                  input_args: preset-rtsp-restream-low-latency
                  roles:
                    - detect
                    - record
        detect:
            width: 2560
            height: 1920
        birdseye:
          mode: continuous
        zones:
          driveway:
            coordinates: 2056,1920,2560,1920,2560,1084,2286,1078,1968,1138,1360,1120,492,1006,354,1040,1332,1214,1766,1466
          road:
            coordinates: 1926,724,2014,762,0,1094,0,1014
          front_yard_south:
            coordinates: 0,1920,2064,1920,1708,1432,1226,1196,304,1036,0,1086
          front_yard_north:
            coordinates: 1786,802,2156,834,2158,974,1974,1142,566,1024,556,998

    Septic_Shed:
        ffmpeg:
            inputs:
                - path: rtsp://127.0.0.1:8554/Septic_Shed
                  input_args: preset-rtsp-restream-low-latency
                  roles:
                    - detect
                    - record
        detect:
            width: 2560 
            height: 1920 

    Septic_Driveway:
        ffmpeg:      
            inputs:
                - path: rtsp://127.0.0.1:8554/Septic_Driveway
                  input_args: preset-rtsp-restream
                  roles:
                    - detect
                    - record
        detect:
            width: 2560 
            height: 1440 

    Septic_Inside:
        ffmpeg:
            inputs:
                - path: rtsp://127.0.0.1:8554/Septic_Inside
                  input_args: preset-rtsp-restream-low-latency
                  roles:
                    - detect
                    - record
        detect:
            width: 2560 
            height: 1920 

birdseye:
  enabled: True
  restream: True
  width: 3840 #1280
  height: 2160 #720
  quality: 25

snapshots:
  enabled: False
  clean_copy: False

Relevant log output

N/A

FFprobe output from your camera

[{"return_code":0,"stderr":"","stdout":{"programs":[],"streams":[{"avg_frame_rate":"0/0","codec_long_name":"H.264/AVC/MPEG-4AVC/MPEG-4part10","height":1080,"width":1920},{"avg_frame_rate":"0/0","codec_long_name":"AAC(AdvancedAudioCoding)"}]}}]

Frigate stats

{"Barn":{"camera_fps":5.1,"capture_pid":967,"detection_enabled":1,"detection_fps":6.8,"ffmpeg_pid":994,"pid":952,"process_fps":5.1,"skipped_fps":0.0},"Driveway_Doorbell":{"camera_fps":0.0,"capture_pid":962,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":2476,"pid":949,"process_fps":0.0,"skipped_fps":0.0},"Front_Door":{"camera_fps":5.0,"capture_pid":956,"detection_enabled":1,"detection_fps":0.1,"ffmpeg_pid":968,"pid":945,"process_fps":5.0,"skipped_fps":0.0},"Front_Yard":{"camera_fps":5.1,"capture_pid":958,"detection_enabled":1,"detection_fps":10.9,"ffmpeg_pid":975,"pid":946,"process_fps":5.1,"skipped_fps":0.0},"Living_Room":{"camera_fps":5.1,"capture_pid":965,"detection_enabled":0,"detection_fps":0.0,"ffmpeg_pid":988,"pid":950,"process_fps":5.1,"skipped_fps":0.0},"Septic_Driveway":{"camera_fps":5.0,"capture_pid":978,"detection_enabled":1,"detection_fps":7.1,"ffmpeg_pid":995,"pid":954,"process_fps":5.0,"skipped_fps":0.0},"Septic_Inside":{"camera_fps":5.0,"capture_pid":982,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":1008,"pid":955,"process_fps":5.0,"skipped_fps":0.0},"Septic_Shed":{"camera_fps":5.1,"capture_pid":971,"detection_enabled":1,"detection_fps":0.0,"ffmpeg_pid":990,"pid":953,"process_fps":5.1,"skipped_fps":0.0},"Shed_Camera":{"camera_fps":5.1,"capture_pid":960,"detection_enabled":1,"detection_fps":10.4,"ffmpeg_pid":992,"pid":947,"process_fps":5.1,"skipped_fps":0.0},"cpu_usages":{"%Cpu(s):":{"cpu":"id,","mem":"0.3"},"1":{"cpu":"0.0","mem":"0.0"},"1004":{"cpu":"0.0","mem":"0.0"},"1006":{"cpu":"0.0","mem":"0.0"},"1007":{"cpu":"0.0","mem":"0.0"},"1008":{"cpu":"3.3","mem":"0.3"},"1010":{"cpu":"0.0","mem":"0.0"},"1016":{"cpu":"16.3","mem":"0.3"},"104":{"cpu":"0.0","mem":"0.0"},"106":{"cpu":"5.7","mem":"1.7"},"1063":{"cpu":"2.0","mem":"0.0"},"119":{"cpu":"0.0","mem":"0.0"},"124":{"cpu":"0.0","mem":"0.0"},"125":{"cpu":"0.0","mem":"0.0"},"126":{"cpu":"0.0","mem":"0.0"},"127":{"cpu":"0.0","mem":"0.0"},"128":{"cpu":"0.0","mem":"0.0"},"129":{"cpu":"0.0","mem":"0.0"},"130":{"cpu":"0.0","mem":"0.0"},"131":{"cpu":"0.0","mem":"0.0"},"15":{"cpu":"0.0","mem":"0.0"},"16":{"cpu":"0.0","mem":"0.0"},"199":{"cpu":"0.0","mem":"0.0"},"200":{"cpu":"0.0","mem":"0.0"},"201":{"cpu":"0.0","mem":"0.0"},"202":{"cpu":"0.0","mem":"0.0"},"203":{"cpu":"0.0","mem":"0.0"},"204":{"cpu":"0.0","mem":"0.0"},"205":{"cpu":"0.0","mem":"0.0"},"206":{"cpu":"0.0","mem":"0.0"},"207":{"cpu":"0.0","mem":"0.0"},"208":{"cpu":"0.0","mem":"0.0"},"209":{"cpu":"0.0","mem":"0.0"},"210":{"cpu":"0.0","mem":"0.0"},"211":{"cpu":"0.0","mem":"0.0"},"212":{"cpu":"0.0","mem":"0.0"},"213":{"cpu":"0.0","mem":"0.0"},"214":{"cpu":"0.0","mem":"0.0"},"24":{"cpu":"0.0","mem":"0.0"},"2403":{"cpu":"0.0","mem":"0.0"},"2469":{"cpu":"0.0","mem":"0.0"},"2476":{"cpu":"0.0","mem":"0.0"},"2485":{"cpu":"0.0","mem":"0.0"},"2486":{"cpu":"0.0","mem":"0.0"},"2491":{"cpu":"0.3","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"},"29":{"cpu":"0.0","mem":"0.0"},"30":{"cpu":"0.0","mem":"0.0"},"31":{"cpu":"0.0","mem":"0.0"},"32":{"cpu":"0.0","mem":"0.0"},"41":{"cpu":"0.0","mem":"0.0"},"42":{"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"},"89":{"cpu":"6.3","mem":"0.0"},"935":{"cpu":"0.0","mem":"0.3"},"941":{"cpu":"0.3","mem":"0.0"},"942":{"cpu":"9.0","mem":"3.0"},"943":{"cpu":"11.0","mem":"0.4"},"945":{"cpu":"0.3","mem":"0.3"},"946":{"cpu":"4.0","mem":"0.4"},"947":{"cpu":"4.0","mem":"0.4"},"949":{"cpu":"0.0","mem":"0.3"},"950":{"cpu":"0.0","mem":"0.3"},"952":{"cpu":"3.0","mem":"0.4"},"953":{"cpu":"0.3","mem":"0.3"},"954":{"cpu":"1.3","mem":"0.4"},"955":{"cpu":"0.3","mem":"0.3"},"956":{"cpu":"2.0","mem":"0.3"},"957":{"cpu":"0.0","mem":"0.0"},"958":{"cpu":"1.7","mem":"0.3"},"960":{"cpu":"6.3","mem":"0.4"},"961":{"cpu":"0.0","mem":"0.0"},"962":{"cpu":"0.0","mem":"0.3"},"965":{"cpu":"2.0","mem":"0.3"},"967":{"cpu":"5.0","mem":"0.3"},"968":{"cpu":"2.7","mem":"0.3"},"970":{"cpu":"0.0","mem":"0.0"},"971":{"cpu":"4.0","mem":"0.3"},"975":{"cpu":"2.0","mem":"0.3"},"978":{"cpu":"3.3","mem":"0.3"},"982":{"cpu":"4.0","mem":"0.3"},"987":{"cpu":"0.0","mem":"0.0"},"988":{"cpu":"1.7","mem":"0.3"},"990":{"cpu":"3.3","mem":"0.3"},"992":{"cpu":"5.7","mem":"0.4"},"994":{"cpu":"4.7","mem":"0.3"},"995":{"cpu":"2.7","mem":"0.3"},"997":{"cpu":"0.0","mem":"0.0"},"MiB":{"cpu":"31031.9","mem":"avail"},"PID":{"cpu":"%CPU","mem":"%MEM"},"Tasks:":{"cpu":"stopped,","mem":"0"},"top":{"cpu":"users,","mem":"load"}},"detection_fps":35.3,"detectors":{"tensorrt":{"detection_start":0.0,"inference_speed":1.65,"pid":942}},"gpu_usages":{"NVIDIA GeForce RTX 3060 Ti":{"gpu":"3 %","mem":"40.2 %"}},"service":{"last_updated":1679088392,"latest_version":"0.11.1","storage":{"/dev/shm":{"free":967.8,"mount_type":"tmpfs","total":1073.7,"used":106.0},"/media/frigate/clips":{"free":937854.1,"mount_type":"fuse.shfs","total":8637489.4,"used":7699635.3},"/media/frigate/recordings":{"free":1664742.4,"mount_type":"fuse.shfs","total":9637204.8,"used":7972462.4},"/tmp/cache":{"free":964.8,"mount_type":"tmpfs","total":1000.0,"used":35.2}},"temperatures":{},"uptime":396,"version":"0.12.0-e8d8cc4"}}

Operating system

UNRAID

Install method

Docker CLI

Coral version

CPU (no coral)

Network connection

Mixed

Camera make and model

Dahua/Amcrest

Any other information that may be helpful

No response

NickM-27 commented 1 year ago

Two way audio just needs to be disabled in the go2rtc setup https://github.com/AlexxIT/go2rtc#two-way-audio

austindetzel commented 1 year ago

Two way audio just needs to be disabled in the go2rtc setup https://github.com/AlexxIT/go2rtc#two-way-audio