Nodes/dll-comfyui-node/FFmpeg Batch Convert (Video -> Audio)
ComfyUI Node

FFmpeg Batch Convert (Video -> Audio)

Strip audio out of a whole folder of videos without leaving ComfyUI

By dlliang14·Created 6 months ago·Updated 2 months ago· 0
FFmpeg Batch Convert (Video -> Audio)
    • output_files
    • success_count
    • fail_count
    • report_json
    input_mode
    source_path/root/ComfyUI/input/
    file_list
    glob_pattern*.mp4
    recursivefalse
    output_format
    sample_rate44100
    channels2
    audio_bitrate192k
    overwrite
    continue_on_errortrue
    ffmpeg_path
    oss_config_json
    use_local_outputtrue
    local_output_dir/root/ComfyUI/output/
    oss_output_mode
    presigned_expires_sec3600

    FFmpeg Batch Convert does exactly what its display name says and nothing more: it batch-extracts the audio track from videos and saves them as mp3 or wav. No AI, no cleverness - it shells out to ffmpeg and reports how many files worked. That's the whole thing, and it's honestly refreshing in an ecosystem of overpromising nodes.

    You'd reach for it as the front end of this pack's pipeline. The same author ships a cloud transcription node that wants audio as URLs, so the intended flow is: point this at a folder of mp4s → get audio in object storage → feed the URLs to the ASR node. But it stands alone too. If you run ComfyUI on a cloud pod and would rather not SSH around just to strip audio, or you're building a repeatable workflow where "drag in videos, get text out" is the deliverable, this is the plumbing. For a one-off, honestly, a terminal one-liner is faster - this earns its keep in workflows, not ad hoc use.

    How it works

    The node resolves an ffmpeg binary in this order: an explicit ffmpeg_path if you set one, then the IMAGEIO_FFMPEG_EXE environment variable, then it falls back to the binary bundled with imageio-ffmpeg (downloaded on first use). So you don't need ffmpeg installed system-wide - that's the design, and it means the first run needs internet to fetch that binary.

    For each input file it runs ffmpeg with -vn (drop video), -ar (sample rate) and -ac (channels), adding a -ab bitrate flag when output is mp3. Results land in the output directory, or get uploaded to S3-compatible storage via boto3 if you wire up OSS config - the code accepts Aliyun OSS, Cloudflare R2, or AWS S3 endpoints.

    Inputs that matter

    • input_mode - pick directory (scan source_path with glob_pattern, plus a recursive toggle), list (one absolute path per line in file_list), or single (just source_path).
    • output_format - mp3 or wav.
    • sample_rate (default 44100) and channels (default 2) - the audio settings.
    • audio_bitrate - only applies to mp3, default 192k.
    • overwrite - skip, overwrite, or rename when the output file already exists.
    • continue_on_error - keep processing the rest of the batch when one file fails.

    The optional inputs only matter for cloud output: oss_config_json (wire it from the pack's OSS Configuration node), use_local_output, oss_output_mode (oss_key or presigned_url), and presigned_expires_sec for how long the generated URLs stay valid.

    Outputs are output_files (newline-joined paths or URLs), success_count, fail_count, and report_json - a structured per-file log you can inspect if something went sideways.

    Install and gotchas

    ComfyUI Manager: search for dll-comfyui-node, install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/dlliang14/dll-comfyui-node
    cd dll-comfyui-node && pip install -r requirements.txt
    

    Dependencies are light: imageio-ffmpeg and boto3. Two things trip people up. First, the README (which is in Chinese and only documents this node - the code ships two more it never mentions) warns that on a Linux pod with a Windows UI you must use container paths like /data/input, never Windows drive letters. Second, if you give ffmpeg_path a path that doesn't exist, it throws FileNotFoundError at runtime - it won't silently fall back, so leave it blank unless you know what you're doing. And if your cluster has no internet, pre-warm imageio-ffmpeg's binary during the image build or set IMAGEIO_FFMPEG_EXE to a local copy.

    Categorydlliang14/media

    Inputs (17)

    NameTypeDefaultDescription
    input_modeCOMBO3 options: directory, list, single
    source_pathSTRING/root/ComfyUI/input/
    file_listSTRING
    glob_patternSTRING*.mp4
    recursiveBOOLEANfalse
    output_formatCOMBO2 options: mp3, wav
    sample_rateINT441008000–192000
    channelsINT21–2
    audio_bitrateSTRING192k
    overwriteCOMBO3 options: skip, overwrite, rename
    continue_on_errorBOOLEANtrue
    ffmpeg_pathSTRING
    oss_config_jsonoptSTRING
    use_local_outputoptBOOLEANtrue
    local_output_diroptSTRING/root/ComfyUI/output/
    oss_output_modeoptCOMBO2 options: oss_key, presigned_url
    presigned_expires_secoptINT360060–86400

    Outputs (4)

    NameTypeDescription
    output_filesSTRING
    success_countINT
    fail_countINT
    report_jsonSTRING