Struggling trying to setup Frigate

I’m having a heck of a time trying to set up Frigate.

My HA is in a Proxmox VM. I’ve installed MQTT and the broker. My camera is an Amcrest and is set up (I already use Blue Iris). It’s showing in HA Entities. Frigate NVR (Full Access) addon is installed. I’ve added frigate.yml to config and added camera and MQTT info. No matter what I do I can’t integrate Frigate. I keep getting, “Failed to connect”. I’ve tried so many things that I forget where I am. Very frustrating.

I’ll include below my log from the Frigate addon and some screenshots of my setup. Could someone take a look and, perhaps, tell me where I’m screwing up?

Here’s the Frigate log:
[s6-init] making user provided files available at /var/run/s6/etc…exited 0.
[s6-init] ensuring user provided files have correct perms…exited 0.
[fix-attrs.d] applying ownership & permissions fixes…
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts…
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[2022-08-15 07:34:16] frigate.app INFO : Starting Frigate (0.10.1-83481af)



*** Your config file is not valid! ***
*** Please check the docs at ***
*** Configuration File | Frigate ***



*** Config Validation Errors ***


while parsing a block collection
in “”, line 2, column 3:
- host: 192.168.88.121
^
expected , but found ‘?’
in “”, line 7, column 3:
host: mqtt.server.com
^
Traceback (most recent call last):
File “/opt/frigate/frigate/app.py”, line 312, in start
self.init_config()
File “/opt/frigate/frigate/app.py”, line 77, in init_config
user_config = FrigateConfig.parse_file(config_file)
File “/opt/frigate/frigate/config.py”, line 900, in parse_file
config = yaml.safe_load(raw_config)
File “/usr/local/lib/python3.8/dist-packages/yaml/init.py”, line 162, in safe_load
return load(stream, SafeLoader)
File “/usr/local/lib/python3.8/dist-packages/yaml/init.py”, line 114, in load
return loader.get_single_data()
File “/usr/local/lib/python3.8/dist-packages/yaml/constructor.py”, line 49, in get_single_data
node = self.get_single_node()
File “/usr/local/lib/python3.8/dist-packages/yaml/composer.py”, line 36, in get_single_node
document = self.compose_document()
File “/usr/local/lib/python3.8/dist-packages/yaml/composer.py”, line 55, in compose_document
node = self.compose_node(None, None)
File “/usr/local/lib/python3.8/dist-packages/yaml/composer.py”, line 84, in compose_node
node = self.compose_mapping_node(anchor)
File “/usr/local/lib/python3.8/dist-packages/yaml/composer.py”, line 133, in compose_mapping_node
item_value = self.compose_node(node, item_key)
File “/usr/local/lib/python3.8/dist-packages/yaml/composer.py”, line 82, in compose_node
node = self.compose_sequence_node(anchor)
File “/usr/local/lib/python3.8/dist-packages/yaml/composer.py”, line 110, in compose_sequence_node
while not self.check_event(SequenceEndEvent):
File “/usr/local/lib/python3.8/dist-packages/yaml/parser.py”, line 98, in check_event
self.current_event = self.state()
File “/usr/local/lib/python3.8/dist-packages/yaml/parser.py”, line 392, in parse_block_sequence_entry
raise ParserError(“while parsing a block collection”, self.marks[-1],
yaml.parser.ParserError: while parsing a block collection
in “”, line 2, column 3:
- host: 192.168.88.121
^
expected , but found ‘?’
in “”, line 7, column 3:
host: mqtt.server.com
^


*** End Config Validation Errors ***


[cmd] python3 exited 1
[cont-finish.d] executing container finish scripts…
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

A few screenshots:

Your config file is not valid. Read the frigate docs for examples.

It might be due to the mqtt: is too far intended to the right.

Thanks, yes, mqtt was too far to the right. I re-copied, pasted and restarted but it made no difference.

I’ve read the docs till I’m blue in the face and can’t figure it out.

The errors I see in the Frigate addon are:
1 validation error for FrigateConfig
amcrest
extra fields not permitted (type=value_error.extra)
Traceback (most recent call last):
File “/opt/frigate/frigate/app.py”, line 312, in start
self.init_config()
File “/opt/frigate/frigate/app.py”, line 77, in init_config
user_config = FrigateConfig.parse_file(config_file)
File “/opt/frigate/frigate/config.py”, line 904, in parse_file
return cls.parse_obj(config)
File “pydantic/main.py”, line 511, in pydantic.main.BaseModel.parse_obj
File “pydantic/main.py”, line 331, in pydantic.main.BaseModel.init
pydantic.error_wrappers.ValidationError: 1 validation error for FrigateConfig
amcrest
extra fields not permitted (type=value_error.extra)

I’m just not sure what they mean or where to even correct them.

Have read this?

You are not allowed to start with amcrest:

Something like

cameras:
  amcrest:

Yes, I thought I followed that. My frigate.yml file is in the root of config. So you’re saying frigate.yml shouldn’t start with:
amcrest:

  • host: 192.168.88.121
    username: xxxxxx
    password: xxxxxx

Is my frigate.yml completely wrong? Should amcrest be after mqtt:?

You dont need the amcrest section at all. I use Amcrest cameras also. Here is part of my config.

mqtt: 
  host: 192.168.86.193
  port: ****
  topic_prefix: frigate
  client_id: frigate
  user: ******
  password: ******
  stats_interval: 60

cameras: 
  porch_cam: 
    ffmpeg:
      inputs:
        - path: rtsp://admin:******@192.168.86.30:554/cam/realmonitor?channel=1&subtype=0
          roles: 
            - record
            - rtmp
        - path: rtsp://admin:******@192.168.86.30:554/cam/realmonitor?channel=1&subtype=1
          roles: 
            - detect
    detect:
      width: 640
      height: 480
      fps: 5

Hmmm, there seems to be multiple ways to connect and I don’t know enough to figure it out. I’m giving up on Frigate. Maybe I’ll come back when I know more.

Thanks all for the help.

I’d recommend referencing the Frigate / HA docs instead of whatever you were referencing to get setup, seems like some wires were definitely being crossed as the amcrest section looks like the HomeAssistant config which is entirely unrelated

Yeah, I was really confused. Still am but maybe it’ll become clearer as I get more used to HA.

Thanks.

So what’s the difference between Frigate and Frigate Full access.

This version of the add-on requests full device access in order to turn off protection mode for those devices which don't work with protection mode enabled.

I really don’t know what that means. When do i need one or the other?

Frigate Full Access has more access to your system. It is only needed if you have a coral or GPU which the normal addon is unable to see.

What’s wrong with my code pls? The problem is the same as thusband. Here is my frigate.yml code.

mqtt:
  host: 192.168.1.219
  user: *****
  password: *****

cameras:
  driveway_cam:
    ffmpeg:
      inputs:
        - path: rtsp://admin:*****@192.168.1.36:554/channel80
          roles: 
            - detect
    width: 1920
    height: 1080
    fps: 5
    
detectors: 
  cpu1:
    type: cpu
  cpu2:
    type: cpu

Here is my frigate error log.

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
*************************************************************
*************************************************************
***    Your config file is not valid!                     ***
***    Please check the docs at                           ***
***    https://docs.frigate.video/configuration/index     ***
*************************************************************
*************************************************************
***    Config Validation Errors                           ***
*************************************************************
3 validation errors for FrigateConfig
cameras -> driveway_cam -> fps
  extra fields not permitted (type=value_error.extra)
cameras -> driveway_cam -> height
  extra fields not permitted (type=value_error.extra)
cameras -> driveway_cam -> width
  extra fields not permitted (type=value_error.extra)
Traceback (most recent call last):
  File "/opt/frigate/frigate/app.py", line 332, in start
    self.init_config()
  File "/opt/frigate/frigate/app.py", line 82, in init_config
    user_config = FrigateConfig.parse_file(config_file)
  File "/opt/frigate/frigate/config.py", line 942, in parse_file
    return cls.parse_obj(config)
  File "pydantic/main.py", line 521, in pydantic.main.BaseModel.parse_obj
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 3 validation errors for FrigateConfig
cameras -> driveway_cam -> fps
  extra fields not permitted (type=value_error.extra)
cameras -> driveway_cam -> height
  extra fields not permitted (type=value_error.extra)
cameras -> driveway_cam -> width
  extra fields not permitted (type=value_error.extra)
*************************************************************
***    End Config Validation Errors                       ***
*************************************************************
[cmd] python3 exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.

I created frigate.yml the same level as configuration.yaml in studio code server. Pls answer me. I appreciate your help.

cameras:
  driveway_cam:
    ffmpeg:
      inputs:
        - path: rtsp://admin:*****@192.168.1.36:554/channel80
          roles: 
            - detect
    detect:
      width: 1920
      height: 1080
      fps: 5
1 Like

Thanks for helping me Deckoz. But still errors. Even I reduce width: 640 and height: 480. rtsp link also works in vlc player.

> [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
> [s6-init] ensuring user provided files have correct perms...exited 0.
> [fix-attrs.d] applying ownership & permissions fixes...
> [fix-attrs.d] done.
> [cont-init.d] executing container initialization scripts...
> [cont-init.d] done.
> [services.d] starting services
> [services.d] done.
> [2022-11-24 11:17:34] frigate.app                    INFO    : Starting Frigate (0.11.1-2eada21)
> [2022-11-24 11:17:34] frigate.app                    INFO    : Creating directory: /tmp/cache
> Starting migrations
> [2022-11-24 11:17:34] peewee_migrate                 INFO    : Starting migrations
> There is nothing to migrate
> [2022-11-24 11:17:34] peewee_migrate                 INFO    : There is nothing to migrate
> [2022-11-24 11:17:34] ws4py                          INFO    : Using epoll
> [2022-11-24 11:17:34] detector.cpu1                  INFO    : Starting detection process: 214
> [2022-11-24 11:17:34] detector.cpu2                  INFO    : Starting detection process: 216
> [2022-11-24 11:17:34] frigate.edgetpu                WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
> [2022-11-24 11:17:34] frigate.edgetpu                WARNING : CPU detectors are not recommended and should only be used for testing or for trial purposes.
> [2022-11-24 11:17:34] frigate.app                    INFO    : Output process started: 217
> [2022-11-24 11:17:34] frigate.app                    INFO    : Camera processor started for driveway_cam: 222
> [2022-11-24 11:17:34] frigate.app                    INFO    : Capture process started for driveway_cam: 223
> [2022-11-24 11:17:35] ws4py                          INFO    : Using epoll
> [2022-11-24 11:17:36] frigate.video                  ERROR   : driveway_cam: Unable to read frames from ffmpeg process.
> [2022-11-24 11:17:36] frigate.video                  ERROR   : driveway_cam: ffmpeg process is not running. exiting capture thread...
> [2022-11-24 11:17:54] watchdog.driveway_cam          ERROR   : Ffmpeg process crashed unexpectedly for driveway_cam.
> [2022-11-24 11:17:54] watchdog.driveway_cam          ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
> [2022-11-24 11:17:54] ffmpeg.driveway_cam.detect     ERROR   : [flv @ 0x55e42b258800] Video codec hevc not compatible with flv
> [2022-11-24 11:17:54] ffmpeg.driveway_cam.detect     ERROR   : Could not write header for output file #0 (incorrect codec parameters ?): Function not implemented
> [2022-11-24 11:17:54] ffmpeg.driveway_cam.detect     ERROR   : Error initializing output stream 0:0 -- 
> [2022-11-24 11:17:54] ffmpeg.driveway_cam.detect     ERROR   : 
> [2022-11-24 11:17:57] frigate.video                  ERROR   : driveway_cam: Unable to read frames from ffmpeg process.
> [2022-11-24 11:17:57] frigate.video                  ERROR   : driveway_cam: ffmpeg process is not running. exiting capture thread...
> [2022-11-24 11:18:04] watchdog.driveway_cam          ERROR   : Ffmpeg process crashed unexpectedly for driveway_cam.
> [2022-11-24 11:18:04] watchdog.driveway_cam          ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
> [2022-11-24 11:18:04] ffmpeg.driveway_cam.detect     ERROR   : [rtsp @ 0x55c7538fcbc0] DTS discontinuity in stream 0: packet 5 with DTS 150233874875172, packet 6 with DTS 150233874930716
> [2022-11-24 11:18:04] ffmpeg.driveway_cam.detect     ERROR   : [flv @ 0x55c753916340] Video codec hevc not compatible with flv
> [2022-11-24 11:18:04] ffmpeg.driveway_cam.detect     ERROR   : Could not write header for output file #0 (incorrect codec parameters ?): Function not implemented
> [2022-11-24 11:18:04] ffmpeg.driveway_cam.detect     ERROR   : Error initializing output stream 0:0 -- 
> [2022-11-24 11:18:04] ffmpeg.driveway_cam.detect     ERROR   : 
> [2022-11-24 11:18:06] frigate.video                  ERROR   : driveway_cam: Unable to read frames from ffmpeg process.
> [2022-11-24 11:18:06] frigate.video                  ERROR   : driveway_cam: Unable to read frames from ffmpeg process.
> [2022-11-24 11:18:06] frigate.video                  ERROR   : driveway_cam: ffmpeg process is not running. exiting capture thread...
> [2022-11-24 11:18:14] watchdog.driveway_cam          ERROR   : Ffmpeg process crashed unexpectedly for driveway_cam.
> [2022-11-24 11:18:14] watchdog.driveway_cam          ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
> [2022-11-24 11:18:14] ffmpeg.driveway_cam.detect     ERROR   : [flv @ 0x55cf2a736680] Video codec hevc not compatible with flv
> [2022-11-24 11:18:14] ffmpeg.driveway_cam.detect     ERROR   : Could not write header for output file #0 (incorrect codec parameters ?): Function not implemented
> [2022-11-24 11:18:14] ffmpeg.driveway_cam.detect     ERROR   : Error initializing output stream 0:0 -- 
> [2022-11-24 11:18:14] ffmpeg.driveway_cam.detect     ERROR   : 
> [2022-11-24 11:18:16] frigate.video                  ERROR   : driveway_cam: Unable to read frames from ffmpeg process.
> [2022-11-24 11:18:16] frigate.video                  ERROR   : driveway_cam: Unable to read frames from ffmpeg process.
> [2022-11-24 11:18:16] frigate.video                  ERROR   : driveway_cam: ffmpeg process is not running. exiting capture thread...
> [2022-11-24 11:18:24] watchdog.driveway_cam          ERROR   : Ffmpeg process crashed unexpectedly for driveway_cam.
> [2022-11-24 11:18:24] watchdog.driveway_cam          ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
> [2022-11-24 11:18:24] ffmpeg.driveway_cam.detect     ERROR   : [flv @ 0x55b31bb50800] Video codec hevc not compatible with flv
> [2022-11-24 11:18:24] ffmpeg.driveway_cam.detect     ERROR   : Could not write header for output file #0 (incorrect codec parameters ?): Function not implemented
> [2022-11-24 11:18:24] ffmpeg.driveway_cam.detect     ERROR   : Error initializing output stream 0:0 -- 
> [2022-11-24 11:18:24] ffmpeg.driveway_cam.detect     ERROR   : 
> [2022-11-24 11:18:26] frigate.video                  ERROR   : driveway_cam: Unable to read frames from ffmpeg process.
> [2022-11-24 11:18:26] frigate.video                  ERROR   : driveway_cam: ffmpeg process is not running. exiting capture thread...

Well now your configuration looks right(no more yaml errors). Probably the RTSP stream. Are you sure that’s the entire RTSP url?

1 Like

Like it says… [flv @ 0x55cf2a736680] Video codec hevc not compatible with flv

you need to disable RTMP since RTMP does not work with h.265

rtmp:
  enabled: false
3 Likes

Yayyy!!! I got it. That’s the point. Thanks crzynik.

1 Like

It helped me too! THANKS

we’re providing a new RTSP restream in the next version and deprecating RTMP since it causes so many problems