roflcoopter / viseron

Self-hosted, local only NVR and AI Computer Vision software. With features such as object detection, motion detection, face recognition and more, it gives you the power to keep an eye on your home, office or any other place you want to monitor.
MIT License
1.51k stars 155 forks source link

mog2 and background_subtractor giving error on startup #661

Closed ghallford closed 10 months ago

ghallford commented 10 months ago

Keep getting the following error on startup and won't start motion detection:

[2023-08-22 14:11:33] [ERROR ] [viseron.components] - Error validating config for component mog2: extra keys not allowed @ data['mog2']['motion_detector']['cameras']['dining_room']['trigger_detector']. Got True extra keys not allowed @ data['mog2']['motion_detector']['cameras']['kitchen']['trigger_detector']. Got True Traceback (most recent call last): File "/src/viseron/components/init.py", line 114, in validate_component_config return component_module.CONFIG_SCHEMA(self._config) # type: ignore File "/usr/local/lib/python3.8/dist-packages/voluptuous/schema_builder.py", line 272, in call return self._compiled([], data) File "/usr/local/lib/python3.8/dist-packages/voluptuous/schema_builder.py", line 594, in validate_dict return base_validate(path, iteritems(data), out) File "/usr/local/lib/python3.8/dist-packages/voluptuous/schema_builder.py", line 432, in validate_mapping raise er.MultipleInvalid(errors) voluptuous.error.MultipleInvalid: extra keys not allowed @ data['mog2']['motion_detector']['cameras']['kitchen']['trigger_detector'] [2023-08-22 14:11:33] [ERROR ] [viseron.components] - Setup of component mog2 failed [2023-08-22 14:11:33] [ERROR ] [viseron.components] - Failed setup of component mog2

Config:


ffmpeg:
  camera:
    kitchen:  # This value has to be unique across all cameras
      name: Kitchen
      host: 192.168.2.133
      port: 554
      path: rtsp://192.168.2.133:554/live0

    dining_room:  # This value has to be unique across all cameras
      name: Dining Room
      host: 192.168.2.192
      port: 554
      path: rtsp://192.168.2.192/live0

## Then add an object detector
darknet:
  object_detector:
    cameras:
      kitchen:  # Attach detector to the configured camera_1 above
        fps: 1
        scan_on_motion_only: true  # Scan for objects even when there is no motion
        labels:
          - label: person
            confidence: 0.8
            trigger_recorder: true
          - label: cat
            confidence: 0.8
            trigger_recorder: true

      dining_room:  # Attach detector to the configured camera_2 above
        fps: 1
        scan_on_motion_only: true
        labels:
          - label: person
            confidence: 0.8
            trigger_recorder: true
          - label: cat
            confidence: 0.8
            trigger_recorder: true

## You can also use motion detection
mog2:
  motion_detector:
    cameras:
      kitchen:  # Attach detector to the configured camera_1 above
        fps: 1
        trigger_detector: true
      dining_room:  # Attach detector to the configured camera_2 above
        fps: 1
        trigger_detector: true

## To tie everything together we need to configure one more component.
nvr:
  kitchen:  # Run NVR for camera_1
  dining_room:  # Run NVR for camera_2
gofaster commented 10 months ago

In the mog2: section, the trigger_detector: keys should be trigger_recorder:

roflcoopter commented 10 months ago

trigger_detector is no longer available as a config option for motion detectors. It has been replaced by scan_on_motion_only for the object detector

ghallford commented 10 months ago

Thank you. Removing the trigger_detector from mog2 config worked.