CMD list handled differently when shell=True

This commit is contained in:
2026-03-05 23:03:59 +01:00
parent 1dc3be801b
commit 15e19fa056
4 changed files with 121 additions and 107 deletions

View File

@@ -24,9 +24,9 @@ def _encode_video(
print(f'Encoding {preset['h']}p AV1')
cmd = [
"ffmpeg",
"-i", preset['input_video'],
"-i", source_video,
"ffmpeg", "-v", "quiet", "-stats",
"-i", f'"{preset['input_video']}"',
"-i", f'"{source_video}"',
"-map", "0:v:0", # Video from upscale or interpolated file
"-map", "1:a:0", # Audio from source video
"-map", "1:s:0", # Subtitle from source video
@@ -38,15 +38,16 @@ def _encode_video(
"-crf", preset['crf'],
"-preset", "4",
"-pix_fmt", "yuv420p10le", # 10bit
"-vf", f"scale=\'min({preset['w']},iw)\':-2,setsar=1:1",
"-vf", f"\"scale=\'min({preset['w']},iw)\':-2,setsar=1:1\"",
"-aspect", input_aspect,
"-c:a", "libopus",
"-b:a", "160k",
"-c:s", "copy",
output_video
f'"{output_video}"'
]
print(cmd)
if sys.platform == 'linux':
cmd = ' '.join(cmd)
try:
subprocess.run(cmd, shell=True, check=True)