Kosinkadink / ComfyUI-VideoHelperSuite

Nodes related to video workflows
GNU General Public License v3.0
437 stars 76 forks source link

Error occurred when executing VHS_VideoCombine #80

Open chlowden opened 7 months ago

chlowden commented 7 months ago

Hello I am running comfyui for sdv tests on a rocky linux 8.9 machine. I have downloaded all the latest versions and reinstalled the VHS_VideoCombine twice but I continue to get the error below. ffmpeg is installed and so is imageio-ffmpeg but I continue to get the error below

Thank you `

Error occurred when executing VHS_VideoCombine:

An error occured in the ffmpeg subprocess: Unrecognized option 'crf'. Error splitting the argument list: Option not found

File "/home/admin/ComfyUI/execution.py", line 153, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "/home/admin/ComfyUI/execution.py", line 83, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "/home/admin/ComfyUI/execution.py", line 76, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "/home/admin/ComfyUI/custom_nodes/ComfyUI-VideoHelperSuite/videohelpersuite/nodes.py", line 211, in combine_video raise Exception("An error occured in the ffmpeg subprocess:\n"

chlowden commented 7 months ago

`loaded straight to GPU Requested to load SVD_img2vid Loading 1 new model Requested to load CLIPVisionModelWithProjection Loading 1 new model /home/admin/anaconda3/envs/automatic/lib/python3.10/site-packages/torch/nn/modules/conv.py:459: UserWarning: Applied workaround for CuDNN issue, install nvrtc.so (Triggered internally at ../aten/src/ATen/native/cudnn/Conv_v8.cpp:80.) return F.conv2d(input, weight, bias, self.stride, Requested to load AutoencoderKL Loading 1 new model Requested to load SVD_img2vid Loading 1 new model unload clone 2 100%|███████████████████████████████████████████| 12/12 [00:41<00:00, 3.43s/it] Comfy-VFI: Clearing cache... Comfy-VFI: Done cache clearing Comfy-VFI: Clearing cache... Comfy-VFI: Done cache clearing Comfy-VFI: Final clearing cache... Comfy-VFI: Done cache clearing Unrecognized option 'crf'. Error splitting the argument list: Option not found [VideoHelperSuite] - WARNING - An error occurred when saving with metadata ERROR:root:!!! Exception during processing !!! ERROR:root:Traceback (most recent call last): File "/home/admin/ComfyUI/custom_nodes/ComfyUI-VideoHelperSuite/videohelpersuite/nodes.py", line 208, in combine_video res = subprocess.run(args + [file_path], input=images.tobytes(), File "/home/admin/anaconda3/envs/automatic/lib/python3.10/subprocess.py", line 526, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['/home/admin/anaconda3/envs/automatic/bin/ffmpeg', '-v', 'error', '-f', 'rawvideo', '-pix_fmt', 'rgb24', '-s', '1024x576', '-r', '25', '-i', '-', '-crf', '20', '-n', '-c:v', 'libx264', '-pix_fmt', 'yuv420p', '/home/admin/ComfyUI/output/AnimateDiff_00011.mp4']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/admin/ComfyUI/execution.py", line 153, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "/home/admin/ComfyUI/execution.py", line 83, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "/home/admin/ComfyUI/execution.py", line 76, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "/home/admin/ComfyUI/custom_nodes/ComfyUI-VideoHelperSuite/videohelpersuite/nodes.py", line 211, in combine_video raise Exception("An error occured in the ffmpeg subprocess:\n" \ Exception: An error occured in the ffmpeg subprocess: Unrecognized option 'crf'. Error splitting the argument list: Option not found

Prompt executed in 56.95 seconds gc collect `

chlowden commented 7 months ago

The GIF export works.

AustinMroz commented 7 months ago

The only thing that comes to mind is that the system version of ffmpeg is installed is significantly old. Currently, the code will always prefer the system version of ffmpeg if it is available.

Does the problem persist if you force usage of the bundled imageio-ffmpeg python by either

chlowden commented 7 months ago

Uninstalling ffmpeg is not really an option on my machine ... But changing the line:

ffmpeg_path = shutil.which("ffmpeg") if True:

worked. Thank you very much

On Tue, Dec 5, 2023 at 4:03 PM AustinMroz @.***> wrote:

The only thing that comes to mind is that the system version of ffmpeg is installed is significantly old. Currently, the code will always prefer the system version of ffmpeg if it is available.

Does the problem persist if you force usage of the bundled imageio-ffmpeg python by either

  • Uninstalling the system version of ffmpeg or
  • Editing line 27 of videohelpersuite/nodes.py from if ffmpeg_path is None to if True

— Reply to this email directly, view it on GitHub https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite/issues/80#issuecomment-1840972054, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTPXSQ6WWVT56TM2AID3DDYH4ZSJAVCNFSM6AAAAAA77PEQR2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBQHE3TEMBVGQ . You are receiving this because you authored the thread.Message ID: @.***>

AustinMroz commented 7 months ago

Wonderful. I'll add some code on the development branch to allow for easier configuration of this.

A more long term solution that doesn't require fiddling is something I've been considering, but don't currently have a good answer for.

chlowden commented 7 months ago

Thank you for all your hard work and good luck.

onurpolaatt commented 7 months ago

If you also want to install ffmpeg properly, I found the solution.

1- Download the latest version from gyan.dev (https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-full.7z) 2- Extract file and rename "ffmpeg" 3- Cut the "ffmpeg" folder into C:\ (or any disk name) 4- open cmd and run. --> setx /m PATH "C:\ffmpeg\bin;%PATH%"

finally you can verify that it is installed properly from the terminal: --> ffmpeg -version

good luck! (w)

mottzerella commented 7 months ago

Hey I'm experiencing this same issue. Running on a Runpod template, Jupyter notebook. Reinstalling ffmpeg and the edits to nodes.py didn't solve for me, unless I did something wrong. I edited line 27 to just If True

I'm getting the following error:

_Error occurred when executing VHS_VideoCombine:

An error occured in the ffmpeg subprocess: Unrecognized option 'crf'. Error splitting the argument list: Option not found

File "/workspace/ComfyUI/execution.py", line 153, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) File "/workspace/ComfyUI/execution.py", line 83, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) File "/workspace/ComfyUI/execution.py", line 76, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) File "/workspace/ComfyUI/custom_nodes/ComfyUI-VideoHelperSuite/videohelpersuite/nodes.py", line 211, in combinevideo raise Exception("An error occured in the ffmpeg subprocess:\n" \

Any idea what could be the problem?

AustinMroz commented 7 months ago

I've got a rough guess: Double check that imageio-ffmpeg is actually installed.

If it isn't, then an edge case in the quick fix here will cause a warning to be displayed at startup (Failed to import imageio_ffmpeg), but will keep using the seemingly incompatible system ffmpeg afterwards.

You could also add a print(ffmpeg_path) on line 34 and check that the resultant path is from imageio-ffmpeg such as:

ComfyUI/venv-lin/lib/python3.11/site-packages/imageio_ffmpeg/binaries/ffmpeg-linux64-v4.2.2
paukdesidn commented 5 months ago

Hi have same issue, the node is highlighted in red. Have someone solution? thanks in advance!

Screenshot 2024-02-04 213602

calonye commented 1 month ago

The only thing that comes to mind is that the system version of ffmpeg is installed is significantly old. Currently, the code will always prefer the system version of ffmpeg if it is available.

Does the problem persist if you force usage of the bundled imageio-ffmpeg python by either

  • Uninstalling the system version of ffmpeg or
  • Editing line 27 of videohelpersuite/nodes.py from if ffmpeg_path is None to if True

测试可行,

  1. 修改该插件ComfyUI/custom_nodes/ComfyUI-VideoHelperSuite目录下的nodes.py
  2. 搜索# Use ffmpeg to save a video,将下方的if ffmpeg_path is None 修改为if ffmpeg_path is True,保存退出,重新启动

enjoy