mirror of
https://github.com/kerberos-io/agent.git
synced 2026-08-23 15:08:32 +00:00
Fix default pixel change threshold value for motion detection
This commit is contained in:
@@ -47,7 +47,7 @@ func ProcessMotion(motionCursor *packets.QueueCursor, configuration *models.Conf
|
||||
|
||||
if motionDisabled {
|
||||
|
||||
log.Log.Info("computervision.main.ProcessMotion(): motion detection disabled (pixelChangeThreshold set to 0), skipping.")
|
||||
log.Log.Warning("computervision.main.ProcessMotion(): motion detection is DISABLED because pixelChangeThreshold is set to 0 (nil/unset would default to 150). If motion detection is expected to be running, set capture.pixelChangeThreshold to a positive value (150 recommended) or AGENT_CAPTURE_PIXEL_CHANGE, then restart/update the agent.")
|
||||
|
||||
} else if continuousMode && !hasMotionRegion {
|
||||
|
||||
|
||||
@@ -648,6 +648,17 @@ func applyAgentEnvVars(configuration *models.Configuration, prefix string, apply
|
||||
}
|
||||
}
|
||||
|
||||
// Motion sensitivity: nil/unset must still resolve to the default (150), not
|
||||
// be left nil. An explicit 0 (temporary "disable motion detection" switch
|
||||
// from the UI) is a real, non-nil value and must NOT be touched here. Only
|
||||
// applied for the effective configuration (applyDefaults), not for the
|
||||
// separate global/custom views, so a missing value in one layer can still be
|
||||
// inherited from the other instead of being masked by this default.
|
||||
if applyDefaults && configuration.Config.Capture.PixelChangeThreshold == nil {
|
||||
defaultPixelChangeThreshold := 150
|
||||
configuration.Config.Capture.PixelChangeThreshold = &defaultPixelChangeThreshold
|
||||
}
|
||||
|
||||
// Signing is a new feature, so if empty we set default values. Only applied
|
||||
// for the effective configuration (applyDefaults), not for the separate
|
||||
// global/custom views.
|
||||
|
||||
Reference in New Issue
Block a user