Miscellaneous fixes (#25099)
CI / AMD64 Build (push) Waiting to run
CI / AMD64 Smoke Test (push) Blocked by required conditions
CI / ARM Build (push) Waiting to run
CI / Jetson Jetpack 6 (push) Waiting to run
CI / AMD64 Extra Build (push) Blocked by required conditions
CI / ARM Extra Build (push) Blocked by required conditions
CI / Synaptics Build (push) Blocked by required conditions
CI / Assemble and push default build (push) Blocked by required conditions

* encode notice ids in notice action urls

Notice ids went into the URL raw, so a detector on a repeated device like openvino:GPU#2 had everything after the # dropped as a fragment. The acknowledge, mute, and unhide requests 404'd and the buttons did nothing. The hooks now encode the id.

* re-sweep a replaced media volume despite the ownership sentinel

The boot sweep skipped whenever the sentinel in /config matched, so wiping or swapping /media/frigate while keeping the config volume left the new root-owned folder unswept and Frigate failed to create /media/frigate/recordings. The sentinel is now honored only when each volume root is still owned by the runtime user. Filesystems that accept chown without applying it (CIFS without setuids) get an unmanaged sentinel after a clean sweep so they don't re-sweep on every boot.

* don't seed relative move translation from a status without position

* disable relative movement when the camera doesn't report its position

* stop at startup when the database location isn't writable

The ownership sweep only covers /config and /media/frigate, so a database.path on another volume stayed root-owned after upgrading and Frigate boot-looped on a SQLite error. Frigate now checks the database directory and files before opening them and exits with an error naming the path, the runtime uid/gid, and the new docs section. backup.db is checked only when a migration is about to write it.

* add note about explicit detect resolution

* track where each camera's detect resolution came from

The health tab's stream check told users to set the detect resolution whenever a probe returned no size, even when they had already set it, and a camera running on the 1280x720 fallback after a failed startup probe was never flagged unless the stream check was run by hand. The config now records whether the resolution came from the config, a startup probe, or the fallback, and /api/config exposes it per camera. The stream check skips the probe warning when the resolution is set, a camera on the fallback gets a detect settings warning that also shows on the health tab, and cloning detect from a fallback camera no longer copies the fallback size.

* don't strip the fallback detect size when cloning

* free tracker state when an object is deregistered

deregister() removed the object from tracked_objects, disappeared and track_id_map but left its entries in positions, stationary_box_history and the stationary classifier's four per-object dicts, including a 96x96 anchor crop for every object that went stationary. Every object tracked since the camera process started stayed in memory. deregister() now pops those entries and calls a new StationaryMotionClassifier.forget() to clear the classifier's state.

* avoid opencv path leak on recurring image writes

OpenCV 4.11's Python bindings keep a reference to every path string passed to cv2.imwrite or cv2.imread (opencv/opencv#28047, fixed in 4.13, which needs numpy 2). Callers that write on every frame or event leaked one string per call for the life of the process, about 8 MB a day from preview frames on two cameras. New write_image and read_image helpers encode and decode in memory and do the file I/O through numpy, so OpenCV never sees the path. Preview frames, review and event thumbnails, face and classification training attempts, and the offline preview frame read now use them.
This commit is contained in:
Josh Hawkins
2026-11-30 11:36:04 -07:00
committed by GitHub
parent a08e95685d
commit b15caecfc5
33 changed files with 561 additions and 85 deletions
+7 -5
View File
@@ -83,12 +83,12 @@ A camera is enabled by default but can be disabled by using `enabled: False`. Ca
Each role can only be assigned to one input per camera. The options for roles are as follows:
| Role | Description |
| ------------ | ------------------------------------------------------------------------------------------------------------ |
| `detect` | Main feed for object detection. [docs](object_detectors.md) |
| `record` | Saves segments of the video feed based on configuration settings. [docs](record.md) |
| Role | Description |
| ------------ | --------------------------------------------------------------------------------------------------------------- |
| `detect` | Main feed for object detection. [docs](object_detectors.md) |
| `record` | Saves segments of the video feed based on configuration settings. [docs](record.md) |
| `record_sub` | Saves segments of a second, lower quality stream with its own retention. [docs](record.md#sub-stream-recording) |
| `audio` | Feed for audio based detection. [docs](audio_detectors.md) |
| `audio` | Feed for audio based detection. [docs](audio_detectors.md) |
<ConfigTabs>
<TabItem value="ui">
@@ -160,6 +160,8 @@ If you only define one stream in your `inputs` and do not assign a `detect` role
If you plan to use Frigate for recording only, it is still recommended to define a `detect` role for a low resolution stream to minimize resource usage from the required stream decoding.
Setting the `detect` `width` and `height` explicitly is recommended. When they are unset, Frigate probes the detect stream at every startup, which can add several seconds per camera. Cameras added with the [Add Camera Wizard](#adding-a-camera-with-the-add-camera-wizard) have them set automatically.
:::
For camera model specific settings check the [camera specific](camera_specific.md) infos.
+11 -1
View File
@@ -86,6 +86,16 @@ Once the volumes are aligned, start Frigate normally. A file at `/config/.permis
If something under your volumes can't be chowned, a read-only btrfs snapshot directory for example, the sweep warns and names the path and doesn't record the migration as finished. It retries on the next boot instead. Either move those paths outside `/media/frigate` or expect the scan to repeat.
### Custom database location
The sweep only covers `/config` and `/media/frigate`. If `database.path` points somewhere else, such as a separate volume, align that directory yourself before upgrading, and again after running with `FRIGATE_RUN_AS_ROOT=true`:
```bash
chown -R 1000:1000 /path/to/your/database/dir
```
Use your `PUID` and `PGID` if you've changed them. Until the directory and its files are writable, Frigate stops at startup with an error naming the path it can't write.
### Network storage
Recordings on a NAS behave differently, so check what you have before migrating:
@@ -94,7 +104,7 @@ Recordings on a NAS behave differently, so check what you have before migrating:
findmnt -T /path/to/your/storage -o TARGET,FSTYPE,OPTIONS
```
**SMB and CIFS** don't store per-file ownership at all. It's synthesized from the mount options, so a per-file `chown` fails and isn't needed. Mount the share as the uid and gid Frigate runs as, and every file already looks correct to the sweep:
**SMB and CIFS** don't store per-file ownership at all. It's synthesized from the mount options, so a per-file `chown` has no effect and isn't needed. Mount the share as the uid and gid Frigate runs as, and every file already looks correct to the sweep:
```
//nas/frigate /media/frigate cifs credentials=/root/.smb,uid=1000,gid=1000,file_mode=0664,dir_mode=0775 0 0