christian-byrne / youtube-dl-comfyui

Provide a URL to some media (e.g., youtube) → DL and convert to tensor automatically
The Unlicense
4 stars 2 forks source link

Error occurred when executing YoutubeDL: Format not recognised. #4

Open MMaximuss opened 3 weeks ago

MMaximuss commented 3 weeks ago

Nice custom node, but not working for me due to the following error:

Error occurred when executing YoutubeDL:

Error opening "C:\XXXXXXX\ComfyUI_windows_portable\ComfyUI\input\XXXXXXX.mp4": Format not recognised.

File "C:\XXXXXXX\ComfyUI_windows_portable\ComfyUI\execution.py", line 317, in execute output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\XXXXXXX\ComfyUI_windows_portable\ComfyUI\execution.py", line 192, in get_output_data return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\XXXXXXX\ComfyUI_windows_portable\ComfyUI\execution.py", line 169, in _map_node_over_list process_inputs(input_dict, i) File "C:\XXXXXXX\ComfyUI_windows_portable\ComfyUI\execution.py", line 158, in process_inputs results.append(getattr(obj, func)(**inputs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\XXXXXXX\ComfyUI_windows_portable\ComfyUI\custom_nodes\youtube-dl-comfyui\nodes.py", line 142, in main waveform, sample_rate = self.path_to_waveform(abs_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\XXXXXXX\ComfyUI_windows_portable\ComfyUI\custom_nodes\youtube-dl-comfyui\nodes.py", line 214, in path_to_waveform waveform, sample_rate = torchaudio.load(path) ^^^^^^^^^^^^^^^^^^^^^ File "C:\XXXXXXX\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torchaudio_backend\utils.py", line 205, in load return backend.load(uri, frame_offset, num_frames, normalize, channels_first, format, buffer_size) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\XXXXXXX\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torchaudio_backend\soundfile.py", line 27, in load return soundfile_backend.load(uri, frame_offset, num_frames, normalize, channels_first, format) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\XXXXXXX\ComfyUI_windows_portable\python_embeded\Lib\site-packages\torchaudio_backend\soundfilebackend.py", line 221, in load with soundfile.SoundFile(filepath, "r") as file: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\XXXXXXX\ComfyUI_windows_portable\python_embeded\Lib\site-packages\soundfile.py", line 658, in init self._file = self._open(file, mode_int, closefd) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\XXXXXXX\ComfyUI_windows_portable\python_embeded\Lib\site-packages\soundfile.py", line 1216, in _open raise LibsndfileError(err, prefix="Error opening {0!r}: ".format(self.name))

I can't solve it. Not even with the yt-dlp cli args. ffmpeg and ffprobe are installed. Do you have any suggestion?

christian-byrne commented 3 weeks ago

Should be fixed by 087964e

MMaximuss commented 2 weeks ago

After the update I still have the same error message. I added a pull request with a possible fix. That works for me. Thanks again for this nice node.

christian-byrne commented 2 weeks ago

Can you go to the virtual environment that you run ComfyUI in then enter python interactive mode using

python

Then enter:

import torchaudio;torchaudio.list_audio_backends()