blakeblackshear / frigate

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

[Support]: Config Validation Errors - frigate:0.10.0-amd64 (Retain modes) #2834

Closed Hoosier-IT closed 2 years ago

Hoosier-IT commented 2 years ago

Describe the problem you are having

Config Validation Errors when installing via docker frigate:0.10.0-amd64.

Following example given in release notes: https://github.com/blakeblackshear/frigate/releases/tag/v0.10.0

frigate | mapping values are not allowed here frigate | in "", line 61, column 11: frigate | retain: frigate | ^

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

Version

0.10.0

Frigate config file

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

detectors:
  coral:
    type: edgetpu
    device: usb

environment_vars:
  EXAMPLE_VAR: value

birdseye:
  enabled: True
  width: 1280
  height: 720
  quality: 8
  mode: objects

ffmpeg:
  global_args: -hide_banner -loglevel warning
  hwaccel_args: []
  input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1
  output_args:
    detect: -f rawvideo -pix_fmt yuv420p
    record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -an
    rtmp: -c copy -f flv

detect:
  width: 2560
  height: 1920
  fps: 5
  enabled: True
  max_disappeared: 25

objects:
  track:
    - person
    - car
  filters:
    person:
      min_area: 5000
      max_area: 100000
      min_score: 0.5
      threshold: 0.7

motion:
  threshold: 25
  contour_area: 100
  delta_alpha: 0.2
  frame_alpha: 0.2
  frame_height: 180

record:
  enabled: True
    retain:
      days: 7
      mode: motion
  events:
    max_seconds: 300
    pre_capture: 5
    post_capture: 5
    objects:
      - person
      - car
    required_zones: []
    retain:
      default: 7
      mode: active_objects
      objects:
        person: 30

snapshots:
  enabled: True
  timestamp: True
  bounding_box: True
  crop: False
  #height: 175
  required_zones: []
  retain:
    default: 7
    objects:
      person: 30

rtmp:
  enabled: True

live:
  height: 720
  quality: 8

cameras:
  North:
    ffmpeg:
      inputs:
        - path: rtsp://admin:{FRIGATE_RTSP_PASSWORD}@192.168.1.40:554/cam/realmonitor?channel=1&subtype=1&unicast=True&proto=Onvif
          roles:
            - detect
            - rtmp
        - path: rtsp://admin:{FRIGATE_RTSP_PASSWORD}@192.168.1.40:554/cam/realmonitor?channel=1&subtype=0&unicast=True&proto=Onvif
          roles:
            - record
    motion:
      threshold: 25
      contour_area: 100
      delta_alpha: 0.2
      frame_alpha: 0.2
      frame_height: 180
      mask: 
        - 0,0,2560,0,2560,522,2349,403,2138,322,1780,222,1255,170,802,200,437,260,0,624
    best_image_timeout: 60

    zones:
      easement:
        coordinates: 0,944,759,198,488,245,0,669
        objects:
          - person
        filters:
          person:
            min_area: 5000
            max_area: 100000
            threshold: 0.7
      driveway:
        coordinates: 0,1920,0,1110,818,186,1243,164,1110,1920
        objects:
          - person
          - car
        filters:
          person:
            min_area: 5000
            max_area: 100000
            threshold: 0.7
      yard:
        coordinates: 1839,861,2287,887,2341,897,2398,951,2453,1012,2560,1034,2560,576,2341,401,2051,292,1658,200,1245,173,1196,834
        objects:
          - person
          - car
        filters:
          person:
            min_area: 5000
            max_area: 100000
            threshold: 0.7
      walkway:
        coordinates: 1972,867,2298,899,2368,940,2439,1017,2560,1172,2560,1920,1151,1920,1196,850
        objects:
          - person
        filters:
          person:
            min_area: 5000
            max_area: 100000
            threshold: 0.7
  Doorbell:
    ffmpeg:
      inputs:
        - path: rtsp://admin:{FRIGATE_RTSP_PASSWORD}@192.168.1.156:554/cam/realmonitor?channel=1&subtype=1&unicast=True&proto=Onvif
          roles:
            - detect
            - rtmp
        - path: rtsp://admin:{FRIGATE_RTSP_PASSWORD}@192.168.1.156:554/cam/realmonitor?channel=1&subtype=0&unicast=True&proto=Onvif
          roles:
            - record
    motion:
      threshold: 25
      contour_area: 100
      delta_alpha: 0.2
      frame_alpha: 0.2
      frame_height: 180
      mask: 
        -   motion:
    mask:
      - 1993,944,1965,593,1594,548,1140,550,738,578,126,40,0,181,0,1145,64,1115,134,1110,205,1128,281,1166,322,1191,503,1179,684,1194,1074,1202,1471,1215,1780,1206,1995,1192
    best_image_timeout: 60

    zones:
      porch:
        coordinates: 2560,1920,2560,1893,1984,1547,1582,1592,1554,1533,1516,1498,1435,1477,1234,1475,721,1445,388,1386,0,1464,0,1920
        objects:
          - person
        filters:
          person:
            min_area: 5000
            max_area: 100000
            threshold: 0.7
      doorbell_yard:
        coordinates: 397,1381,865,1454,1136,1467,1450,1479,1535,1505,1603,1594,1957,1545,1989,1215,1450,1238,1004,1230
        objects:
          - person
        filters:
          person:
            min_area: 5000
            max_area: 100000
            threshold: 0.7
      doorbell_driveway:
        coordinates: 0,1296,320,1273,324,1241,716,1213,1015,1234,0,1473
        objects:
          - person
        filters:
          person:
            min_area: 5000
            max_area: 100000
            threshold: 0.7

    mqtt:
      enabled: True
      timestamp: True
      bounding_box: True
      crop: True
      height: 270
      quality: 70
      required_zones: []

Relevant log output

frigate    | *************************************************************
frigate    | *************************************************************
frigate    | ***    Your config file is not valid!                     ***
frigate    | ***    Please check the docs at                           ***
frigate    | ***    https://docs.frigate.video/configuration/index     ***
frigate    | *************************************************************
frigate    | *************************************************************
frigate    | ***    Config Validation Errors                           ***
frigate    | *************************************************************
frigate    | mapping values are not allowed here
frigate    |   in "<unicode string>", line 61, column 11:
frigate    |         retain:
frigate    |               ^
frigate    | Traceback (most recent call last):
frigate    |   File "/opt/frigate/frigate/app.py", line 312, in start
frigate    |     self.init_config()
frigate    |   File "/opt/frigate/frigate/app.py", line 77, in init_config
frigate    |     user_config = FrigateConfig.parse_file(config_file)
frigate    |   File "/opt/frigate/frigate/config.py", line 899, in parse_file
frigate    |     config = yaml.safe_load(raw_config)
frigate    |   File "/usr/local/lib/python3.8/dist-packages/yaml/__init__.py", line 162, in safe_load
frigate    |     return load(stream, SafeLoader)
frigate    |   File "/usr/local/lib/python3.8/dist-packages/yaml/__init__.py", line 114, in load
frigate    |     return loader.get_single_data()
frigate    |   File "/usr/local/lib/python3.8/dist-packages/yaml/constructor.py", line 49, in get_single_data
frigate    |     node = self.get_single_node()
frigate    |   File "/usr/local/lib/python3.8/dist-packages/yaml/composer.py", line 36, in get_single_node
frigate    |     document = self.compose_document()
frigate    |   File "/usr/local/lib/python3.8/dist-packages/yaml/composer.py", line 55, in compose_document
frigate    |     node = self.compose_node(None, None)
frigate    |   File "/usr/local/lib/python3.8/dist-packages/yaml/composer.py", line 84, in compose_node
frigate    |     node = self.compose_mapping_node(anchor)
frigate    |   File "/usr/local/lib/python3.8/dist-packages/yaml/composer.py", line 133, in compose_mapping_node
frigate    |     item_value = self.compose_node(node, item_key)
frigate    |   File "/usr/local/lib/python3.8/dist-packages/yaml/composer.py", line 84, in compose_node
frigate    |     node = self.compose_mapping_node(anchor)
frigate    |   File "/usr/local/lib/python3.8/dist-packages/yaml/composer.py", line 127, in compose_mapping_node
frigate    |     while not self.check_event(MappingEndEvent):
frigate    |   File "/usr/local/lib/python3.8/dist-packages/yaml/parser.py", line 98, in check_event
frigate    |     self.current_event = self.state()
frigate    |   File "/usr/local/lib/python3.8/dist-packages/yaml/parser.py", line 428, in parse_block_mapping_key
frigate    |     if self.check_token(KeyToken):
frigate    |   File "/usr/local/lib/python3.8/dist-packages/yaml/scanner.py", line 116, in check_token
frigate    |     self.fetch_more_tokens()
frigate    |   File "/usr/local/lib/python3.8/dist-packages/yaml/scanner.py", line 223, in fetch_more_tokens
frigate    |     return self.fetch_value()
frigate    |   File "/usr/local/lib/python3.8/dist-packages/yaml/scanner.py", line 577, in fetch_value
frigate    |     raise ScannerError(None, None,
frigate    | yaml.scanner.ScannerError: mapping values are not allowed here
frigate    |   in "<unicode string>", line 61, column 11:
frigate    |         retain:
frigate    |               ^
frigate    |
frigate    | *************************************************************
frigate    | ***    End Config Validation Errors                       ***
frigate    | *************************************************************

FFprobe output from your camera

n/a

Frigate stats

n/a

Operating system

Debian

Install method

Docker Compose

Coral version

USB

Network connection

Wired

Camera make and model

Amcrest

Any other information that may be helpful

No response

blakeblackshear commented 2 years ago

You indented the retain section too far. Needs to be like this:

record:
  enabled: True
  retain:
    days: 7
    mode: motion
Hoosier-IT commented 2 years ago

Thank you sir