You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add go2rtc config override and update submodule to dev (#384)
* Update go2rtc submodule to track upstream dev branch
Rebase opensensor fork onto AlexxIT/go2rtc dev branch to pull in
WebCodecs player, WebP streaming, HKSV support, system monitoring API,
WebRTC error handling, and UI improvements. The two go.mod patches
(security alert, dependency cleanup) were already addressed in dev;
only the Stream.Stop() fix needed cherry-picking.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add go2rtc config override for per-stream sources and global settings
Allow power users to customize go2rtc behavior without lightNVR needing
to expose every option. Two levels of override:
- Per-stream source override: a text field on each stream that replaces
the auto-constructed go2rtc source URL. Supports single URLs or
multi-source YAML lists for failover, transcoding, and hardware
acceleration. Written directly into go2rtc.yaml streams section;
API-based auto-registration is skipped for overridden streams.
- Global config override: a YAML text field in settings (stored in
system_settings table) appended to go2rtc.yaml after auto-generated
sections. Handles custom ffmpeg presets, publish destinations,
preload settings, log levels, etc. Uses last-key-wins for duplicates.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add migration 0040 to embedded migrations header
The unit tests use embedded migrations (not filesystem SQL files) to
initialize test databases. Without the embedded entry for 0040, the
go2rtc_source_override column was missing and caused test_db_streams,
test_db_zones, test_db_motion_config, and test_zone_filter to fail.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* git ignore
* Add unit tests for go2rtc_source_override DB round-trip
Cover the new column in db_streams.c: default empty, INSERT round-trip
with multi-line YAML, UPDATE, get_all bulk read, and clearing the
override back to empty.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Preserve user indentation in go2rtc source override YAML
Stop stripping leading whitespace from override lines so that nested
YAML (e.g. list items with indented subkeys) is preserved correctly.
Base indentation (4 spaces) is still prepended to every line.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add sub-stream support and address Copilot review feedback
Sub-stream support (closes discussion #366):
- Add sub_stream_url field to stream config, coupled into migration 0040
- Register sub-streams with go2rtc as "{name}_sub" when URL is provided
- Frontend grid view uses sub-stream (low-res) when available; fullscreen
and recording always use the main stream
- Sub-stream URL field added to stream config modal (Basic Information)
- MSE, HLS, and WebRTC video cells accept useSubStream prop
Copilot review fixes:
- Single-URL overrides now emit valid inline YAML scalar form
("cam": rtsp://...) instead of block form
- Stream names are YAML-escaped in double-quoted keys (handles " and \)
- DB calls in config generation guarded with get_db_handle() != NULL
to avoid noisy errors when DB isn't initialized yet
- go2rtc_config_override restart dispatch moved outside if(settings_changed)
so DB-backed overrides actually trigger a go2rtc restart
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Address Copilot review: sub-stream with override, length validation, log level
- Sub-stream registration no longer bypassed when main stream has
go2rtc_source_override — all three registration paths
(register_all, sync_from_database, register_stream) now skip only
the main stream API call while still registering {name}_sub via API
- Validate go2rtc_config_override length on save (reject >= 4096 bytes)
- Downgrade full config file dump from INFO to DEBUG to avoid leaking
credentials from overrides into production logs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Wire go2rtc override and sub-stream changes through PUT worker
The PUT worker previously only reloaded go2rtc registration when
URL/protocol/record_audio/credentials changed. Now:
- go2rtc_source_override changes: remove the old API-registered stream,
then re-register via go2rtc_integration_register_stream() which
handles the override-vs-API decision
- sub_stream_url changes: remove old {name}_sub from go2rtc, then
re-register with the new URL (or leave removed if cleared)
Both paths are tracked with dedicated flags in put_stream_task_t
so the worker can act on them independently of URL changes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments