视频提取音频
Pry the audio track off a video, no re-encode
- 音频地址
VideoExtractAudio (视频提取音频, "extract audio from video") does one thing: it takes a video file, rips the audio track off, and saves it as an MP3. It's the front half of the pack's re-dubbing workflow and a handy utility on its own - the kind of node that's boring until the moment you need it, at which point you're glad it's there.
How it works
Another ffmpeg wrapper. Give it a video path and it runs essentially:
ffmpeg -y -hide_banner -loglevel error -i <video> <out.mp3>
ffmpeg picks a sensible default for the output and writes an MP3 into ComfyUI/output/audio/, using your filename_prefix (default comfyUI) plus a counter: output/audio/comfyUI_00001_.mp3. The single output is 音频地址, a STRING with the full path to the extracted file.
The inputs are just videoPath (STRING, forceInput - wire it from the pack's VideoPath node) and filename_prefix. That's the whole surface. No options for bitrate, no format choice - MP3 in, MP3 out, keep moving.
Where it fits
The natural pairing is the re-dub loop: VideoExtractAudio pulls the original track, you decide it's not good enough, generate a new narration with Text2AutioEdgeTts, then VideoAddAudio muxes the new audio back onto the original video. The output path is designed to feed straight into that next node - a string in, a string out, no manual file wrangling.
It's also useful on its own: grab the audio from a reference clip to inspect it, or to train a voice model, or to check whether a video even has a track worth keeping before you commit to regenerating anything.
The trap: ffmpeg on PATH
Same as the pack's other video nodes, this one shells out via os.system(). If ffmpeg isn't on your PATH, the command fails silently - the node reports success, returns a path, and no file exists. ComfyUI's bundled ffmpeg doesn't count. Check with ffmpeg -version before you troubleshoot anything else.
On Linux:
sudo apt install ffmpeg
On Windows portable, install ffmpeg and add it to PATH.
Installing it
Part of the ComfyUI_Lam pack - install via ComfyUI Manager (search "ComfyUI_Lam") or:
cd ComfyUI/custom_nodes
git clone https://github.com/yanlang0123/ComfyUI_Lam
Restart ComfyUI. No model downloads for this node; the pack's install.bat handles its heavier requirements.
Troubleshooting
Two real failure modes. First, the silent ffmpeg failure above - no file, no error, just a path string. Second, videos with no audio track: ffmpeg errors, os.system swallows the error, and you get an absent file again. So the habit to build is: after running this node, glance at output/audio/ to confirm the MP3 actually landed. If it didn't, either ffmpeg isn't on PATH or the source has no audio to extract.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| videoPath | STRING | — | |
| filename_prefix | STRING | comfyUI | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| 音频地址 | STRING | — |