From 745a6d16ff24128a648ae8fdfe60bdd2d29bdc3f Mon Sep 17 00:00:00 2001 From: Sergey Krashevich Date: Fri, 23 Jun 2023 02:11:10 +0300 Subject: [PATCH] handle case then get_video_properties returns 0x0 dimension --- frigate/config.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/frigate/config.py b/frigate/config.py index 58346e4e6..c9db0c112 100644 --- a/frigate/config.py +++ b/frigate/config.py @@ -961,8 +961,16 @@ class FrigateConfig(FrigateBaseModel): if "detect" in input.roles: try: stream_info = get_video_properties(input.path) - camera_config.detect.width = stream_info["width"] - camera_config.detect.height = stream_info["height"] + camera_config.detect.width = ( + stream_info["width"] + if stream_info["width"] > 0 + else DEFAULT_DETECT_DIMENSIONS["width"] + ) + camera_config.detect.height = ( + stream_info["height"] + if stream_info["height"] > 0 + else DEFAULT_DETECT_DIMENSIONS["height"] + ) break except Exception: camera_config.detect.width = DEFAULT_DETECT_DIMENSIONS[