diff --git a/pyproject.toml b/pyproject.toml index f316b89..e853373 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"] diff --git a/video_formats/nvenc_av1-mp4.json b/video_formats/nvenc_av1-mp4.json new file mode 100644 index 0000000..0996c65 --- /dev/null +++ b/video_formats/nvenc_av1-mp4.json @@ -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" +} diff --git a/video_formats/nvenc_h264-mp4.json b/video_formats/nvenc_h264-mp4.json index 20d9719..1c39913 100644 --- a/video_formats/nvenc_h264-mp4.json +++ b/video_formats/nvenc_h264-mp4.json @@ -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" ], diff --git a/video_formats/nvenc_hevc-mp4.json b/video_formats/nvenc_hevc-mp4.json index eabb278..2ec6f41 100644 --- a/video_formats/nvenc_hevc-mp4.json +++ b/video_formats/nvenc_hevc-mp4.json @@ -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" ], diff --git a/videohelpersuite/nodes.py b/videohelpersuite/nodes.py index e2301cf..2b666ad 100755 --- a/videohelpersuite/nodes.py +++ b/videohelpersuite/nodes.py @@ -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: