From e35ca9e6341180c9436272f48c03f0877baaee4d Mon Sep 17 00:00:00 2001 From: pat-e Date: Sat, 2 Aug 2025 13:39:57 +0200 Subject: [PATCH] Bug-Fixing --- anime_audio_helper.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/anime_audio_helper.py b/anime_audio_helper.py index e3ae843..c2750bc 100644 --- a/anime_audio_helper.py +++ b/anime_audio_helper.py @@ -172,25 +172,25 @@ def convert_video(source_file_base, source_file_full, is_vfr, target_cfr_fps_for height = ffprobe_dim['streams'][0]['height'] svtav1_param_list = [ - f"--width {width}", - f"--height {height}", - f"--input-depth 10" + "--input-depth", "10", + "--width", str(width), + "--height", str(height) ] for k, v in SVT_AV1_PARAMS.items(): if isinstance(v, bool): v = int(v) - svtav1_param_list.append(f"--{k} {v}") - svtav1_param_str = " ".join(svtav1_param_list) - print(f" - Using SvtAv1EncApp parameters: {svtav1_param_str}") + svtav1_param_list += [f"--{k}", str(v)] + print(f" - Using SvtAv1EncApp parameters: {' '.join(svtav1_param_list)}") # ffmpeg: always output yuv420p10le (10-bit), even if input is 8-bit ffmpeg_pipe_cmd = [ - "ffmpeg", "-hide_banner", "-v", "quiet", "-stats", "-y", "-i", ut_video_full_path, + "ffmpeg", "-hide_banner", "-v", "quiet", "-y", "-i", ut_video_full_path, + "-strict", "-1", "-pix_fmt", "yuv420p10le", "-f", "yuv4mpegpipe", "-an", "-sn", "-dn", "-map", "0:v:0", "-" ] - svtav1_cmd = [ - "SvtAv1EncApp2", "-i", "-", "-b", str(encoded_video_file) - ] + svtav1_param_list + svtav1_cmd = ( + ["SvtAv1EncApp2"] + svtav1_param_list + ["-i", "-", "-b", str(encoded_video_file)] + ) print(f" - Running: {' '.join(ffmpeg_pipe_cmd)} | {' '.join(svtav1_cmd)}") # Use subprocess.Popen for piping