From 15e2df1e5c5dbdde46052398626633142a678f8d Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Sat, 15 Jun 2024 06:42:23 -0500 Subject: [PATCH] set shortest edge to preview height (#11971) --- frigate/output/preview.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/frigate/output/preview.py b/frigate/output/preview.py index 1f72a488b..b47a5c302 100644 --- a/frigate/output/preview.py +++ b/frigate/output/preview.py @@ -152,10 +152,20 @@ class PreviewRecorder: self.start_time = 0 self.last_output_time = 0 self.output_frames = [] - self.out_height = PREVIEW_HEIGHT - self.out_width = ( - int((config.detect.width / config.detect.height) * self.out_height) // 4 * 4 - ) + if config.detect.width > config.detect.height: + self.out_height = PREVIEW_HEIGHT + self.out_width = ( + int((config.detect.width / config.detect.height) * self.out_height) + // 4 + * 4 + ) + else: + self.out_width = PREVIEW_HEIGHT + self.out_height = ( + int((config.detect.height / config.detect.width) * self.out_width) + // 4 + * 4 + ) # create communication for finished previews self.requestor = InterProcessRequestor()