Merge nvenc-av1, pixfmt, prepass fixes

This commit is contained in:
Austin Mroz
2025-04-08 01:05:27 -05:00
5 changed files with 22 additions and 5 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
name = "comfyui-videohelpersuite"
description = "Nodes related to video workflows"
version = "1.5.18"
version = "1.5.19"
license = { file = "LICENSE" }
dependencies = ["opencv-python", "imageio-ffmpeg"]
+15
View File
@@ -0,0 +1,15 @@
{
"main_pass":
[
"-n", "-c:v", "av1_nvenc",
"-pix_fmt", ["pix_fmt", ["yuv420p", "p010le"]],
"-vf", "scale=out_color_matrix=bt709",
"-color_range", "tv", "-colorspace", "bt709", "-color_primaries", "bt709", "-color_trc", "bt709"
],
"fake_trc": "bt709",
"audio_pass": ["-c:a", "aac"],
"bitrate": ["bitrate","INT", {"default": 10, "min": 1, "max": 999, "step": 1 }],
"megabit": ["megabit","BOOLEAN", {"default": true}],
"save_metadata": ["save_metadata", "BOOLEAN", {"default": true}],
"extension": "mp4"
}
+1 -1
View File
@@ -2,7 +2,7 @@
"main_pass":
[
"-n", "-c:v", "h264_nvenc",
"-pix_fmt", ["pix_fmt", ["yuv420p", "yuv420p10le"]],
"-pix_fmt", ["pix_fmt", ["yuv420p", "p010le"]],
"-vf", "scale=out_color_matrix=bt709",
"-color_range", "tv", "-colorspace", "bt709", "-color_primaries", "bt709", "-color_trc", "bt709"
],
+1 -1
View File
@@ -3,7 +3,7 @@
[
"-n", "-c:v", "hevc_nvenc",
"-vtag", "hvc1",
"-pix_fmt", ["pix_fmt", ["yuv420p", "yuv420p10le"]],
"-pix_fmt", ["pix_fmt", ["yuv420p", "p010le"]],
"-vf", "scale=out_color_matrix=bt709",
"-color_range", "tv", "-colorspace", "bt709", "-color_primaries", "bt709", "-color_trc", "bt709"
],
+4 -2
View File
@@ -478,7 +478,8 @@ class VideoCombine:
raise Exception("Formats which require a pre_pass are incompatible with Batch Manager.")
images = [b''.join(images)]
os.makedirs(folder_paths.get_temp_directory(), exist_ok=True)
pre_pass_args = args[:13] + video_format['pre_pass']
in_args_len = args.index("-i") + 2 # The index after ["-i", "-"]
pre_pass_args = args[:in_args_len] + video_format['pre_pass']
merge_filter_args(pre_pass_args)
try:
subprocess.run(pre_pass_args, input=images[0], env=env,
@@ -487,7 +488,8 @@ class VideoCombine:
raise Exception("An error occurred in the ffmpeg prepass:\n" \
+ e.stderr.decode(*ENCODE_ARGS))
if "inputs_main_pass" in video_format:
args = args[:13] + video_format['inputs_main_pass'] + args[13:]
in_args_len = args.index("-i") + 2 # The index after ["-i", "-"]
args = args[:in_args_len] + video_format['inputs_main_pass'] + args[in_args_len:]
if output_process is None:
if 'gifski_pass' in video_format: