ποΈ Extract Audio (ffmpeg)
Demux with ffmpeg once, cache it forever
- audio_path
VTT_ExtractAudio is where the video part of a video-to-text workflow actually ends. You hand it the path from VTT_LoadVideo, and it shells out to ffmpeg to strip the audio track into a WAV file - 16 kHz mono by default, which is exactly the format an ASR model wants to chew on. Then it remembers what it did, and that memory is the whole trick of this node.
How it works
The output lands in $TMPDIR/comfyui_vtt/<name>_<hash>.wav, where the hash is computed from the source path, its mtime, the sample rate, the mono flag, and any extra ffmpeg args. Re-run the same video and it skips ffmpeg entirely, returning the cached file instantly. Change the file or change a parameter, and the hash changes with it - no stale-audio surprises on your second run. The README's tip is right: when you want to force a clean re-extract, just rm -rf /tmp/comfyui_vtt.
Under the hood it's a plain subprocess call:
ffmpeg -y -i <video> -vn -acodec pcm_s16le -ar <rate> -ac <1|2> <out.wav>
The -vn drops the video stream, pcm_s16le gives you a plain PCM WAV, and the mono flag becomes -ac 1 or -ac 2. The optional ffmpeg_extra_args input is spliced into the command before the output path - the tooltip says as much - so you can sneak in filters like -af highpass=... or a loudnorm pass when the source audio is a mess.
Inputs and output
- video_path (required) - the string coming out of VTT_LoadVideo.
- sample_rate - defaults to 16000, range 8000β48000. 16 kHz is the ASR sweet spot; you almost never need to touch it.
- mono - defaults to true. Keep it mono for transcription.
- ffmpeg_extra_args - empty by default. Only reach for it when the default demux isn't enough.
One output: audio_path (STRING), the full path of the WAV you just produced. That feeds VTT_AudioFromPath next, which turns it into an AUDIO dict the ASR node can read.
How to install it
This node is the reason the pack needs ffmpeg on your server's PATH. That's a system package, not a Python one - on Ubuntu:
sudo apt install ffmpeg
ffmpeg -version
And if your ComfyUI runs inside a container, install ffmpeg inside the container, or it won't be found. The pack also needs torchaudio in ComfyUI's venv (uv pip install torchaudio), then a restart. The whole pack is a git clone or a ComfyUI Manager install of "ComfyUI-VideoToText" - nothing about this node is special.
Common issues
The error you're most likely to hit is RuntimeError: ffmpeg not found on PATH. Nine times out of ten it's ffmpeg missing, not the node being broken. If ffmpeg runs but produces nothing, you get an "empty output" error - that's the moment to suspect ffmpeg_extra_args broke the command. And if the same workflow keeps re-extracting audio when you know the video didn't change, the cache lives in /tmp, which some systems wipe on reboot; the first run after that is just slow, not wrong.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| video_path | STRING | β | |
| sample_rate | INT | 160008000β48000 | β |
| mono | BOOLEAN | true | β |
| ffmpeg_extra_argsopt | STRING | Extra args passed to ffmpeg before the output path. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| audio_path | STRING | β |