Nodes/Bjornulf_custom_nodes/๐Ÿ“น๐Ÿ”— Concat Videos from list (FFmpeg)
ComfyUI Node

๐Ÿ“น๐Ÿ”— Concat Videos from list (FFmpeg)

Stitch a whole batch of clips into one video

By justUmenยทCreated 2 years agoยทUpdated about a year agoยท 545
๐Ÿ“น๐Ÿ”— Concat Videos from list (FFmpeg)
    • concat_path
    • ffmpeg_command
    โ—„filesโ€”โ–บ
    โ—„output_filenameoutput.mp4โ–บ
    โ—„use_python_ffmpegfalseโ–บ
    โ—„FFMPEG_CONFIG_JSONโ€”โ–บ

    Bjornulf's basic Concat Videos node joins exactly two clips together. This one scales that up: give it a list of video paths, one per line, and it stitches every clip together in order into a single output file. It's the node you reach for once you've generated a batch of short clips - from a loop node, from separate API calls, from anywhere - and need them assembled into one continuous video instead of a folder of fragments.

    How it works

    files is a multiline text field where each line is a path to one video file; the node concatenates them in the order they're listed. It's built on ffmpeg under the hood, and use_python_ffmpeg picks which implementation actually does the work - the ffmpeg-python library, or a direct call out to a system ffmpeg binary. The pack added this toggle specifically because the two paths behave differently in practice, and the author rewrote the video nodes around a shared configuration system to make that switch consistent across all of them.

    That configuration system is the optional FFMPEG_CONFIG_JSON input - build one with the pack's FFmpeg Configuration node (or pull details from its Video Details node) and feed it in here to control encoding options beyond the defaults, rather than hardcoding ffmpeg flags yourself.

    One output worth calling out on its own: ffmpeg_command. It hands back the literal command the node ran. That's genuinely useful the moment something goes wrong - instead of guessing why a concat failed, you can copy that exact command and run it in a terminal to see ffmpeg's real error output, which is usually far more informative than whatever surfaces in the ComfyUI console.

    The inputs and outputs that matter

    • files (required, multiline STRING) - one video path per line, concatenated in that order.
    • output_filename (default output.mp4) - where the joined video gets written.
    • use_python_ffmpeg (BOOLEAN, default false) - switches between the ffmpeg-python library and a direct system ffmpeg call.
    • FFMPEG_CONFIG_JSON (optional) - pass in a config built by the pack's FFmpeg Configuration or Video Details nodes for finer encoding control.
    • Outputs concat_path (where the result landed) and ffmpeg_command (the exact command that ran) - both useful for chaining into further nodes or debugging.

    How to install it

    ComfyUI Manager โ†’ search Bjornulf_custom_nodes โ†’ install โ†’ restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/justUmen/Bjornulf_custom_nodes
    pip install -r Bjornulf_custom_nodes/requirements.txt
    

    The shared requirements.txt covers ffmpeg-python and opencv-python, which this node's Python path needs. What it does not guarantee is a system ffmpeg binary - ffmpeg-python is a thin wrapper around the real ffmpeg executable, not a replacement for it, so make sure ffmpeg is actually installed and on your PATH (apt install ffmpeg on Linux, or the equivalent for your platform) regardless of which use_python_ffmpeg setting you use.

    Common issues & troubleshooting

    It fails with an obscure error, or nothing happens. Check the ffmpeg_command output first if you can get the node to produce anything at all - running that exact command yourself in a terminal will almost always surface a clearer error than the ComfyUI console does. Missing system ffmpeg, a bad path in files, or mismatched video codecs between clips are the usual suspects.

    Some clips concatenate fine, others break the whole chain. Mismatched resolution, framerate, or codec between clips is a classic ffmpeg concat failure - this node doesn't normalize your inputs first, it just joins them, so wildly inconsistent source clips (from different generation settings, say) are worth standardizing before you concat.

    Switching use_python_ffmpeg changed the result. That's expected - it's genuinely a different code path (library vs. system binary), and the pack's own changelog flags this area as having gone through a large rewrite. If one setting misbehaves, try the other before assuming your inputs are the problem.

    Output file didn't appear where I expected. Check output_filename - it's a filename, and where it lands depends on the node's working output directory, not necessarily the same folder as your source clips.

    CategoryBjornulf

    Inputs (4)

    NameTypeDefaultDescription
    filesSTRINGโ€”
    output_filenameSTRINGoutput.mp4โ€”
    use_python_ffmpegBOOLEANfalseโ€”
    FFMPEG_CONFIG_JSONoptSTRINGโ€”

    Outputs (2)

    NameTypeDescription
    concat_pathSTRINGโ€”
    ffmpeg_commandSTRINGโ€”