🔥MergingVideoByTwo
Append two videos into one long clip
- video_complete_path
MergingVideoByTwo concatenates exactly two videos into one longer file - video 1 plays, then video 2, back to back. If that sounds like the same thing StitchingVideo does, it's not: StitchingVideo puts clips side by side in one frame; this one appends them in time. It's the node you reach for when your AI-generated clips are 4–5 seconds each and you want a single 10-second file, or when you're assembling shots into a sequence before running a VideoTransition over the junctions.
How it works
This is the "proper" concat, not the quick one. FFmpeg's concat filter is used, which means both inputs are scaled to a common resolution (the one chosen by resolution_reference), re-timed with setpts=PTS-STARTPTS, then joined - and crucially, if both videos have audio, both audio streams are concatenated too. Because it normalizes resolution first, this works even when your two clips are different sizes or frame rates, which the pack's other merging node (MergingVideoByPlenty) explicitly refuses to handle. The price is a full re-encode of both clips.
The inputs that matter
- video1_path / video2_path - order matters: video1 plays first.
- resolution_reference -
video1orvideo2. The chosen clip's dimensions become the output size; the other clip is scaled to match. If your clips are different aspect ratios, expect letterboxing or distortion depending on how different they are - the node just force-scales. - device -
cpuorcuda. GPU here meansh264_nvencencoding; if a CPU encode fails, the README's own advice is to try the other. - output_path - pre-existing directory; the result is timestamp-named.
Outputs
One video_complete_path string.
Install
Standard for the pack - FFmpeg on PATH is the real prerequisite, the Python side is a single line. 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
- If one clip has audio and the other doesn't, the output has a weird partial soundtrack - the node only concatenates audio when both inputs have it. If you want clean results, add or strip audio (AddAudio, ExtractAudio) so both sides match before merging.
- Unlike MergingVideoByPlenty, this re-encodes, so there's a generational quality cost. If your clips are already identical in codec, resolution, and fps, MergingVideoByPlenty is the lossless and faster choice - use the right tool.
- The concat filter wants even dimensions; a video with odd width/height can throw an encode error. If you hit that, the practical workaround is to re-encode that clip to even dimensions first.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| video1_path | STRING | C:/Users/Desktop/video1.mp4 | — |
| video2_path | STRING | C:/Users/Desktop/video2.mp4 | — |
| device | COMBO | cpu | 2 options: cpu, cuda |
| resolution_reference | COMBO | video1 | 2 options: video1, video2 |
| output_path | STRING | C:/Users/Desktop/output | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| video_complete_path | STRING | — |