mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 18:55:23 +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:
|
if "detect" in input.roles:
|
||||||
try:
|
try:
|
||||||
stream_info = get_video_properties(input.path)
|
stream_info = get_video_properties(input.path)
|
||||||
camera_config.detect.width = stream_info["width"]
|
camera_config.detect.width = (
|
||||||
camera_config.detect.height = stream_info["height"]
|
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
|
break
|
||||||
except Exception:
|
except Exception:
|
||||||
camera_config.detect.width = DEFAULT_DETECT_DIMENSIONS[
|
camera_config.detect.width = DEFAULT_DETECT_DIMENSIONS[
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user