From 893000dd28040a7817b73957263acf8da62d8618 Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Mon, 11 Apr 2022 08:16:42 -0600 Subject: [PATCH] Add camera level processing for birdseye --- frigate/output.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/frigate/output.py b/frigate/output.py index 62c672172..916288389 100644 --- a/frigate/output.py +++ b/frigate/output.py @@ -190,14 +190,19 @@ class BirdsEyeFrameManager: channel_dims, ) - def camera_active(self, object_box_count, motion_box_count): - if self.mode == BirdseyeModeEnum.continuous: + def camera_active(self, camera_config, object_box_count, motion_box_count): + if camera_config: + mode = camera_config.mode + else: + mode = self.mode + + if mode == BirdseyeModeEnum.continuous: return True - if self.mode == BirdseyeModeEnum.motion and motion_box_count > 0: + if mode == BirdseyeModeEnum.motion and motion_box_count > 0: return True - if self.mode == BirdseyeModeEnum.objects and object_box_count > 0: + if mode == BirdseyeModeEnum.objects and object_box_count > 0: return True def update_frame(self): @@ -310,11 +315,14 @@ class BirdsEyeFrameManager: return True - def update(self, camera, object_count, motion_count, frame_time, frame) -> bool: + def update(self, camera, camera_config, object_count, motion_count, frame_time, frame) -> bool: + # don't process if birdseye is disabled for this camera + if camera_config and not camera_config.enabled: + return False # update the last active frame for the camera self.cameras[camera]["current_frame"] = frame_time - if self.camera_active(object_count, motion_count): + if self.camera_active(camera_config, object_count, motion_count): self.cameras[camera]["last_active_frame"] = frame_time now = datetime.datetime.now().timestamp() @@ -425,6 +433,7 @@ def output_frames(config: FrigateConfig, video_output_queue): ): if birdseye_manager.update( camera, + config.cameras[camera].birdseye, len([o for o in current_tracked_objects if not o["stationary"]]), len(motion_boxes), frame_time,