Skip to content

Commit

Permalink
Add ffdetect command for Emby
Browse files Browse the repository at this point in the history
  • Loading branch information
ddscentral committed Feb 24, 2022
1 parent cfb5907 commit 6231adb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"pre_commands": o_config["rffmpeg"]["commands"]["pre"],
"ffmpeg_command": o_config["rffmpeg"]["commands"]["ffmpeg"],
"ffprobe_command": o_config["rffmpeg"]["commands"]["ffprobe"],
"ffdetect_command": o_config["rffmpeg"]["commands"]["ffdetect"],
}
except Exception as e:
log.error("ERROR: Failed to load configuration: %s is missing", e)
Expand All @@ -88,6 +89,7 @@
config["state_persistdir"] = o_config["rffmpeg"]["state"].get("persistdir", '/run/shm')
config["fallback_ffmpeg_command"] = o_config["rffmpeg"]["commands"].get("fallback_ffmpeg", config["ffmpeg_command"])
config["fallback_ffprobe_command"] = o_config["rffmpeg"]["commands"].get("fallback_ffprobe", config["ffprobe_command"])
config["fallback_ffdetect_command"] = o_config["rffmpeg"]["commands"].get("fallback_ffdetect", config["ffdetect_command"])

# Parse CLI args (ffmpeg command line)
all_args = sys.argv
Expand Down Expand Up @@ -253,6 +255,9 @@ def setup_remote_command(target_host):
if "ffprobe" in all_args[0]:
rffmpeg_ffmpeg_command.append(config["ffprobe_command"])
stdout = sys.stdout
elif "ffdetect" in all_args[0]:
rffmpeg_ffmpeg_command.append(config["ffdetect_command"])
stdout = sys.stdout
else:
rffmpeg_ffmpeg_command.append(config["ffmpeg_command"])

Expand Down Expand Up @@ -300,6 +305,9 @@ def run_local_ffmpeg():
if "ffprobe" in all_args[0]:
rffmpeg_ffmpeg_command.append(config["fallback_ffprobe_command"])
stdout = sys.stdout
elif "ffdetect" in all_args[0]:
rffmpeg_ffmpeg_command.append(config["fallback_ffdetect_command"])
stdout = sys.stdout
else:
rffmpeg_ffmpeg_command.append(config["fallback_ffmpeg_command"])

Expand Down

0 comments on commit 6231adb

Please sign in to comment.