From f4d414124b95cac8bee3e347215beaf02f8753b3 Mon Sep 17 00:00:00 2001 From: eduard256 Date: Sat, 18 Apr 2026 11:53:37 +0000 Subject: [PATCH] Fix stray ONVIF block and Go2RTC sub-stream rename desync - www/config.html: stop prefilling the ONVIF host with the camera IP so the onvif block is only emitted when the user opts in. - pkg/generate/config.go: apply Go2RTC.SubStreamName before deriving the Frigate restream path so go2rtc.streams and ffmpeg.inputs stay in sync on rename (matches the existing main-stream order). --- pkg/generate/config.go | 15 +++++++++------ www/config.html | 3 +-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/pkg/generate/config.go b/pkg/generate/config.go index c2bffcb..db7ddb1 100644 --- a/pkg/generate/config.go +++ b/pkg/generate/config.go @@ -111,12 +111,8 @@ func buildInfo(req *Request) *cameraInfo { info.addCredential(subSection, subKey, subValue) } - subPath := "rtsp://127.0.0.1:8554/" + subName - if needMP4[subScheme] { - subPath += "?mp4" - } - subInputArgs := "preset-rtsp-restream" - + // apply go2rtc overrides BEFORE deriving subPath -- otherwise a rename + // would desync go2rtc.streams (new name) and frigate inputs (old name). if req.Go2RTC != nil { if req.Go2RTC.SubStreamName != "" { subName = req.Go2RTC.SubStreamName @@ -129,6 +125,13 @@ func buildInfo(req *Request) *cameraInfo { } } } + + subPath := "rtsp://127.0.0.1:8554/" + subName + if needMP4[subScheme] { + subPath += "?mp4" + } + subInputArgs := "preset-rtsp-restream" + if req.Frigate != nil { if req.Frigate.SubStreamPath != "" { subPath = req.Frigate.SubStreamPath diff --git a/www/config.html b/www/config.html index e5a71af..f6b10c9 100644 --- a/www/config.html +++ b/www/config.html @@ -479,8 +479,7 @@ var defaultName = ip ? 'camera_' + ip.replace(/\./g, '_') : 'camera'; document.getElementById('f-name').value = defaultName; - // prefill ONVIF from probe - if (ip) document.getElementById('f-onvif-host').value = ip; + // prefill ONVIF user only (host stays empty so the onvif block is opt-in) if (userParam) document.getElementById('f-onvif-user').value = userParam; // -- tabs (mobile) --