Frigate recording motion only?

I have frigate up and running and everything is working as it should.
It’s currently recording 24 hours a day which is filling my remaining storage very quickly…
Is there a way to configure to record motion only.

I’ve looked through loads of threads and can’t find the answer.

TIA

Here is my config file that is recording just the motion.

#Configuration for Frigate
mqtt:
  host: <redacted>
  user: <redacted>
  password: '<redacted>'
  #topic_prefix: frigate
#Camera
cameras:
  wans01:
    ffmpeg:
      inputs:
        - path: rtsp://camera:<redacted>@<redacted>/live/ch0
          roles:
            - detect
            - clips
    detect:
      width: 1280
      height: 720
      fps: 5
    objects:
      track:
        - person
        - car
        - dog
    snapshots:
      enabled: true
      timestamp: true
      bounding_box: true
      retain: 
        default: 2
    record:
      enabled: true
      retain: 
        days: 10

detectors:
  cpu1:
    type: cpu
  cpu2:
    type: cpu
  cpu3:
    type: cpu
  cpu4:
    type: cpu
  cpu5:
    type: cpu
1 Like

With frigate 0.10+ you just need to set record -> retain -> mode to motion instead of all (the default)

1 Like

This will retain 10 days of all recording segments since the default retain -> mode is all for recordings.

You’d want to set it to motion as above comment

1 Like

Thanks for the reply. I’ll test tonight and let you know if it worked.

Many thanks. This has worked although it did record motion for everything even though I have (under detect) objects to track as person.
Do I need to put something under (record)to stop this happening.

detect:
width: 640
height: 360
fps: 5
objects:
track:
- person
- cat
snapshots:
enabled: true
bounding_box: true
retain:
default: 2
record:
enabled: true
retain:
days: 10
mode: motion

motion:
  mask:
    - 640,252,640,0,0,0,0,125,418,108

The formatting has come out differently on copying it in this post. It is correct in my yml file

A snippet from mine:

  record:
      enabled: true
      retain:
        days: 14
        mode: motion
      events:
        retain:
          default: 14
          mode: active_objects
        pre_capture: 5
        post_capture: 8
        objects:
          - car
          - person
          - cat
          - dog
          - bear
        required_zones:
          - car_automation
          - parking_area
          - near_driveway
          - front_yard
1 Like

Thank you very much.
I’ll wait till tomorrow morning to see if it’s picks up any flying critters like it did last night.

Ps. I’ve left out the Bear tracking as we don’t have much use for this in the UK :grin::bear:

Its not going to stop that. Motion between the car and the camera will trigger the record. Youll just get a thumbnail in the events tab, but youll get a recording in recording tab. It wiont record constantly,
I think you could eliminate the motion mode and keep the active object mode to accomplish that, but Im not sure…

That’s because you put it under the record section which is for 24/7 recording. If you only want motion recorded for events (when frigate detects an object) then you would set record -> retain -> days to 0 and you would set record -> events -> retain -> default to 10 and record -> events -> retain -> mode to motion

2 Likes

Thanks
I keep get invalid config in the log.
Please could you lay it out for me how it would go in the yml file.

Thanks

Paste your current yaml file

I am following this thread because I am having the same problem understanding how to save only detected AI objects , not simply movement. ( I already have a nvr that record 24/24)
If I understand correctly if I want to record only events ( person cats dogs cars…ecc…) I have to put

record:
      enabled: true
      retain:
        days: 0
        mode: motion <--- I suppose I don't need this mode because it is referred to record.
      events:
        retain:
          default: 3  <--- number of days clips will be saved
          mode: active_objects

This config stay on top of the config file or inside of every camera configuration. If I understand correctly camera setting overrides the general setting.
Is it right?
Snapshot and clip are managed in the same way?

Thank you

2 Likes

That’s correct way to configure it. If you want that for all cameras just do it globally, override at Camera level for cameras you want to be different.

Snapshots work this way already and there’s no clips configuration anymore as that’s what record is for

1 Like

Thanks for all the tips.
Looks like I’ve got it now. :+1:t2:

I have the below configuration

detect:
  enabled: True
  width: 640
  height: 360
  fps: 5
snapshots:
  enabled: False
record:
  enabled: True
  retain:
    days: 5
    mode: motion
  events:
    retain:
      default: 5
      mode: active_objects
      objects:
        person: 5
        car: 5

It is global and there is no override configuration within the camera, however, it seems frigate is still recording 24x7. Anything I’m missing?

You have

which is telling frigate to record 24/7…

Apologies if I am misunderstanding the documentation.

Let’s say you have Frigate configured so that your doorbell camera would retain the last 2 days of 24/7 recording.

  • With the all option all 48 hours of those two days would be kept and viewable.
  • With the motion option the only parts of those 48 hours would be segments that Frigate detected motion. This is the middle ground option that won’t keep all 48 hours, but will likely keep all segments of interest along with the potential for some extra segments.
  • With the active_objects option the only segments that would be kept are those where there was a true positive object that was not considered stationary.

I interpreted this as “mode: all” will record 24x7, “mode: motion” will only record if motion is detected.

It will record 24/7 and keep every segment that has any motion detected. Motion can be car lights, leaves blowing, your cameras timestamp (which should be masked out), etc.

So your statement “it seems frigate is still recording 24/7” does not make sense, because that is what you are asking for.

What I meant is that it is recording 24x7 continuous (not just segments), even if there is no motion.

Now that you mentioned that the camera’s timestamp (which should be masked out), that maybe the reason it is recording all the time. I did not think about this one… will have to try it out.