Skip to content

Commit

Permalink
DEBUG_FFMPEG to FFMPEG_LOGLEVEL
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlt8 committed Jul 28, 2023
1 parent 81e6488 commit 9fac001
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/wyzebridge/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@


DEPRECATED = {
"DEBUG_LEVEL",
"DEBUG_FFMPEG",
}

for env in DEPRECATED:
Expand Down
20 changes: 19 additions & 1 deletion app/wyzebridge/ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def get_ffmpeg_cmd(
cmd = env_cam("FFMPEG_CMD", uri).format(
cam_name=uri, CAM_NAME=uri.upper(), audio_in=audio_in
).split() or (
["-loglevel", "verbose" if env_bool("DEBUG_FFMPEG") else "fatal"]
["-loglevel", get_log_level()]
+ env_cam("FFMPEG_FLAGS", uri, flags).strip("'\"\n ").split()
+ ["-thread_queue_size", "100"]
+ (["-hwaccel", h264_enc] if h264_enc in {"vaapi", "qsv"} else [])
Expand All @@ -71,6 +71,24 @@ def get_ffmpeg_cmd(
return cmd


def get_log_level():
level = env_bool("FFMPEG_LOGLEVEL", "fatal").lower()

if level in {
"quiet",
"panic",
"fatal",
"error",
"warning",
"info",
"verbose",
"debug",
}:
return level

return "verbose"


def re_encode_video(uri: str, is_vertical: bool) -> list[str]:
"""
Check if stream needs to be re-encoded.
Expand Down

0 comments on commit 9fac001

Please sign in to comment.