Nodes/ComfyUI-FFmpeg/🔥MergingVideoByPlenty
ComfyUI Node

🔥MergingVideoByPlenty

Fast, lossless merging for a folder of identical clips

By MoonHugo·Created 2 years ago·Updated 4 months ago· 146
🔥MergingVideoByPlenty
    • video_complete_path
    video_pathC:/Users/Desktop/
    output_pathC:/Users/Desktop/output

    MergingVideoByPlenty joins a whole folder of clips into one long video - and here's the kicker, it does it with a stream copy, meaning no re-encoding at all. That makes it essentially instant and completely lossless. The catch, stated plainly in the README: every clip in the folder must have the same encoding, resolution, and frame rate. It's the flip side of MergingVideoByTwo: that node is flexible but re-encodes; this one is rigid but free. When your clips qualify, this is the one you want.

    How it works

    It builds a list of every video in the directory (.mp4, .avi, .mov, .mkv, .rmvb, .wmv, .flv, sorted by filename), writes them to a concat list file, then runs FFmpeg's concat demuxer with -f concat -safe 0 -c copy. -c copy means the raw packets from each file are copied straight into the output container - no decode, no encode. That's why it's fast and lossless, and also why it can't smooth over differences: if clip 2 has a different resolution than clip 1, the muxer just copies mismatched packets and you get a broken or glitchy file.

    The inputs that matter

    • video_path - a directory path (not a file). The README example is C:\Users\Desktop\111, and the requirement is blunt: all videos in there must share codec, fps, and resolution.
    • output_path - existing directory; the merged result is timestamp-named.

    Outputs

    One video_complete_path string.

    Install

    Same as every node in this pack: FFmpeg on PATH is the real dependency (requirements.txt is one line - pathlib). ComfyUI Manager → search "ComfyUI-FFmpeg", or:

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

    Restart ComfyUI.

    Gotchas

    • The "identical clips" requirement is not a suggestion. Different resolutions is the classic failure; different frame rates is more subtle because the file will play but drift. If in doubt, ffprobe a couple of files before merging.
    • The folder is picked up in filename-sorted order, so if your clips are numbered clip_1.mp4, clip_2.mp4, … clip_10.mp4, lexicographic sort puts clip_10 right after clip_1. Zero-pad your names (clip_01, clip_02) or you'll get a shockingly out-of-order long video.
    • Because it's a stream copy, your clips keep whatever codec they had - the output container gets whatever the first file dictates. If your folder is a mix of containers, same rule: don't.
    Category🔥FFmpeg

    Inputs (2)

    NameTypeDefaultDescription
    video_pathSTRINGC:/Users/Desktop/
    output_pathSTRINGC:/Users/Desktop/output

    Outputs (1)

    NameTypeDescription
    video_complete_pathSTRING