Recording
Recordings can be enabled and are stored at /media/frigate/recordings. The folder structure for the recordings is YYYY-MM-DD/HH/<camera_name>/MM.SS.mp4 in UTC time. These recordings are written directly from your camera stream without re-encoding. Each camera supports a configurable retention policy. Frigate chooses the largest matching retention value between the recording retention and the tracked object retention when determining if a recording should be removed.
New recording segments are written from the camera stream to cache, they are only moved to disk if they match the setup recording retention policy.
To keep a specific clip beyond your retention window, export it rather than increasing retention for the whole camera. Exports are saved separately and are never removed by retention.
H265 recordings can be viewed in Chrome 108+, Edge and Safari only. All other browsers require recordings to be encoded with H264.
Common recording configurationsâ
Most conservative: Ensure all video is savedâ
For users deploying Frigate in environments where it is important to have contiguous video stored even if there was no detectable motion, the following configuration will store all video for 3 days. After 3 days, only video containing motion will be saved for 7 days. After 7 days, only video containing motion and overlapping with alerts or detections will be retained until 30 days have passed.
- Frigate UI
- YAML
Navigate to SettingsâGlobal configurationâRecording.
- Set Enable recording to on
- Set Continuous retention > Retention days to
3 - Set Motion retention > Retention days to
7 - Set Alert retention > Event retention > Retention days to
30 - Set Alert retention > Event retention > Retention mode to
all - Set Detection retention > Event retention > Retention days to
30 - Set Detection retention > Event retention > Retention mode to
all
record:
enabled: True
continuous:
days: 3
motion:
days: 7
alerts:
retain:
days: 30
mode: all
detections:
retain:
days: 30
mode: all
Reduced storage: Only saving video when motion is detectedâ
To reduce storage requirements, configure recording to only retain video where motion or activity was detected.
- Frigate UI
- YAML
Navigate to SettingsâGlobal configurationâRecording.
- Set Enable recording to on
- Set Motion retention > Retention days to
3 - Set Alert retention > Event retention > Retention days to
30 - Set Alert retention > Event retention > Retention mode to
motion - Set Detection retention > Event retention > Retention days to
30 - Set Detection retention > Event retention > Retention mode to
motion
record:
enabled: True
motion:
days: 3
alerts:
retain:
days: 30
mode: motion
detections:
retain:
days: 30
mode: motion
Minimum: Alerts onlyâ
If you only want to retain video that occurs during activity caused by tracked object(s), this configuration will discard video unless an alert is ongoing.
- Frigate UI
- YAML
Navigate to SettingsâGlobal configurationâRecording.
- Set Enable recording to on
- Set Continuous retention > Retention days to
0 - Set Alert retention > Event retention > Retention days to
30 - Set Alert retention > Event retention > Retention mode to
motion
record:
enabled: True
continuous:
days: 0
alerts:
retain:
days: 30
mode: motion
Pre-capture and Post-captureâ
The pre_capture and post_capture settings control how many seconds of video are included before and after an alert or detection. These can be configured independently for alerts and detections, and can be set globally or overridden per camera.
- Frigate UI
- YAML
Navigate to SettingsâGlobal configurationâRecording for global defaults, or SettingsâCamera configurationâ(select camera)âRecording to override for a specific camera.
| Field | Description |
|---|---|
| Alert retention > Pre-capture seconds | Seconds of video to include before an alert event |
| Alert retention > Post-capture seconds | Seconds of video to include after an alert event |
| Detection retention > Pre-capture seconds | Seconds of video to include before a detection event |
| Detection retention > Post-capture seconds | Seconds of video to include after a detection event |
record:
enabled: True
alerts:
pre_capture: 5 # seconds before the alert to include
post_capture: 5 # seconds after the alert to include
detections:
pre_capture: 5 # seconds before the detection to include
post_capture: 5 # seconds after the detection to include
- Default: 5 seconds for both pre and post capture.
- Pre-capture maximum: 60 seconds.
- These settings apply per review category (alerts and detections), not per object type.
How pre/post capture interacts with retention modeâ
The pre_capture and post_capture values define the time window around a review item, but only recording segments that also match the configured retention mode are actually kept on disk.
mode: all: Retains every segment within the capture window, regardless of whether motion was detected.mode: motion(default): Only retains segments within the capture window that contain motion. This includes segments with active tracked objects, since object motion implies motion. Segments without any motion are discarded even if they fall within the pre/post capture range.mode: active_objects: Only retains segments within the capture window where tracked objects were actively moving. Segments with general motion but no active objects are discarded.
This means that with the default motion mode, you may see less footage than the configured pre/post capture duration if parts of the capture window had no motion.
To guarantee the full pre/post capture duration is always retained:
record:
enabled: True
alerts:
pre_capture: 10
post_capture: 10
retain:
days: 30
mode: all # retains all segments within the capture window
Because recording segments are written in 10 second chunks, pre-capture timing depends on segment boundaries. The actual pre-capture footage may be slightly shorter or longer than the exact configured value.
Where to view pre/post capture footageâ
Pre and post capture footage is included in the recording timeline, visible in the History view. Note that pre/post capture settings only affect which recording segments are retained on disk. They do not change the start and end points shown in the UI. The History view will still center on the review item's actual time range, but you can scrub backward and forward through the retained pre/post capture footage on the timeline. The Explore view shows object-specific clips that are trimmed to when the tracked object was actually visible, so pre/post capture time will not be reflected there.
Configuring Recording Retentionâ
Frigate supports both continuous and tracked object based recordings with separate retention modes and retention periods.
Retention configs support decimals meaning they can be configured to retain 0.5 days, for example.
Continuous and Motion Recordingâ
The number of days to retain continuous and motion recordings can be configured. By default, continuous recording is disabled.
- Frigate UI
- YAML
Navigate to SettingsâGlobal configurationâRecording.
| Field | Description |
|---|---|
| Enable recording | Enable or disable recording for all cameras |
| Continuous retention > Retention days | Number of days to keep continuous recordings |
| Motion retention > Retention days | Number of days to keep motion recordings |
record:
enabled: True
continuous:
days: 1 # <- number of days to keep continuous recordings
motion:
days: 2 # <- number of days to keep motion recordings
Continuous recording supports different retention modes which are described below.