blakeblackshear / frigate

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

Crashing after beta 3-4 #8465

Closed zebrahosting closed 1 year ago

zebrahosting commented 1 year ago

Describe the problem you are having

After upgrading v13 b2 to b3 (and 4) my camera's dont load anymore and the addon crashes on a regular base. V12 and the first beta's have been rock solid. I can see that the DB moved to the new location, Go2rtc v 1.8.1 has no errors in the log. No changes to config between the beta's. Streams don't load and don't show in the overviews. Mix of Reolink doorbell and Dahua camera's all working in my Blue Iris.

Version

13 b4

Frigate config file

mqtt:
  host: 192.168.1.15         
  port: 1883
  topic_prefix: frigate
  client_id: frigate
  user: xxx             
  password: xxx       
  stats_interval: 60

##########################################################################
detectors:
  coral:
    type: edgetpu
    device: usb

rtmp:
  enabled: false

##############################################
go2rtc:
  streams:
                    ## CHANGE RTSP USERNAME AND PASSWORD
    Gate:
      - rtsp://xxx:xxx@192.168.1.38:554/h264Preview_01_main
    Gate_sub:
      - rtsp://xxx:xxx@192.168.1.38:554/h264Preview_01_sub
      - ffmpeg:rtsp://xxx:xxx@192.168.1.38:554/h264Preview_01_sub#audio=pcm#audio=volume
    Door:
      - rtsp://xxx:zxxx@192.168.1.39:554/h264Preview_01_sub
    Door_sub:
      - rtsp://xxx:xxx@192.168.1.39:554/h264Preview_01_sub
      - ffmpeg:rtsp://xxx:xxx@192.168.1.39:554/h264Preview_01_sub#audio=pcm#audio=volume
    PTZ:
 #     - rtsp://xxx:xxx@192.168.1.30:554/cam/realmonitor?channel=0&subtype=0&unicast=true&proto=Onvif
       - rtsp://xxx:xxx@192.168.1.30:554
    PTZ_sub:
      - rtsp://xxx:xxx@192.168.1.30:554/cam/realmonitor?channel=1&subtype=2&unicast=true&proto=Onvif
    Swimmingpool:
      - rtsp://xxx:xxx@192.168.1.34:554/cam/realmonitor?channel=1&subtype=0
    Swimmingpool_sub:
      - rtsp://xxx:xxx@192.168.1.34:554/cam/realmonitor?channel=1&subtype=1
    Entree:
      - rtsp://xxx:xxx@192.168.1.31:554/cam/realmonitor?channel=1&subtype=0
    Entree_sub:
      - rtsp://xxx:xxx@192.168.1.31:554/cam/realmonitor?channel=1&subtype=1
    Backyard:
      - rtsp://xxx:xxx@192.168.1.35:554/cam/realmonitor?channel=1&subtype=0
    Backyard_sub:
      - rtsp://xxx:xxx@192.168.1.35:554/cam/realmonitor?channel=1&subtype=1
    Garage:
      - rtsp://xxx:xxx@192.168.1.32:554/cam/realmonitor?channel=1&subtype=0
    Garage_sub:
      - rtsp://xxx:xxx@192.168.1.32:554/cam/realmonitor?channel=1&subtype=1

## THIS PREVENTS THE AUDIO COMING OUT FROM THE DOORBELL SOUNDING MUFFLED
  ffmpeg:
    bin: ffmpeg
    volume: -af "volume=30dB"

##########################################################################
birdseye:
  enabled: false
  mode: continuous

cameras:
#---------------------------------------Gate -------------------------------------

  Gate:
    ffmpeg:
      inputs:
      - path: rtsp://127.0.0.1:8554/Gate_sub
        input_args: preset-rtsp-restream
        roles:
        - detect
        - record
      output_args:
        record: preset-record-generic-audio-copy
    detect:
      width: 1280
      height: 720
      fps: 5

    objects:
      track:
      - car
      - truck
      - person
      - motorcycle
    snapshots:
      enabled: true
      timestamp: false
      crop: false
      quality: 100
      height: 500

#---------------------------------------Door -------------------------------------

  Door:
    ffmpeg:
      inputs:
      - path: rtsp://127.0.0.1:8554/Door_sub
        input_args: preset-rtsp-restream
        roles:
        - detect
        - record
      output_args:
        record: preset-record-generic-audio-copy
    zones:
      reolink_zone:
        coordinates: 0,480,800,480,543,323,362,329,0,61
    motion:
      mask:
      - 870,626,906,253,463,216,477,720
    detect:
      width: 1280
      height: 720
      fps: 5

    objects:
      track:
      - person
    snapshots:
      enabled: true
      timestamp: false
      crop: false
      quality: 100
      height: 500

#---------------------------------------PTZ -------------------------------------

  PTZ:
    ffmpeg:
      inputs:
      - path: rtsp://127.0.0.1:8554/PTZ_sub
        input_args: preset-rtsp-restream
        roles:
        - detect
      - path: rtsp://127.0.0.1:8554/PTZ
        input_args: preset-rtsp-restream
        roles:
        - record
    record:
      enabled: false
      events:
        retain:
          default: 5 
          mode: motion 
        pre_capture: 3 
        post_capture: 10  
        required_zones:
        - road
    detect:
      width: 1280
      height: 720
      fps: 5

    objects:
      track:
      - car
      - truck
      - person
      - motorcycle
      filters:
        car:
          mask: 776,21,1280,90,1280,0,256,0,0,0,0,103
        motorcycle:
          mask: 776,21,1280,90,1280,0,256,0,0,0,0,103
        truck:
          mask: 776,21,1280,90,1280,0,256,0,0,0,0,103
        person:
          threshold: 0.75
          min_score: 0.7

    snapshots:
      enabled: true
      timestamp: false
      crop: false
      quality: 100
      height: 500
#      events:
#        required_zones:
#          - road
    motion:
      mask:
      - 776,21,999,0,1069,53,1280,90,1280,0,256,0,0,0,0,103
    zones:
      road:
        coordinates: 751,0,920,0,1007,0,997,36,1280,86,1033,480,540,720,0,720,0,427,0,113
#---------------------------------------Swimmingpool -------------------------------------

  Swimmingpool:
    ffmpeg:
      inputs:
      - path: rtsp://127.0.0.1:8554/Swimmingpool_sub
        input_args: preset-rtsp-restream
        roles:
        - detect
      - path: rtsp://127.0.0.1:8554/Swimmingpool
        input_args: preset-rtsp-restream
        roles:
        - record
    detect:
      width: 1280
      height: 720
      fps: 5

    objects:
      track:
      - car
      - person
      - dog
    snapshots:
      enabled: true
      timestamp: false
      crop: false
      quality: 100
      height: 500

    motion:
      mask:
      - 0,220,254,116,697,49,702,6,5,0

#---------------------------------------Garage -------------------------------------

  Garage:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/Garage_sub
          input_args: preset-rtsp-restream
          roles:
            - detect
        - path: rtsp://127.0.0.1:8554/Garage
          input_args: preset-rtsp-restream
          roles:
            - record
    detect:
      width: 1280
      height: 720
      fps: 5

    objects:
      track:
      - person
      - motorcycle
    snapshots:
      enabled: true
      timestamp: false
      crop: false
      quality: 100
      height: 500
    motion:

#---------------------------------------Entree -------------------------------------

  Entree:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/Entree_sub
          input_args: preset-rtsp-restream
          roles:
            - detect
        - path: rtsp://127.0.0.1:8554/Entree
          input_args: preset-rtsp-restream
          roles:
            - record
    detect:
      width: 1280
      height: 720
      fps: 5

    objects:
      track:
      - person
    snapshots:
      enabled: true
      timestamp: false
      crop: false
      quality: 100
      height: 500

    motion:
      mask:
      - 974,101,1280,336,1280,0,1280,0,0,0,0,141,0,131

#---------------------------------------Backyard -------------------------------------

  Backyard:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/Backyard_sub
          input_args: preset-rtsp-restream
          roles:
            - detect
        - path: rtsp://127.0.0.1:8554/Backyard
          input_args: preset-rtsp-restream
          roles:
            - record
    detect:
      width: 1280
      height: 720
      fps: 5

    objects:
      track:
      - person
      - dog
      - cat
    snapshots:
      enabled: true
      timestamp: false
      crop: false
      quality: 100
      height: 500
    motion:
      mask:
      - 1280,234,1280,0,560,0,0,0,0,123,0,147

Relevant log output

2023-11-05 01:14:35.405930759  [INFO] Preparing Frigate...
2023-11-05 01:14:35.415233782  [INFO] Starting Frigate...
2023-11-05 01:14:36.389222242  [2023-11-05 08:14:36] frigate.app                    INFO    : Starting Frigate (0.13.0-65e3e67)
2023-11-05 01:14:36.389242080  [2023-11-05 08:14:36] frigate.app                    INFO    : Creating directory: /tmp/cache
2023-11-05 01:14:36.448052127  [2023-11-05 08:14:36] peewee_migrate.logs            INFO    : Starting migrations
2023-11-05 01:14:36.451001750  [2023-11-05 08:14:36] peewee_migrate.logs            INFO    : There is nothing to migrate
2023-11-05 01:14:36.454576715  [2023-11-05 08:14:36] frigate.app                    INFO    : Recording process started: 378
2023-11-05 01:14:36.456047929  [2023-11-05 08:14:36] frigate.app                    INFO    : go2rtc process pid: 89
2023-11-05 01:14:36.472614527  [2023-11-05 08:14:36] detector.coral                 INFO    : Starting detection process: 388
2023-11-05 01:14:36.476070163  [2023-11-05 08:14:36] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as usb
2023-11-05 01:14:36.476138895  [2023-11-05 08:14:36] frigate.detectors.plugins.edgetpu_tfl ERROR   : No EdgeTPU was detected. If you do not have a Coral device yet, you must configure CPU detectors.
2023-11-05 01:14:36.476183971  Process detector:coral:
2023-11-05 01:14:36.476304703  [2023-11-05 08:14:36] frigate.app                    INFO    : Output process started: 390
2023-11-05 01:14:36.476838648  Traceback (most recent call last):
2023-11-05 01:14:36.476849338    File "/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py", line 160, in load_delegate
2023-11-05 01:14:36.476850350      delegate = Delegate(library, options)
2023-11-05 01:14:36.476851282    File "/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py", line 119, in __init__
2023-11-05 01:14:36.476854028      raise ValueError(capture.message)
2023-11-05 01:14:36.476954571  ValueError
2023-11-05 01:14:36.476955853  
2023-11-05 01:14:36.476956605  During handling of the above exception, another exception occurred:
2023-11-05 01:14:36.476957105  
2023-11-05 01:14:36.476957727  Traceback (most recent call last):
2023-11-05 01:14:36.476987754    File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
2023-11-05 01:14:36.476988666      self.run()
2023-11-05 01:14:36.476989447    File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run
2023-11-05 01:14:36.476990108      self._target(*self._args, **self._kwargs)
2023-11-05 01:14:36.476990861    File "/opt/frigate/frigate/object_detection.py", line 102, in run_detector
2023-11-05 01:14:36.476991692      object_detector = LocalObjectDetector(detector_config=detector_config)
2023-11-05 01:14:36.476993977    File "/opt/frigate/frigate/object_detection.py", line 53, in __init__
2023-11-05 01:14:36.477007843      self.detect_api = create_detector(detector_config)
2023-11-05 01:14:36.477008774    File "/opt/frigate/frigate/detectors/__init__.py", line 18, in create_detector
2023-11-05 01:14:36.477009556      return api(detector_config)
2023-11-05 01:14:36.477010428    File "/opt/frigate/frigate/detectors/plugins/edgetpu_tfl.py", line 41, in __init__
2023-11-05 01:14:36.477025998      edge_tpu_delegate = load_delegate("libedgetpu.so.1.0", device_config)
2023-11-05 01:14:36.477026940    File "/usr/lib/python3/dist-packages/tflite_runtime/interpreter.py", line 162, in load_delegate
2023-11-05 01:14:36.477037911      raise ValueError('Failed to load delegate from {}\n{}'.format(
2023-11-05 01:14:36.477038873  ValueError: Failed to load delegate from libedgetpu.so.1.0
2023-11-05 01:14:36.477039524  
2023-11-05 01:14:36.493305374  [2023-11-05 08:14:36] frigate.app                    INFO    : Camera processor started for Gate: 399
2023-11-05 01:14:36.496501101  [2023-11-05 08:14:36] frigate.app                    INFO    : Camera processor started for Door: 401
2023-11-05 01:14:36.500168361  [2023-11-05 08:14:36] frigate.app                    INFO    : Camera processor started for PTZ: 403
2023-11-05 01:14:36.504235741  [2023-11-05 08:14:36] frigate.app                    INFO    : Camera processor started for Swimmingpool: 405
2023-11-05 01:14:36.508987805  [2023-11-05 08:14:36] frigate.app                    INFO    : Camera processor started for Garage: 408
2023-11-05 01:14:36.512645308  [2023-11-05 08:14:36] frigate.app                    INFO    : Camera processor started for Entree: 411
2023-11-05 01:14:36.515743065  [2023-11-05 08:14:36] frigate.app                    INFO    : Camera processor started for Backyard: 414
2023-11-05 01:14:36.518900528  [2023-11-05 08:14:36] frigate.app                    INFO    : Capture process started for Gate: 417
2023-11-05 01:14:36.523444764  [2023-11-05 08:14:36] frigate.app                    INFO    : Capture process started for Door: 428
2023-11-05 01:14:36.527241133  [2023-11-05 08:14:36] frigate.app                    INFO    : Capture process started for PTZ: 432
2023-11-05 01:14:36.530607096  [2023-11-05 08:14:36] frigate.app                    INFO    : Capture process started for Swimmingpool: 437
2023-11-05 01:14:36.533939814  [2023-11-05 08:14:36] frigate.app                    INFO    : Capture process started for Garage: 442
2023-11-05 01:14:36.537397182  [2023-11-05 08:14:36] frigate.app                    INFO    : Capture process started for Entree: 445
2023-11-05 01:14:36.541748077  [2023-11-05 08:14:36] frigate.app                    INFO    : Capture process started for Backyard: 450

FFprobe output from your camera

ffprobe hangs
Within frigate shows:
Process P-ID    FPS CPU %   Memory %
ffmpeg
457 4.08    0.0%    0.4%
Capture 452 -   0.0%    1.5%
Detect  423 0 (2.86 skipped)    0.0%    1.6%

Frigate stats

No response

Operating system

HassOS

Install method

HassOS Addon

Coral version

USB

Network connection

Wired

Camera make and model

Dahua and Reoling

Any other information that may be helpful

No response

NickM-27 commented 1 year ago

The coral is not detected, nothing has changed regarding the coral for many frigate versions so this is likely something in the host.

NickM-27 commented 1 year ago

Which variant of the beta addon are you running

zebrahosting commented 1 year ago

Beta addon 4 now and the beta integration 5

NickM-27 commented 1 year ago

I'm asking which variant of the beta addon (normal or full access)

zebrahosting commented 1 year ago

Frigate Beta (0.13.0) = normal

NickM-27 commented 1 year ago

Thanks for confirming, do you see the coral in the hardware section of HA settings?

zebrahosting commented 1 year ago

Running it on Proxmox. I assume an update there killed the fragile setup over USB. I will dive into this and double check.

zebrahosting commented 1 year ago

OK reinstalled the driver on Proxmox and added two USB corals hoping it would find at least one and it did. Thanks for the help. Up to my next issue :-)