Commit Graph

5515 Commits

Author SHA1 Message Date
Josh Hawkins
86bfe11885
Merge 78bc11d7e0 into 722ef6a1fe 2026-03-16 18:46:09 +00:00
Josh Hawkins
78bc11d7e0 formatting 2026-03-16 13:46:04 -05:00
Josh Hawkins
56679a041b publish camera state when changing profiles 2026-03-16 13:41:30 -05:00
Josh Hawkins
eeeec2db86 don't require restart for camera enabled change for profiles 2026-03-16 13:35:26 -05:00
Josh Hawkins
b1081d7217 formatting 2026-03-16 13:17:17 -05:00
Josh Hawkins
3a08b3d54b fix zones
- Fix zone colors not matching across profiles by falling back to base zone color when profile zone data lacks a color field
- Use base_config for base-layer values in masks/zones view so profile-merged values don't pollute the base config editing view
- Handle zones separately in profile manager snapshot/restore since ZoneConfig requires special serialization (color as private attr, contour generation)
- Inherit base zone color and generate contours for profile zone overrides in profile manager
2026-03-16 13:14:58 -05:00
Josh Hawkins
d41d328a9b use rasterized_mask as field
makes it easier to exclude from the schema with exclude=True
prevents leaking of the field when using model_dump for profiles
2026-03-16 12:43:45 -05:00
Josh Hawkins
80239a8017 fix settings showing profile-merged values when editing base config
When a profile is active, the in-memory config contains effective
(profile-merged) values. The settings UI was displaying these merged
values even when the "Base Config" view was selected.

Backend: snapshot pre-profile base configs in ProfileManager and expose
them via a `base_config` key in the /api/config camera response when a
profile is active. The top-level sections continue to reflect the
effective running config.

Frontend: read from `base_config` when available in BaseSection,
useConfigOverride, useAllCameraOverrides, and prepareSectionSavePayload.
Include formData labels in Object/Audio switches widgets so that labels
added only by a profile override remain visible when editing that profile.
2026-03-16 12:23:07 -05:00
ryzendigo
722ef6a1fe
fix: wrong index for FPS replacement in preset-http-jpeg-generic (#22465)
Some checks are pending
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
CI / AMD64 Build (push) Waiting to run
CI / ARM Build (push) Waiting to run
CI / Jetson Jetpack 6 (push) Waiting to run
parse_preset_input() uses input[len(_user_agent_args) + 1] to find
the FPS placeholder, but preset-http-jpeg-generic does not include
_user_agent_args at the start of its list (only preset-http-mjpeg-generic
does). The FPS placeholder '{}' is at index 1, not index 3.

This means the detect_fps value overwrites '-1' (the stream_loop
argument) instead of the '{}' FPS placeholder, so the preset always
uses the literal string '{}' as the framerate.
2026-03-16 09:57:14 -06:00
ryzendigo
bd289f3146
fix: pass ffmpeg_path to birdseye encode preset format string (#22462)
When hwaccel_args is a list (not a preset string), the fallback in
parse_preset_hardware_acceleration_encode() calls
arg_map["default"].format(input, output) with only 2 positional args.
But PRESETS_HW_ACCEL_ENCODE_BIRDSEYE["default"] contains {0}, {1}, {2}
expecting ffmpeg_path as the first arg.

This causes IndexError: Replacement index 2 out of range for size 2
which crashes create_config.py on every go2rtc start, taking down
all camera streams.

Pass ffmpeg_path as the first argument to match the preset template.
2026-03-16 09:57:04 -06:00
ryzendigo
c08ec9652f
fix: swap shape indices in birdseye custom logo assignment (#22463)
In BirdsEyeFrameManager.__init__(), the numpy slice that copies the
custom logo (transparent_layer from custom.png alpha channel) onto
blank_frame has shape[0] and shape[1] swapped:

  blank_frame[y:y+shape[1], x:x+shape[0]] = transparent_layer

shape[0] is rows (height) and shape[1] is cols (width), so the row
range needs shape[0] and the column range needs shape[1]:

  blank_frame[y:y+shape[0], x:x+shape[1]] = transparent_layer

The bug is masked for square images where shape[0]==shape[1]. For
non-square images (e.g. 1920x1080), it produces:

  ValueError: could not broadcast input array from shape (1080,1920)
  into shape (1620,1080)

This silently kills the birdseye output process -- no frames are
written to the FIFO pipe, go2rtc exec ffmpeg times out, and the
birdseye restream shows a black screen with no errors in the UI.
2026-03-16 06:48:54 -06:00
ryzendigo
7485b48f0e
fix: iterator exhausted by debug log prevents event cleanup (#22469)
In both expire_snapshots() and expire_clips(), the expired_events
query uses .iterator() for lazy evaluation, but the very next line
calls list(expired_events) inside an f-string for debug logging.
This consumes the entire iterator, so the subsequent for loop that
deletes media files from disk iterates over an exhausted iterator
and processes zero events.

Snapshots and clips for removed cameras are never deleted from disk,
causing gradual disk space exhaustion.

Materialize the iterator into a list before logging so both the
debug message and the cleanup loop use the same data.
2026-03-16 06:48:35 -06:00
ryzendigo
6d7b1ce384
fix: inverted condition causes division by zero in velocity direction check (#22470)
The cosine similarity calculation is guarded by:
  if not np.any(np.linalg.norm(velocities, axis=1))

This enters the block when ALL velocity norms are zero, then divides
by those zero norms. The condition should check that all norms are
non-zero before computing cosine similarity:
  if np.all(np.linalg.norm(velocities, axis=1))

Also fixes debug log that shows average_velocity[0] for both x and y
velocity components (second should be average_velocity[1]).
2026-03-16 06:47:24 -06:00
ryzendigo
e80da2b297
fix: WebSocket connection leaked on WebRTC player cleanup (#22473)
The connect() function creates a WebSocket but never stores the
reference. The useEffect cleanup only closes the RTCPeerConnection
via pcRef, leaving the WebSocket open.

Each time the component re-renders with changed deps (camera switch,
playback toggle, microphone toggle), a new WebSocket is created
without closing the previous one. This leaks connections until the
browser garbage-collects them or the server times out.

Store the WebSocket in a ref and close it in the cleanup function.
2026-03-16 06:47:07 -06:00
ryzendigo
49ffd0b01a
fix: handle custom logo images without alpha channel (#22468)
cv2.imread with IMREAD_UNCHANGED loads the image as-is, but the code
unconditionally indexes channel 3 (birdseye_logo[:, :, 3]) assuming
RGBA format. This crashes with IndexError for:

- Grayscale PNGs (2D array, no channel dimension)
- RGB PNGs without alpha (3 channels, no index 3)
- Fully transparent PNGs saved as grayscale+alpha (2 channels)

Handle all image formats:
- 2D (grayscale): use directly as luminance
- 4+ channels (RGBA): extract alpha channel (existing behavior)
- 3 channels (RGB/BGR): convert to grayscale

Also fixes the shape[0]/shape[1] swap in the array slice that breaks
non-square images (related to #6802, #7863).
2026-03-16 06:46:31 -06:00
ryzendigo
bf2dcfd622
fix: reset active_cameras to set() not list in error handler (#22467)
In BirdsEyeFrameManager.update(), the exception handler on line 756
resets self.active_cameras to [] (a list), but it is initialized as
set() and compared as a set throughout the rest of the code.

Since set() \!= [] evaluates to True even though both are empty, the
next call to update_frame() will incorrectly detect a layout change
and trigger an unnecessary frame rebuild after every exception.
2026-03-16 06:44:26 -06:00
ryzendigo
09df43a675
fix: return ValueError should be raise ValueError (#22474)
escape_special_characters() returns a ValueError object instead of
raising it when the input path exceeds 1000 characters. The exception
object gets used as a string downstream instead of triggering error
handling.
2026-03-16 06:43:56 -06:00
ryzendigo
dfc6ff9202
fix: variable shadowing silently drops object label updates (#22472)
When an existing tracked object's label or stationary status changes
(e.g. sub_label assignment from face recognition), the update handler
declares a new const newObjects that shadows the outer let newObjects.

The label and stationary mutations apply to the inner copy, but
handleSetObjects on line 148 reads the outer variable which was never
mutated. The update is silently discarded.

Remove the inner declaration so mutations apply to the outer variable
that gets passed to handleSetObjects.
2026-03-16 06:43:25 -06:00
ryzendigo
bc29c4ba71
fix: off-by-one error in GpuSelector.get_gpu_arg (#22464)
gpu <= len(self._valid_gpus) should be gpu < len(self._valid_gpus).

The list is zero-indexed, so requesting gpu index equal to the list
length causes an IndexError. For example, with 2 valid GPUs (indices
0 and 1), requesting gpu=2 passes the check (2 <= 2) but
self._valid_gpus[2] is out of bounds.
2026-03-16 06:42:03 -06:00
Josh Hawkins
f7271e0a5b remove 2026-03-16 07:38:49 -05:00
Josh Hawkins
67604eb61d fix test pollution
test_maintainer was injecting MagicMock() into sys.modules["frigate.config.camera.updater"] at module load time and never restoring it. When the profile tests later imported CameraConfigUpdateEnum and CameraConfigUpdateTopic from that module, they got mock objects instead of the real dataclass/enum, so equality comparisons always failed
2026-03-16 07:31:36 -05:00
Josh Hawkins
0835aa7ea5 fix typing 2026-03-16 06:54:35 -05:00
Josh Hawkins
3c3cf11da4 formatting 2026-03-16 06:36:25 -05:00
Josh Hawkins
b657f04d0e formatting 2026-03-16 06:36:06 -05:00
Josh Hawkins
cbfefd6df5 docs tweak 2026-03-15 16:45:32 -05:00
Josh Hawkins
79da95bf88 docs tweaks 2026-03-15 16:31:16 -05:00
Nicolas Mowen
5a214eb0d1
Review fixes (#22442)
Some checks are pending
CI / AMD64 Build (push) Waiting to run
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
* Don't set provider options for llama.cpp as they are set on llama.cpp side

* fix openai format
2026-03-15 07:26:36 -05:00
Josh Hawkins
310b5dfe05
UI tweaks and fixes (#22448)
* fix double scrollbar in debug replay

* always hide ffmpeg cpu warnings for replay cameras

* add slovenian

* fix motion previews on safari and ios

match the logic used in ScrubbablePreview for manually stepping currentTime at the correct rate

* prevent motion recalibration when opening motion tuner
2026-03-15 07:26:23 -05:00
padioca
687fefb343
fix: run Frigate+ API calls in thread pool to prevent event loop bloc… (#22426)
Some checks are pending
CI / AMD64 Build (push) Waiting to run
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
2026-03-14 14:31:33 -06:00
Nicolas Mowen
7864c446fc
Update inference times for RTX 5060 Ti (#22423)
* Update inference times for RTX 5060 Ti

* Ad RF-DETR

Added Nano-320 performance data for RTX 5060 Ti.
2026-03-13 11:43:16 -05:00
Josh Hawkins
324953d3a5
UI tweaks (#22405)
Some checks failed
CI / AMD64 Build (push) Has been cancelled
CI / ARM Build (push) Has been cancelled
CI / Jetson Jetpack 6 (push) Has been cancelled
CI / ARM Extra Build (push) Has been cancelled
CI / Synaptics Build (push) Has been cancelled
CI / AMD64 Extra Build (push) Has been cancelled
CI / Assemble and push default build (push) Has been cancelled
* add shm frame lifetime calculation and update UI for shared memory metrics

* consistent sizing on activity indicator in save buttons

* fix offline overlay overflowing on mobile when in grid mode
2026-03-12 16:57:42 -06:00
Josh Hawkins
12e9bb3944 fix profile config inheritance bug where Pydantic defaults override base values
The /config API was dumping profile overrides with model_dump() which included
all Pydantic defaults. When the frontend merged these over
the camera's base config, explicitly-set base values were
lost. Now profile overrides are re-dumped with exclude_unset=True so only
user-specified fields are returned.

Also fixes the Save All path generating spurious deletion markers for
restart-required fields that are hidden during profile
editing but not excluded from the raw data sanitization in
prepareSectionSavePayload.
2026-03-12 11:20:03 -05:00
Josh Hawkins
091e0b80d2 show active profile indicator in desktop status bar 2026-03-12 10:58:16 -05:00
Josh Hawkins
0748766713 hide restart-required fields when editing a profile section
fields that require a restart cannot take effect via profile switching,
so they are merged into hiddenFields when profileName is set
2026-03-12 10:56:08 -05:00
Josh Hawkins
611316906a immediately create profiles on backend instead of deferring to Save All 2026-03-12 10:53:53 -05:00
Josh Hawkins
e92fa2b4ba tweak language 2026-03-12 10:47:31 -05:00
Josh Hawkins
8d633423b0 show activity indicator on trash icon while deleting a profile 2026-03-12 10:47:05 -05:00
Josh Hawkins
af0696771a docs 2026-03-12 09:13:20 -05:00
Josh Hawkins
46d91af001 change color order 2026-03-12 09:00:45 -05:00
Josh Hawkins
0f735bea37 use icon only on mobile 2026-03-12 08:57:57 -05:00
Josh Hawkins
5a1ec5d729 remove profile badge in settings and add profiles to main menu 2026-03-12 08:32:23 -05:00
Peter Dolkens
0c988da485
fix(record): replace asyncio.SubprocessError with sp.SubprocessError (#22393)
Some checks are pending
CI / AMD64 Build (push) Waiting to run
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
asyncio.SubprocessError does not exist — Python's asyncio module has no
such class. The correct exception is subprocess.SubprocessError, which
is available via the existing `import subprocess as sp` alias already
present in this file.

The invalid exception reference causes the except clause to raise a
NameError rather than catching the intended exception.
2026-03-12 07:16:06 -06:00
Josh Hawkins
39500b20a0 implement profile friendly names and improve profile UI
- Add ProfileDefinitionConfig type and profiles field to FrigateConfig
- Use ProfilesApiResponse type with friendly_name support throughout
- Replace Record<string, unknown> with proper JsonObject/JsonValue types
- Add profile creation form matching zone pattern (Zod + NameAndIdFields)
- Add pencil icon for renaming profile friendly names in ProfilesView
- Move Profiles menu item to first under Camera Configuration
- Add activity indicators on save/rename/delete buttons
- Display friendly names in CameraManagementView profile selector
- Fix duplicate colored dots in management profile dropdown
- Fix i18n namespace for overridden base config tooltips
- Move profile override deletion from dropdown trash icon to footer
  button with confirmation dialog, matching Reset to Global pattern
- Remove Add Profile from section header dropdown to prevent saving
  camera overrides before top-level profile definition exists
- Clean up newProfiles state after API profile deletion
- Refresh profiles SWR cache after saving profile definitions
2026-03-11 20:55:56 -05:00
Josh Hawkins
0b3c6ed22e add top-level profiles config section with friendly names 2026-03-11 19:50:31 -05:00
Josh Hawkins
dace54734b more unique colors 2026-03-11 16:21:41 -05:00
Josh Hawkins
210d203fa4 fix mask deletion 2026-03-11 16:04:17 -05:00
Josh Hawkins
5c23555882 implement an update_config method for profile manager 2026-03-11 15:57:27 -05:00
Josh Hawkins
5ec1b1841c refactor profilesview and add dots/border colors when overridden 2026-03-11 15:51:29 -05:00
Josh Hawkins
33e4dddb3e rename profile settings to ui settings 2026-03-11 12:35:45 -05:00
Josh Hawkins
6dd8aa912e ensure profile manager gets updated config 2026-03-11 12:35:34 -05:00