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).
This commit is contained in:
eduard256
2026-04-18 11:53:37 +00:00
parent e5769cd1cf
commit f4d414124b
2 changed files with 10 additions and 8 deletions
+9 -6
View File
@@ -111,12 +111,8 @@ func buildInfo(req *Request) *cameraInfo {
info.addCredential(subSection, subKey, subValue) info.addCredential(subSection, subKey, subValue)
} }
subPath := "rtsp://127.0.0.1:8554/" + subName // apply go2rtc overrides BEFORE deriving subPath -- otherwise a rename
if needMP4[subScheme] { // would desync go2rtc.streams (new name) and frigate inputs (old name).
subPath += "?mp4"
}
subInputArgs := "preset-rtsp-restream"
if req.Go2RTC != nil { if req.Go2RTC != nil {
if req.Go2RTC.SubStreamName != "" { if req.Go2RTC.SubStreamName != "" {
subName = 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 != nil {
if req.Frigate.SubStreamPath != "" { if req.Frigate.SubStreamPath != "" {
subPath = req.Frigate.SubStreamPath subPath = req.Frigate.SubStreamPath
+1 -2
View File
@@ -479,8 +479,7 @@
var defaultName = ip ? 'camera_' + ip.replace(/\./g, '_') : 'camera'; var defaultName = ip ? 'camera_' + ip.replace(/\./g, '_') : 'camera';
document.getElementById('f-name').value = defaultName; document.getElementById('f-name').value = defaultName;
// prefill ONVIF from probe // prefill ONVIF user only (host stays empty so the onvif block is opt-in)
if (ip) document.getElementById('f-onvif-host').value = ip;
if (userParam) document.getElementById('f-onvif-user').value = userParam; if (userParam) document.getElementById('f-onvif-user').value = userParam;
// -- tabs (mobile) -- // -- tabs (mobile) --