From 69043b0c9e46ac47f30c002fa6d42d250baf8aa4 Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Tue, 13 Dec 2022 15:27:22 -0700 Subject: [PATCH] Add ffprobe timeout and catch case where camera is disabled --- frigate/http.py | 5 +++++ frigate/util.py | 2 ++ 2 files changed, 7 insertions(+) diff --git a/frigate/http.py b/frigate/http.py index a4a7c22cd..c33dc34b2 100644 --- a/frigate/http.py +++ b/frigate/http.py @@ -1178,6 +1178,11 @@ def ffprobe(): {"success": False, "message": f"{camera} is not a valid camera."}, "404" ) + if not current_app.frigate_config.cameras[camera].enabled: + return jsonify( + {"success": False, "message": f"{camera} is not enabled."}, "404" + ) + paths = map( lambda input: input.path, current_app.frigate_config.cameras[camera].ffmpeg.inputs, diff --git a/frigate/util.py b/frigate/util.py index 537c17f4b..79fe7932f 100755 --- a/frigate/util.py +++ b/frigate/util.py @@ -883,6 +883,8 @@ def ffprobe_stream(path: str) -> sp.CompletedProcess: clean_path = escape_special_characters(path) ffprobe_cmd = [ "ffprobe", + "-timeout", + "1000000", "-print_format", "json", "-show_entries",