From f003f8ddac390185ec154200654cc271951fe370 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Thu, 28 Sep 2023 09:52:19 -0500 Subject: [PATCH] config entry --- frigate/config.py | 6 ++++++ frigate/ptz/autotrack.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/frigate/config.py b/frigate/config.py index abfb57d1c..057bb9164 100644 --- a/frigate/config.py +++ b/frigate/config.py @@ -152,6 +152,12 @@ class PtzAutotrackConfig(FrigateBaseModel): zooming: ZoomingModeEnum = Field( default=ZoomingModeEnum.disabled, title="Autotracker zooming mode." ) + zoom_factor: int = Field( + default=30, + title="Zooming factor (1-75).", + ge=1, + le=75, + ) track: List[str] = Field(default=DEFAULT_TRACKED_OBJECTS, title="Objects to track.") required_zones: List[str] = Field( default_factory=list, diff --git a/frigate/ptz/autotrack.py b/frigate/ptz/autotrack.py index bd46558dc..d38d2e7d1 100644 --- a/frigate/ptz/autotrack.py +++ b/frigate/ptz/autotrack.py @@ -559,7 +559,7 @@ class PtzAutoTracker: if camera_config.onvif.autotracking.zooming == ZoomingModeEnum.relative: # relative zooming concurrently with pan/tilt zoom_factor = 30 - zoom = max( + zoom = min( obj.obj_data["area"] / (camera_width * camera_height) * zoom_factor, 1 )