Nodes/ComfyUI-FFmpeg/🔥VideoTransition
ComfyUI Node

🔥VideoTransition

Crossfades and wipes between two clips, the xfade way

By MoonHugo·Created 2 years ago·Updated 4 months ago· 146
🔥VideoTransition
    • video_complete_path
    video1_pathC:/Users/Desktop/video1.mp4
    video2_pathC:/Users/Desktop/video2.mp4
    reference_videovideo1
    devicecpu
    transitionfade
    transition_duration1.0
    offset1.0
    output_pathC:/Users/Desktop/output

    VideoTransition stitches two clips together with an actual transition effect - fade, wipe, slide, circle, pixelize, and a couple dozen more - instead of just hard-cutting from one to the other. If you're assembling a short film out of AI-generated shots, this is the polish step that makes it feel like something edited rather than something queued. It's a direct wrapper around FFmpeg's xfade filter, which is exactly why the transition list behaves a little oddly (more on that below).

    How it works

    Both videos are normalized first - scaled to the reference video's dimensions (letterboxed with black bars if the aspect ratios differ), forced to its fps, and converted to yuv420p - then run through xfade at the offset you choose. When both inputs have audio it goes the extra mile: it crossfades the two soundtracks with acrossfade instead of just chopping them. That's genuinely nicer than most DIY ffmpeg one-liners.

    The inputs that matter

    • video1_path / video2_path - video1 plays first, then the transition into video2.
    • reference_video - video1 or video2; this decides the output resolution and frame rate. Both clips get resized to it.
    • transition - the effect. Here's the weird part: the dropdown is populated at runtime by actually running ffmpeg -h filter=xfade on your machine, so the list you see is whatever your FFmpeg build supports. If an effect you were promised is missing, that's your FFmpeg version, not the node.
    • transition_duration - how long the crossfade lasts, min 0.1 s, hard cap 3 s.
    • offset - the point (in seconds) in video1 where the transition starts. The node enforces that offset must be less than video1's duration minus the transition duration, and will error out with a math-y message if you violate it.

    Outputs

    Just one: video_complete_path, the timestamped path of the finished render.

    Install

    Pack-wide story, one more time: FFmpeg on PATH is the real requirement, the Python dependency is a rounding error. 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 and you're in.

    Gotchas

    • The output file auto-names with a timestamp - every render is a new file, which is either nice (no accidental overwrites) or annoying (disk clutter) depending on how many takes you're doing.
    • If the transition dropdown comes up empty, your FFmpeg build either lacks the xfade filter or isn't on PATH - check ffmpeg -h filter=xfade in a terminal yourself. If that command errors, fix FFmpeg before touching this node.
    • This is a full re-encode (both streams go through the filter graph), so it's slow-ish for long clips. A 10-second pair of shots is fine; a 20-minute pairing will feel like it's hanging. It's not - ffmpeg is just working.
    Category🔥FFmpeg

    Inputs (8)

    NameTypeDefaultDescription
    video1_pathSTRINGC:/Users/Desktop/video1.mp4
    video2_pathSTRINGC:/Users/Desktop/video2.mp4
    reference_videoCOMBOvideo1参考视频是哪个视频,决定了输出视频的尺寸和帧率!(Reference video is which video, determines the size and frame rate of the output video!)
    deviceCOMBOcpu2 options: cpu, cuda
    transitionCOMBOfade43 options: circleclose, circlecrop, circleopen, diagbl, diagbr, diagtl, +37
    transition_durationFLOAT1.00.1–3转场持续时间,单位秒,最大值为3秒,不能小于0.1秒!(Transition duration, in seconds, the maximum value is 3 seconds, cannot be less than 0.1 seconds!)
    offsetFLOAT1.0转场开始时间,单位秒,不能大于等于视频1的时长减去转场持续时间(transition_duration)!(Transition start time, in seconds, cannot be greater than or equal to the duration of video1 minus the transition duration (transition_duration)!)
    output_pathSTRINGC:/Users/Desktop/output

    Outputs (1)

    NameTypeDescription
    video_complete_pathSTRING