Add time-window based recording retention

Adds ability to filter recordings by time windows after a configurable
retention period. Useful for reducing storage while keeping recordings
during relevant times (e.g., business hours).

New config options under record.motion (and record.continuous):
- days: maximum retention in days (null for unlimited, 0 for none)
- hours: list of time windows like "mon-fri 07:00-18:00"
- always_retain: hours to keep all recordings before filtering (default 24)

Recordings associated with alerts/detections are always retained
regardless of time windows.
This commit is contained in:
kllnspr3
2026-01-02 18:58:17 +00:00
parent d1f28eb8e1
commit fa87b8830a
5 changed files with 313 additions and 27 deletions
+26 -1
View File
@@ -95,6 +95,29 @@ record:
Continuous recording supports different retention modes [which are described below](#what-do-the-different-retain-modes-mean)
### Time-Window Based Retention
Recordings can be filtered to only retain footage from specific time windows after an initial period.
```yaml
record:
enabled: True
motion:
days: 14
always_retain: 48
hours:
- "mon-fri 07:00-23:00"
- "sat-sun 10:00-18:00"
```
Supported formats for `hours`:
- `"07:00-23:00"` - all days
- `"mon-fri 07:00-18:00"` - day range
- `"sat 10:00-16:00"` - single day
- `"22:00-06:00"` - overnight
Alerts and detections are always retained regardless of time windows.
### Object Recording
The number of days to record review items can be specified for review items classified as alerts as well as tracked objects.
@@ -116,7 +139,9 @@ This configuration will retain recording segments that overlap with alerts and d
## Can I have "continuous" recordings, but only at certain times?
Using Frigate UI, Home Assistant, or MQTT, cameras can be automated to only record in certain situations or at certain times.
Yes! You can use time-window based retention to keep recordings only from specific hours. See [Time-Window Based Retention](#time-window-based-retention) above.
Alternatively, using Frigate UI, Home Assistant, or MQTT, cameras can be automated to only record in certain situations or at certain times.
## How do I export recordings?
+18
View File
@@ -517,13 +517,31 @@ record:
# Optional: Number of days to retain recordings regardless of tracked objects or motion (default: shown below)
# NOTE: This should be set to 0 and retention should be defined in alerts and detections section below
# if you only want to retain recordings of alerts and detections.
# Set to null for unlimited retention.
days: 0
# Optional: Time windows to retain recordings (default: not set, keep all times)
# After always_retain period, only recordings within these windows are kept.
# Format: "HH:MM-HH:MM" or "mon-fri HH:MM-HH:MM" or "sat HH:MM-HH:MM"
hours:
- "mon-fri 07:00-23:00"
- "sat-sun 10:00-18:00"
# Optional: Hours to retain all recordings before applying time window filter (default: shown below)
always_retain: 24
# Optional: Motion retention settings
motion:
# Optional: Number of days to retain recordings regardless of tracked objects (default: shown below)
# NOTE: This should be set to 0 and retention should be defined in alerts and detections section below
# if you only want to retain recordings of alerts and detections.
# Set to null for unlimited retention.
days: 0
# Optional: Time windows to retain recordings (default: not set, keep all times)
# After always_retain period, only recordings within these windows are kept.
# Format: "HH:MM-HH:MM" or "mon-fri HH:MM-HH:MM" or "sat HH:MM-HH:MM"
hours:
- "mon-fri 07:00-23:00"
- "sat-sun 10:00-18:00"
# Optional: Hours to retain all recordings before applying time window filter (default: shown below)
always_retain: 24
# Optional: Recording Export Settings
export:
# Optional: Timelapse Output Args (default: shown below).