Frigate Config

Strange. After editing, still nothing.
The clips might be from an older video perhaps.

So far i’ve got this, and a loading page which will give me an error at the end.

cameras:
  voortuin:
    ffmpeg:
      inputs:
        - path: rtsp://user:[email protected]:554/Streaming/Channels/102/ # <-- 102 substream
          roles:
            - detect
        - path: rtsp://user:[email protected]:554/Streaming/Channels/101/ # <-- 101 mainstream
          roles:
            - record
    detect:
      width: 640
      height: 480
      fps: 5
    objects:
      track:
        - person
    snapshots:
      enabled: true
      timestamp: false
      bounding_box: true
      retain:
        default: 2
    record:
      enabled: false
      retain:
        default: 2
      pre_capture: 3
    motion:
      mask:
        - 0,2160,602,2160,820,2035,820,1976,528,1907,304,1740,155,1662,0,1740
        - 2088,692,2210,769,2088,836,1941,851,1944,729
        - 350,437,758,281,1049,174,996,0,517,0,280,0,0,0,0,170,0,471,0,628

OK, can you post up the error logs from frigate as that will be the key to what it is not happy about?

*************************************************************
*************************************************************
***    Your config file is not valid!                     ***
***    Please check the docs at                           ***
***    https://docs.frigate.video/configuration/index     ***
*************************************************************
*************************************************************
***    Config Validation Errors                           ***
*************************************************************
2 validation errors for FrigateConfig
cameras -> Voortuin -> record -> pre-capture
  extra fields not permitted (type=value_error.extra)
cameras -> Voortuin -> snapshots -> retain -> days
  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: 2 validation errors for FrigateConfig
cameras -> Voortuin -> record -> pre-capture
  extra fields not permitted (type=value_error.extra)
cameras -> Voortuin -> snapshots -> retain -> days
  extra fields not permitted (type=value_error.extra)
*************************************************************
***    End Config Validation Errors                       ***
*************************************************************

Try this:

cameras:
  voortuin:
    ffmpeg:
      inputs:
        - path: rtsp://user:[email protected]:554/Streaming/Channels/102/ # <-- 102 substream
          roles:
            - detect
        - path: rtsp://user:[email protected]:554/Streaming/Channels/101/ # <-- 101 mainstream
          roles:
            - record
    detect:
      width: 640
      height: 480
      fps: 5
    objects:
      track:
        - person
    snapshots:
      enabled: true
      timestamp: false
      bounding_box: true
      retain:
        default: 2
    record:
      enabled: false
      retain:
        days: 2
	  events:
		pre_capture: 3
    motion:
      mask:
        - 0,2160,602,2160,820,2035,820,1976,528,1907,304,1740,155,1662,0,1740
        - 2088,692,2210,769,2088,836,1941,851,1944,729
        - 350,437,758,281,1049,174,996,0,517,0,280,0,0,0,0,170,0,471,0,628

Still no luck :frowning:
It doesn’t like the snapshots part with the retain: default: 2

TYPO on my behalf, this section should be:

    record:
      enabled: false
      retain:
        default: 2 
	  events:
		pre_capture: 3

I see no issues with the section of yaml, you have now posted, can you correct the above as per my typo, reload frigate and post up your full frigate.yaml and the current error logs once restarted?

*************************************************************

*************************************************************

***    Your config file is not valid!                     ***

***    Please check the docs at                           ***

***    https://docs.frigate.video/configuration/index     ***

*************************************************************

*************************************************************

***    Config Validation Errors                           ***

*************************************************************

1 validation error for FrigateConfig

cameras -> voortuin -> record -> retain -> default

  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

cameras -> voortuin -> record -> retain -> default

  extra fields not permitted (type=value_error.extra)

*************************************************************

***    End Config Validation Errors                       ***

*************************************************************
cameras:
  voortuin:
    ffmpeg:
      inputs:
        - path: rtsp://user:[email protected]:554/Streaming/Channels/102/ # <-- 102 substream
          roles:
            - detect
        - path: rtsp://user:[email protected]:554/Streaming/Channels/101/ # <-- 101 mainstream
          roles:
            - record
    detect:
      width: 640
      height: 480
      fps: 5
    objects:
      track:
        - person
    snapshots:
      enabled: true
      timestamp: false
      bounding_box: true
      retain:
        default: 2
    record:
      enabled: false
      retain:
       default: 2
      events:
        pre_capture: 3
    motion:
      mask:
        - 0,2160,602,2160,820,2035,820,1976,528,1907,304,1740,155,1662,0,1740
        - 2088,692,2210,769,2088,836,1941,851,1944,729
        - 350,437,758,281,1049,174,996,0,517,0,280,0,0,0,0,170,0,471,0,628
        - 2777,1410,2637,1702,2135,1484,2285,1196

Ok well look at the configuration on the page I linked for you, it appears that under record, retain you list days and under event retain you list default.

That’s your issue

Not sure if it matters but you didn’t double space default under recordings

EDIT

“extra fields not permitted” Usually means you have have something that does not belong or indent/punctuation error I believe

2 Likes

I think it’s working now:

cameras:
  voortuin:
    ffmpeg:
      inputs:
        - path: rtsp://user:[email protected]:554/Streaming/Channels/102/ # <-- 102 substream
          roles:
            - detect
            - rtmp
        - path: rtsp://user:[email protected]:554/Streaming/Channels/101/ # <-- 101 mainstream
          roles:
            - record
    detect:
      width: 640
      height: 480
      fps: 5
    objects:
      track:
        - person
    snapshots:
      enabled: true
      timestamp: false
      bounding_box: true
      retain:
        default: 2
    record:
      enabled: True
      events:
        retain:
          default: 10
    motion:
      mask:
        - 0,2160,602,2160,820,2035,820,1976,528,1907,304,1740,155,1662,0,1740
        - 2088,692,2210,769,2088,836,1941,851,1944,729
        - 350,437,758,281,1049,174,996,0,517,0,280,0,0,0,0,170,0,471,0,628
        - 2777,1410,2637,1702,2135,1484,2285,1196
        - 1826,228,1855,388,1935,547,1807,637,1586,661,1484,535,1312,347

Still don’t know exactly were it went wrong, but the feed’s are what they supposed to be :slight_smile:

So apparently i was wrong.
In a strange way it now doesn’t record or snapshot anythiny.

Any advise on what could be wrong in my last config post?

Are there errors still?

If yes, must fix error cause

If no, verify the global record settings in config allow recording as you desire. 24/7 or motion only. Then verify any specific record config for each camera. If nothing set it will use global.

Regarding snapshot that could be related to detect settings. If it not detect it not snapshot if I remember correctly.

Hi tmjpugh,

There are no errors anymore.
Late night i cheched the masks once more, and saw after changing detect from my 4k mainstream to my 640 substream the full screen was masked :dizzy_face:

Recording seems to work good now, as i was recorded leaving the house in full 4k.

The only thing i struggling with now is the fact that the “Snapshots” are also taken in 640x480

Yeah
It uses detect role and the low res is horrible. I think I tried high res detect and ran into issues(inference speed) but really cant remember

Ah that’s to bad.
My inference speed is now at around a constant 8, but those snaptshots are awefull… Almost useless… Would be nice if the snapshots could be taken from the record stream.

This is difficult since the streams can be out of sync and it won’t be the same moment. Also taking snapshots requires decoding the stream which will require a lot of CPU resources to decode both streams for every camera.

The middle solution is to use the 4k stream for detect but to set the resolution in

detect:
  width: half-4k
  height: half-4k

this will use more CPU but inference speeds shouldn’t be affected and the snapshots will be higher quality

I did not realize it was possible to scale down detect input. I thought this was actual resolution not just preferred. Amazing!!!

Yes, it just takes considerable CPU resources to do so, not for machines that don’t have the power

this is why, the ideal camera for frigate has a configurable substream as well as mainstream

Witam serdecznie jestem nowicjuszem jeżeli chodzi o Frigate .
Może ktoś mi podpowie dlaczego mam zielony obraz ??

Hello, I am a newcomer to Frigate.
Maybe someone will tell me why I have a green picture ??