mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 10:45:21 +03:00
handle case then get_video_properties returns 0x0 dimension
This commit is contained in:
parent
990b6ddad0
commit
745a6d16ff
@ -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[
|
||||
|
||||
Loading…
Reference in New Issue
Block a user