Add ffprobe timeout and catch case where camera is disabled

This commit is contained in:
Nick Mowen 2022-12-13 15:27:22 -07:00
parent d17e33eddc
commit 69043b0c9e
2 changed files with 7 additions and 0 deletions

View File

@ -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,

View File

@ -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",