π§ Extract Audio
Pull the audio out of a video (or save an in-memory AUDIO dict) as a real file
- audio
- audio_file_path
MF_ExtractAudio pulls the audio track out of a video and writes it as a standalone audio file - or takes an in-memory AUDIO dict and materializes it to disk. It's the first of MediaForge's standalone (file-level) Audio nodes, distinct from the Compose audio chain, which only manipulates audio during a video encode and never writes a standalone file. If you need an MP3 for a podcast feed from an MP4, or you want to save what MF_LoadVideoFrames decoded so you can work on it elsewhere, this is the node.
The default is the smart part: format=copy is a stream copy - no re-encode, no quality loss, near-instant. It maps the source codec to the right container automatically (AAC β .m4a, MP3 β .mp3, Opus/Vorbis β .ogg, FLAC β .flac, PCM β .wav). Switch to a transcode format (mp3, aac (m4a), wav (pcm_s16le), flac) when you need a specific output codec and the source isn't already it.
How it works
Path mode: FFmpeg demuxes the source and either stream-copies the audio stream (copy) or re-encodes to the requested format. Audio-dict mode: when you wire an audio pin, it writes the dict to a temp WAV and transcodes from there. Two details worth knowing: with an audio dict input, format=copy has no literal meaning (a dict has no source codec), so it's treated as wav with a printed notice. And a source with no audio stream raises - the pack would rather tell you than hand you an empty file.
The inputs that matter
audio_source- the video or audio file. Hidden when theaudiopin is wired.format-copy/mp3/aac (m4a)/wav (pcm_s16le)/flac.copyfor lossless speed,mp3if the destination demands it.filename_prefix- output name base; the extension is auto-chosen per format.
Output: audio_file_path (STRING).
Install
Part of MediaForge:
cd ComfyUI/custom_nodes
git clone https://github.com/leon80148/comfyui_MediaForge.git
# restart ComfyUI
Or ComfyUI Manager β "MediaForge".
Common issues
The format=copy raise is the one that confuses people: if the source codec isn't in the mapping list, it raises and suggests a transcode format instead - that's the node being honest, not broken. And don't expect a transcoded output to be faster than the source; MP3 from AAC re-encodes, so quality follows the weakest link. One more: this node writes under output/<prefix>_NNNNN.ext with an auto-counter, so repeated runs accumulate files rather than overwriting - clean up if you're iterating a lot.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| audio_source | STRING | input/sample.mp4 | β |
| format | COMBO | copy | 5 options: copy, mp3, aac (m4a), wav (pcm_s16le), flac |
| filename_prefix | STRING | MediaForge/audio | β |
| audioopt | AUDIO | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| audio_file_path | STRING | β |