Skip to content

Commit 4980590

Browse files
committed
Fix pre_pass and inputs_main_pass args index.
1 parent df55f01 commit 4980590

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

videohelpersuite/nodes.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,8 @@ def pad(image):
478478
raise Exception("Formats which require a pre_pass are incompatible with Batch Manager.")
479479
images = [b''.join(images)]
480480
os.makedirs(folder_paths.get_temp_directory(), exist_ok=True)
481-
pre_pass_args = args[:13] + video_format['pre_pass']
481+
in_args_len = args.index("-i") + 2 # The index after ["-i", "-"]
482+
pre_pass_args = args[:in_args_len] + video_format['pre_pass']
482483
merge_filter_args(pre_pass_args)
483484
try:
484485
subprocess.run(pre_pass_args, input=images[0], env=env,
@@ -487,7 +488,8 @@ def pad(image):
487488
raise Exception("An error occurred in the ffmpeg prepass:\n" \
488489
+ e.stderr.decode(*ENCODE_ARGS))
489490
if "inputs_main_pass" in video_format:
490-
args = args[:13] + video_format['inputs_main_pass'] + args[13:]
491+
in_args_len = args.index("-i") + 2 # The index after ["-i", "-"]
492+
args = args[:in_args_len] + video_format['inputs_main_pass'] + args[in_args_len:]
491493

492494
if output_process is None:
493495
if 'gifski_pass' in video_format:

0 commit comments

Comments
 (0)