blakeblackshear / frigate

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

[Support]: Invalid Config #8356

Closed awwbaker closed 11 months ago

awwbaker commented 1 year ago

Describe the problem you are having

I am trying to clean the errors out of my frigate.yaml file. It seems that I get the green check and there are still formatting errors. I look at the log file and from what my pea brain can tell does not offer any help. I really want to be able to correlate the log output to failures in the config file. THANK YOU!

Version

0.12.1

Frigate config file

mqtt:
  host: 192.168.4.23
  user: mqtt_user
  password: mqtt_user

detectors:
  coral:
    type: edgetpu
    device: usb

go2rtc:
  streams:
    garage:
    - rtsp://192.168.4.23:8554/garage
    breezeway:
    - rtsp://192.168.4.23:8554/breezeway
    front_door_main:
    - rtsp://admin:XXXX@192.168.4.117:554/h264Preview_01_main
    front_door_sub:
    - rtsp://admin:XXXX@192.168.4.117:554/h264Preview_01_sub
snapshots:
  enabled: True
  clean_copy: True
  timestamp: True
  # Optional: draw bounding box on the snapshots (default: shown below)
  bounding_box: True
  retain:
    # Required: Default retention days (default: shown below)
    default: 10
    # Optional: Per object retention days
    objects:
      person: 15
detect:
  enabled: True
  width: 1280
  height: 720
  fps: 10
ffmpeg:
  hwaccel_args: preset-vaapi
#  hwaccel_args: -hwaccel_output_format qsv -c:v h264_qsv
#  output_args: # record audio
#  record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy # -an
record:
 enabled: True
 retain:
   days: 7
   mode: motion
 events:
   retain:
     default: 14
     mode: active_objects
cameras:
 front_door_main: 
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/front_door_main
          roles:
            - record
            - rtmp
 front_door_sub: 
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/front_door_sub
          roles:
            - detect
#    objects:
#track:
#      - person
#      - dog
# zones:
#   alienzone:
#    coordinates: 462,720,972,720,738,535,455,552
 breezeway: 
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/breezeway
          roles:
            - record
            - rtmp
            - detect
      objects:
        track:
           - person
           - dog
 zones:
  deerzone:
  coordinates: 407,720,0,720,0,468,412,193,476,191

 garage: 
  ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/garage
          roles:
            - record
            - rtmp
            - detect

Relevant log output

2023-10-27 14:09:26.612648692  *************************************************************
2023-10-27 14:09:26.612652011  *************************************************************
2023-10-27 14:09:26.612656420  ***    Your config file is not valid!                     ***
2023-10-27 14:09:26.612658855  ***    Please check the docs at                           ***
2023-10-27 14:09:26.612660507  ***    https://docs.frigate.video/configuration/index     ***
2023-10-27 14:09:26.612681826  *************************************************************
2023-10-27 14:09:26.612683328  *************************************************************
2023-10-27 14:09:26.612703709  ***    Config Validation Errors                           ***
2023-10-27 14:09:26.612705345  *************************************************************
2023-10-27 14:09:26.612706618  'ffmpeg'
2023-10-27 14:09:26.616036914  Traceback (most recent call last):
2023-10-27 14:09:26.616040500    File "/opt/frigate/frigate/app.py", line 351, in start
2023-10-27 14:09:26.616041963      self.init_config()
2023-10-27 14:09:26.616043562    File "/opt/frigate/frigate/app.py", line 80, in init_config
2023-10-27 14:09:26.616045103      user_config = FrigateConfig.parse_file(config_file)
2023-10-27 14:09:26.616046657    File "/opt/frigate/frigate/config.py", line 1078, in parse_file
2023-10-27 14:09:26.616048021      return cls.parse_obj(config)
2023-10-27 14:09:26.616049393    File "pydantic/main.py", line 526, in pydantic.main.BaseModel.parse_obj
2023-10-27 14:09:26.616050798    File "pydantic/main.py", line 339, in pydantic.main.BaseModel.__init__
2023-10-27 14:09:26.616053324    File "pydantic/main.py", line 1076, in pydantic.main.validate_model
2023-10-27 14:09:26.616054833    File "pydantic/fields.py", line 886, in pydantic.fields.ModelField.validate
2023-10-27 14:09:26.616088996    File "pydantic/fields.py", line 1021, in pydantic.fields.ModelField._validate_mapping_like
2023-10-27 14:09:26.616090637    File "pydantic/fields.py", line 1094, in pydantic.fields.ModelField._validate_singleton
2023-10-27 14:09:26.616105685    File "pydantic/fields.py", line 884, in pydantic.fields.ModelField.validate
2023-10-27 14:09:26.616107375    File "pydantic/fields.py", line 1101, in pydantic.fields.ModelField._validate_singleton
2023-10-27 14:09:26.616109025    File "pydantic/fields.py", line 1157, in pydantic.fields.ModelField._apply_validators
2023-10-27 14:09:26.616110688    File "pydantic/class_validators.py", line 337, in pydantic.class_validators._generic_validator_basic.lambda13
2023-10-27 14:09:26.616112189    File "pydantic/main.py", line 711, in pydantic.main.BaseModel.validate
2023-10-27 14:09:26.616113648    File "/opt/frigate/frigate/config.py", line 635, in __init__
2023-10-27 14:09:26.616114994      if len(config["ffmpeg"]["inputs"]) == 1:
2023-10-27 14:09:26.616130282  KeyError: 'ffmpeg'
2023-10-27 14:09:26.616131532  
2023-10-27 14:09:26.616132983  *************************************************************
2023-10-27 14:09:26.616134356  ***    End Config Validation Errors                       ***
2023-10-27 14:09:26.616135908  *************************************************************
2023-10-27 14:09:27.842961870  [INFO] Service Frigate exited with code 1 (by signal 0)
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service nginx: stopping
s6-rc: info: servic

FFprobe output from your camera

Frigate is not starting...

Frigate stats

No response

Operating system

HassOS

Install method

HassOS Addon

Coral version

USB

Network connection

Wired

Camera make and model

Wyze, Reolink

Any other information that may be helpful

No response

NickM-27 commented 1 year ago

your indentation is inconsistent, spacing should always be done in increments of 2 spaces, but some parts of your config only have 1 space

awwbaker commented 1 year ago

I went through and double checked two space indents (I missed this in the "Getting Started Section." I will paste my working file below if it perhaps helps someone.

mqtt: host: 192.168.4.23 user: mqtt_user password: mqtt_user

detectors: coral: type: edgetpu device: usb

go2rtc: streams: garage:

FigJam23 commented 1 year ago

Try this hopefully helps


host: 192.168.4.23
user: mqtt_user
password: mqtt_user

detectors:
  coral:
    type: edgetpu
    device: usb

go2rtc:
  streams:
    garage:
      - rtsp://192.168.4.23:8554/garage
    breezeway:
      - rtsp://192.168.4.23:8554/breezeway
    front_door_main:
      - rtsp://admin:XXXX@192.168.4.117:554/h264Preview_01_main
    front_door_sub:
      - rtsp://admin:XXXX@192.168.4.117:554/h264Preview_01_sub

snapshots:
  enabled: True
  clean_copy: True
  timestamp: True
  bounding_box: True
  retain:
    default: 10
    objects:
      person: 15

detect:
  enabled: True
  width: 1280
  height: 720
  fps: 10

ffmpeg:
  hwaccel_args: preset-vaapi

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

cameras:
  front_door_main:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/front_door_main
      roles:
        - record
        - rtmp

  front_door_sub:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/front_door_sub
      roles:
        - detect

  breezeway:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/breezeway
      roles:
        - record
        - rtmp
        - detect
      objects:
        track:
          - person
          - dog
      zones:
        deerzone:
          coordinates: 407,720,0,720,0,468,412,193,476,191

  garage:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/garage
      roles:
        - record
        - rtmp
        - detect
github-actions[bot] commented 11 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.