Nodes/Image Processing Suite for ComfyUI/Folder Video Concatenator (OpenCV)
ComfyUI Node

Folder Video Concatenator (OpenCV)

Concatenate every MP4 in a folder — no re-encoding, no tears

By marcoc2·Created 2 years ago·Updated 5 months ago· 1
Folder Video Concatenator (OpenCV)
    • output_path
    folder_path
    output_filenameconcatenated_output
    sort_by

    If you've ever rendered ten short clips and needed them as one file, you know the options are annoying: a video editor, a fiddly ffmpeg one-liner, or another custom node that re-encodes everything and takes forever. Folder Video Concatenator from AnotherUtils is the "just glue them together" option. Point it at a folder of .mp4 files, pick a sort order, and it produces a single concatenated video using ffmpeg's stream copy - which means no re-encoding. Fast, lossless, and it preserves whatever audio your clips already have.

    One small piece of honesty about the name: it's displayed as "(OpenCV)" but there's no OpenCV anywhere in this node. Under the hood it uses ffmpeg through imageio_ffmpeg (the same ffmpeg binary ComfyUI's environment ships). Don't go hunting for an OpenCV install - you don't need one. The mechanism is the classic ffmpeg concat demuxer: it writes a small text list of files, then runs ffmpeg -f concat -safe 0 -i list.txt -c copy -y output.mp4. The -c copy is the whole game - streams are copied byte-for-byte, so it's near-instant and loses no quality.

    The inputs that matter

    • folder_path - where the MP4s live. The output goes back into this same folder.
    • output_filename - name of the result (default concatenated_output, saved as .mp4).
    • sort_by - name_asc, name_desc, date_asc, or date_desc. Name sorts are alphabetical; date sorts use file modification time. If clip order matters (and with concatenation it always does), set this deliberately.

    One output, output_path - the full path to the new file. It's an output node, so it can sit at the end of a graph and just report where the file landed.

    Install

    ComfyUI Manager → search AnotherUtils, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/marcoc2/ComfyUI-AnotherUtils.git
    

    Restart ComfyUI. It needs imageio_ffmpeg, which ships with ComfyUI's own environment - if you somehow hit an ImportError, pip install imageio-ffmpeg fixes it. No models, nothing else.

    Common issues

    The stream-copy trick has one real constraint: all input clips must share the same codec, resolution, and ideally framerate. Concat demuxer + -c copy doesn't transcode, so a 1080p clip glued to a 720p clip produces a mess or an error. If your clips differ, you'll need to normalize them first (another node or a quick ffmpeg pass) - that's physics, not a bug. Second gotcha: the node globs *.mp4 only, so a stray .mov or .mkv in the folder is silently ignored. And the existing output file is excluded from the list, which is handy but means a leftover concatenated_output.mp4 won't be re-canned. If you ever get cryptic ffmpeg stderr, it's almost always the mismatched-codec problem.

    Categoryvideo/processing

    Inputs (3)

    NameTypeDefaultDescription
    folder_pathSTRING
    output_filenameSTRINGconcatenated_output
    sort_byCOMBO4 options: name_asc, name_desc, date_asc, date_desc

    Outputs (1)

    NameTypeDescription
    output_pathSTRING