mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-07 03:35:26 +03:00
change recommended fps and fix config validate
This commit is contained in:
parent
3583163eff
commit
486dd03741
@ -113,7 +113,7 @@ If you initially calibrate with zooming disabled and then enable zooming at a la
|
|||||||
|
|
||||||
Every PTZ camera is different, so autotracking may not perform ideally in every situation. This experimental feature was initially developed using an EmpireTech/Dahua SD1A404XB-GNR.
|
Every PTZ camera is different, so autotracking may not perform ideally in every situation. This experimental feature was initially developed using an EmpireTech/Dahua SD1A404XB-GNR.
|
||||||
|
|
||||||
The object tracker in Frigate estimates the motion of the PTZ so that tracked objects are preserved when the camera moves. In most cases (especially for faster moving objects), the default 5 fps is insufficient for the motion estimator to perform accurately. 10 fps is the current recommendation. Higher frame rates will likely not be more performant and will only slow down Frigate and the motion estimator. Adjust your camera to output at least 10 frames per second and change the `fps` parameter in the [detect configuration](index.md) of your configuration file.
|
The object tracker in Frigate estimates the motion of the PTZ so that tracked objects are preserved when the camera moves. In most cases 5 fps is sufficient, but if you plan to track faster moving objects, you may want to increase this slightly. Higher frame rates (> 10fps) will only slow down Frigate and the motion estimator and may lead to dropped frames, especially if you are using experimental zooming.
|
||||||
|
|
||||||
A fast [detector](object_detectors.md) is recommended. CPU detectors will not perform well or won't work at all. You can watch Frigate's debug viewer for your camera to see a thicker colored box around the object currently being autotracked.
|
A fast [detector](object_detectors.md) is recommended. CPU detectors will not perform well or won't work at all. You can watch Frigate's debug viewer for your camera to see a thicker colored box around the object currently being autotracked.
|
||||||
|
|
||||||
|
|||||||
@ -171,7 +171,7 @@ class PtzAutotrackConfig(FrigateBaseModel):
|
|||||||
timeout: int = Field(
|
timeout: int = Field(
|
||||||
default=10, title="Seconds to delay before returning to preset."
|
default=10, title="Seconds to delay before returning to preset."
|
||||||
)
|
)
|
||||||
movement_weights: Optional[Union[float, List[float]]] = Field(
|
movement_weights: Optional[Union[str, List[str]]] = Field(
|
||||||
default=[],
|
default=[],
|
||||||
title="Internal value used for PTZ movements based on the speed of your camera's motor.",
|
title="Internal value used for PTZ movements based on the speed of your camera's motor.",
|
||||||
)
|
)
|
||||||
|
|||||||
@ -248,9 +248,9 @@ class TrackedObject:
|
|||||||
if self.obj_data["frame_time"] - self.previous["frame_time"] > 60:
|
if self.obj_data["frame_time"] - self.previous["frame_time"] > 60:
|
||||||
significant_change = True
|
significant_change = True
|
||||||
|
|
||||||
# update autotrack at half fps
|
# update autotrack at most 3 objects per second
|
||||||
if self.obj_data["frame_time"] - self.previous["frame_time"] > (
|
if self.obj_data["frame_time"] - self.previous["frame_time"] >= (
|
||||||
1 / (self.camera_config.detect.fps / 2)
|
1 / min(self.camera_config.detect.fps, 3)
|
||||||
):
|
):
|
||||||
autotracker_update = True
|
autotracker_update = True
|
||||||
|
|
||||||
|
|||||||
@ -58,8 +58,6 @@ class PtzMotionEstimator:
|
|||||||
self.ptz_metrics = ptz_metrics
|
self.ptz_metrics = ptz_metrics
|
||||||
self.ptz_start_time = self.ptz_metrics["ptz_start_time"]
|
self.ptz_start_time = self.ptz_metrics["ptz_start_time"]
|
||||||
self.ptz_stop_time = self.ptz_metrics["ptz_stop_time"]
|
self.ptz_stop_time = self.ptz_metrics["ptz_stop_time"]
|
||||||
self.last_update = 0
|
|
||||||
self.update_interval = 1 / (self.camera_config.detect.fps / 3)
|
|
||||||
|
|
||||||
self.ptz_metrics["ptz_reset"].set()
|
self.ptz_metrics["ptz_reset"].set()
|
||||||
logger.debug(f"{config.name}: Motion estimator init")
|
logger.debug(f"{config.name}: Motion estimator init")
|
||||||
@ -89,25 +87,12 @@ class PtzMotionEstimator:
|
|||||||
self.coord_transformations = None
|
self.coord_transformations = None
|
||||||
self.last_update = 0
|
self.last_update = 0
|
||||||
|
|
||||||
ptz_moving = ptz_moving_at_frame_time(
|
if ptz_moving_at_frame_time(
|
||||||
frame_time, self.ptz_start_time.value, self.ptz_stop_time.value
|
frame_time, self.ptz_start_time.value, self.ptz_stop_time.value
|
||||||
)
|
|
||||||
|
|
||||||
if (
|
|
||||||
self.camera_config.onvif.autotracking.zooming != ZoomingModeEnum.disabled
|
|
||||||
and (
|
|
||||||
(frame_time - self.last_update > self.update_interval and ptz_moving)
|
|
||||||
or frame_time == self.ptz_start_time.value
|
|
||||||
or frame_time == self.ptz_stop_time.value
|
|
||||||
)
|
|
||||||
) or (
|
|
||||||
self.camera_config.onvif.autotracking.zooming == ZoomingModeEnum.disabled
|
|
||||||
and ptz_moving
|
|
||||||
):
|
):
|
||||||
logger.debug(
|
logger.debug(
|
||||||
f"{camera}: Motion estimator running - frame time: {frame_time}"
|
f"{camera}: Motion estimator running - frame time: {frame_time}"
|
||||||
)
|
)
|
||||||
self.last_update = frame_time
|
|
||||||
|
|
||||||
frame_id = f"{camera}{frame_time}"
|
frame_id = f"{camera}{frame_time}"
|
||||||
yuv_frame = self.frame_manager.get(
|
yuv_frame = self.frame_manager.get(
|
||||||
@ -284,6 +269,10 @@ class PtzAutoTracker:
|
|||||||
|
|
||||||
if camera_config.onvif.autotracking.movement_weights:
|
if camera_config.onvif.autotracking.movement_weights:
|
||||||
if len(camera_config.onvif.autotracking.movement_weights) == 5:
|
if len(camera_config.onvif.autotracking.movement_weights) == 5:
|
||||||
|
camera_config.onvif.autotracking.movement_weights = [
|
||||||
|
float(val)
|
||||||
|
for val in camera_config.onvif.autotracking.movement_weights
|
||||||
|
]
|
||||||
self.ptz_metrics[camera][
|
self.ptz_metrics[camera][
|
||||||
"ptz_min_zoom"
|
"ptz_min_zoom"
|
||||||
].value = camera_config.onvif.autotracking.movement_weights[0]
|
].value = camera_config.onvif.autotracking.movement_weights[0]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user