Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoadVideo (Path) does not load the audio when using URL #333

Open
huotarih opened this issue Dec 8, 2024 · 5 comments
Open

LoadVideo (Path) does not load the audio when using URL #333

huotarih opened this issue Dec 8, 2024 · 5 comments

Comments

@huotarih
Copy link

huotarih commented Dec 8, 2024

Using a video url in the path, the node will not load the audio. When using a local path or the Load Video (Upload) node which loads from local, audio works.

Any solution for getting the audio to load also from URL?

@AustinMroz
Copy link
Collaborator

Things appear to work on my end. Could you start by checking if the video has been downloaded to the ComfyUI temp directory. If so, does this downloaded copyhave audio?

VHS includes code to use youtube-dl/ytdlp if it is available, so I'd like to narrow down which method is being utilized.

@huotarih
Copy link
Author

huotarih commented Dec 9, 2024

Looks like it doesn't download the video to the temp directory, it seems to just take the frame images directly, which do show up in the temp folder. I'm using a self hosted version of MeTube to download and host the videos, so the path is basically https://example.com/video.mp4.

@huotarih
Copy link
Author

huotarih commented Dec 9, 2024

I also tried with the ffmpeg (beta) node and that fails with an error, it's using ffmpeg from .venv/lib/python3.11/site-packages/imageio_ffmpeg/binaries/ffmpeg-linux64-v4.2.2. If it were to use the system ffmpeg that would work. Weird.

But as you said, it works on your end so it's some type of issue with my system.

@AustinMroz
Copy link
Collaborator

That's very helpful insight. As you note, VHS includes bundled FFmpeg as a dependency to allow for automated installation. At startup, it will also check and swap to the system version if it exists and is detected as more suitable. You can set VHS_FORCE_FFMPEG_PATH=ffmpeg as an environment variable at launch to force the usage of system FFmpeg. (And if this does help, I would like to both improve the detection code and ensure that the issue can not occur for those with only the bundled version.)

FFmpeg is always the final step when loading audio, but any errors produced during this step are suppressed to handle the common case that the video doesn't include audio. From your investigation with the Load Video FFmpeg node, it seems that FFmpeg is failing to load the video from the url entirely. Contrapositively being able to load the url with Load Video FFmpeg should also fix the audio issue you are seeing. Does the error message produced provide any further insight?

@huotarih
Copy link
Author

Interestingly enough, when using a Load Audio (Path) and using the same url as I use in the Load Video (Path), it works like a charm.

A wise man once said, don't fix it if it ain't broken, so I'm just going to leave it like that and be done with it.

Thanks for the tip also on the environment variable for the FFMPEG path. Did not need to try it yet but might do that at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants