From f4051eb63d56298fb752aebcffd90f5f9cfb2a72 Mon Sep 17 00:00:00 2001 From: Alessandro Ros Date: Mon, 19 Aug 2024 11:22:54 +0200 Subject: [PATCH] rpi: add rpiCameraFlickerPeriod (#3463) (#3667) --- apidocs/openapi.yaml | 2 ++ internal/conf/path.go | 1 + internal/core/path_manager.go | 1 + internal/staticsources/rpicamera/mtxrpicamdownloader/VERSION | 2 +- internal/staticsources/rpicamera/params.go | 1 + internal/staticsources/rpicamera/source.go | 1 + mediamtx.yml | 2 ++ 7 files changed, 9 insertions(+), 1 deletion(-) diff --git a/apidocs/openapi.yaml b/apidocs/openapi.yaml index a13c5795..4e0ce1b5 100644 --- a/apidocs/openapi.yaml +++ b/apidocs/openapi.yaml @@ -420,6 +420,8 @@ components: type: number rpiCameraAfWindow: type: string + rpiCameraFlickerPeriod: + type: integer rpiCameraTextOverlayEnable: type: boolean rpiCameraTextOverlay: diff --git a/internal/conf/path.go b/internal/conf/path.go index 925f050f..242d1309 100644 --- a/internal/conf/path.go +++ b/internal/conf/path.go @@ -161,6 +161,7 @@ type Path struct { RPICameraAfSpeed string `json:"rpiCameraAfSpeed"` RPICameraLensPosition float64 `json:"rpiCameraLensPosition"` RPICameraAfWindow string `json:"rpiCameraAfWindow"` + RPICameraFlickerPeriod int `json:"rpiCameraFlickerPeriod"` RPICameraTextOverlayEnable bool `json:"rpiCameraTextOverlayEnable"` RPICameraTextOverlay string `json:"rpiCameraTextOverlay"` diff --git a/internal/core/path_manager.go b/internal/core/path_manager.go index ae78ba1b..623ac6a7 100644 --- a/internal/core/path_manager.go +++ b/internal/core/path_manager.go @@ -24,6 +24,7 @@ func pathConfCanBeUpdated(oldPathConf *conf.Path, newPathConf *conf.Path) bool { clone.RPICameraSaturation = newPathConf.RPICameraSaturation clone.RPICameraSharpness = newPathConf.RPICameraSharpness clone.RPICameraExposure = newPathConf.RPICameraExposure + clone.RPICameraFlickerPeriod = newPathConf.RPICameraFlickerPeriod clone.RPICameraAWB = newPathConf.RPICameraAWB clone.RPICameraAWBGains = newPathConf.RPICameraAWBGains clone.RPICameraDenoise = newPathConf.RPICameraDenoise diff --git a/internal/staticsources/rpicamera/mtxrpicamdownloader/VERSION b/internal/staticsources/rpicamera/mtxrpicamdownloader/VERSION index 46b105a3..1defe531 100644 --- a/internal/staticsources/rpicamera/mtxrpicamdownloader/VERSION +++ b/internal/staticsources/rpicamera/mtxrpicamdownloader/VERSION @@ -1 +1 @@ -v2.0.0 +v2.1.0 diff --git a/internal/staticsources/rpicamera/params.go b/internal/staticsources/rpicamera/params.go index c847a388..b5460d3e 100644 --- a/internal/staticsources/rpicamera/params.go +++ b/internal/staticsources/rpicamera/params.go @@ -34,6 +34,7 @@ type params struct { AfSpeed string LensPosition float64 AfWindow string + FlickerPeriod int TextOverlayEnable bool TextOverlay string } diff --git a/internal/staticsources/rpicamera/source.go b/internal/staticsources/rpicamera/source.go index 1a4d49c6..6f2c72b6 100644 --- a/internal/staticsources/rpicamera/source.go +++ b/internal/staticsources/rpicamera/source.go @@ -59,6 +59,7 @@ func paramsFromConf(logLevel conf.LogLevel, cnf *conf.Path) params { AfSpeed: cnf.RPICameraAfSpeed, LensPosition: cnf.RPICameraLensPosition, AfWindow: cnf.RPICameraAfWindow, + FlickerPeriod: cnf.RPICameraFlickerPeriod, TextOverlayEnable: cnf.RPICameraTextOverlayEnable, TextOverlay: cnf.RPICameraTextOverlay, } diff --git a/mediamtx.yml b/mediamtx.yml index f936a305..9bc18f12 100644 --- a/mediamtx.yml +++ b/mediamtx.yml @@ -582,6 +582,8 @@ pathDefaults: # Specifies the autofocus window, in the form x,y,width,height where the coordinates # are given as a proportion of the entire image. rpiCameraAfWindow: + # Manual flicker correction period, in microseconds. + rpiCameraFlickerPeriod: 0 # enables printing text on each frame. rpiCameraTextOverlayEnable: false # text that is printed on each frame.