From 1437ccedeab109a039b5e6ed033f0163a531dc16 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Wed, 4 Sep 2024 08:36:39 -0500 Subject: [PATCH] make height optional --- frigate/api/media.py | 2 +- frigate/util/image.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frigate/api/media.py b/frigate/api/media.py index b8efd1f22..092958581 100644 --- a/frigate/api/media.py +++ b/frigate/api/media.py @@ -275,7 +275,7 @@ def submit_recording_snapshot_to_plus(camera_name: str, frame_time: str): try: recording: Recordings = recording_query.get() time_in_segment = frame_time - recording.start_time - image_data = get_image_from_recording(recording.path, time_in_segment, "png", 0) + image_data = get_image_from_recording(recording.path, time_in_segment, "png") if not image_data: return make_response( diff --git a/frigate/util/image.py b/frigate/util/image.py index 1dc8506fe..f3186fe6a 100644 --- a/frigate/util/image.py +++ b/frigate/util/image.py @@ -765,7 +765,7 @@ def add_mask(mask: str, mask_img: np.ndarray): def get_image_from_recording( - file_path: str, relative_frame_time: float, codec: str, height: int + file_path: str, relative_frame_time: float, codec: str, height: Optional[int] = None ) -> Optional[any]: """retrieve a frame from given time in recording file.""" @@ -787,7 +787,7 @@ def get_image_from_recording( "-", ] - if height: + if height is not None: ffmpeg_cmd.insert(-3, "-vf") ffmpeg_cmd.insert(-3, f"scale=-1:{height}")