feat(machinery/config): add ONVIFMotion capture flag

Adds Capture.ONVIFMotion and the matching AGENT_CAPTURE_ONVIF_MOTION
environment override. When set to 'true', the agent will open an
ONVIF event stream against the configured camera and route Motion
events into the existing HandleMotion channel (wired up in the
next commit).

Defaults to empty (disabled), so existing deployments using the
pixel-diff motion detector see no behaviour change.
This commit is contained in:
Sebastian Norling
2026-05-21 15:22:25 +02:00
committed by ttradesman
parent 94b26cf096
commit 5a58808f20
2 changed files with 11 additions and 0 deletions

View File

@@ -377,6 +377,9 @@ func applyAgentEnvVars(configuration *models.Configuration, prefix string, apply
case "AGENT_CAPTURE_MOTION":
configuration.Config.Capture.Motion = value
break
case "AGENT_CAPTURE_ONVIF_MOTION":
configuration.Config.Capture.ONVIFMotion = value
break
case "AGENT_CAPTURE_SNAPSHOTS":
configuration.Config.Capture.Snapshots = value
break

View File

@@ -75,6 +75,14 @@ type Capture struct {
Fragmented string `json:"fragmented,omitempty" bson:"fragmented,omitempty"`
FragmentedDuration int64 `json:"fragmentedduration,omitempty" bson:"fragmentedduration,omitempty"`
PixelChangeThreshold *int `json:"pixelChangeThreshold,omitempty"`
// ONVIFMotion routes the camera's ONVIF motion events into the
// agent's motion-triggered recording pipeline. When "true" the
// agent opens an event/stream against the configured ONVIF
// endpoint and forwards Motion+Active events to HandleMotion.
// Requires Capture.IPCamera.ONVIFXAddr / ONVIFUsername /
// ONVIFPassword to be set. Default empty (disabled) keeps the
// existing pixel-diff motion detection as the only source.
ONVIFMotion string `json:"onvif_motion,omitempty" bson:"onvif_motion,omitempty"`
}
// IPCamera configuration, such as the RTSP url of the IPCamera and the FPS.