ComfyUI Node

VRGDG_CreateFinalVideo

Concatenate all the set videos and glue the clean audio back on — the last node

By vrgamegirl19·Created about a year ago·Updated 2 days ago· 717
VRGDG_CreateFinalVideo
  • trigger
  • audio
    threshold3
    video_foldervideo_output

    This is the finish line. VRGDG_CreateFinalVideo is an output node that takes every completed set video sitting in video_folder, concatenates them into one clip, and then muxes the original clean audio back on top - producing FINAL_VIDEO.mp4. It's the terminal step of the VRGameDevGirl music-video pipeline: after you've generated and combined all the sets, this is the node that makes it a watchable song instead of a folder of clips.

    It has no outputs, because it's the end of the line. It writes files and pops a green "VIDEO COMPLETE!" toast in the UI via ComfyUI's server. If you've seen the pack's workflow run end-to-end, this is where the confetti lands.

    How it works

    Like the load-gate nodes, it's triggered by a VHS_FILENAMES input (from VideoHelperSuite's Combine Video) so it runs after the videos are written, and it has a threshold guard: only proceed if at least that many -audio.mp4 files exist in video_folder (default 3). Below threshold, it silently returns.

    When it does run, the assembly is two ffmpeg passes:

    1. Concatenate - all matching -audio.mp4 files go into a concat demuxer list, joined with -c:v copy (no re-encode, so it's fast) and -an (audio stripped).
    2. Mux - the concatenated silent video is combined with the audio input, which should be the clean original track (run it through VRGDG_CleanAudio first for a consistent 48kHz stereo form). Video is copied, audio is encoded to AAC, -shortest trims to the shorter of the two, and the result is written as FINAL_VIDEO.mp4 in the same folder.

    It needs ffmpeg - the pack checks for a system ffmpeg first and falls back to the imageio-bundled binary. Either works; system ffmpeg with NVENC is faster on the AAC/encode side, but with -c:v copy on both passes the encode cost is minimal anyway.

    Inputs and gotchas

    • trigger (VHS_FILENAMES) - required, from VHS Combine Video.
    • audio (AUDIO) - the clean original audio to re-attach.
    • threshold - minimum set count to proceed.
    • video_folder - where the sets live; relative paths resolve against ComfyUI's output directory.

    The trap: the audio you feed it replaces the per-set audio. Each set video was generated with its own audio, but the final node strips all of it and lays the original track back over the concatenation. Feed it the right, clean, frame-aligned audio or the whole song's sync is off. And if FINAL_VIDEO.mp4 already exists, it gets deleted before the new one is written - the SRT variant below handles the "don't clobber my good take" problem.

    Install

    ComfyUI Manager → search "vrgamedev", or git clone https://github.com/vrgamegirl19/comfyui-vrgamedevgirl into ComfyUI/custom_nodes, restart. Pack requirements (kornia, librosa, imageio) plus ffmpeg. If you need rerun/redo support with numbered outputs, use VRGDG_CreateFinalVideo_SRT instead.

    CategoryVideo

    Inputs (4)

    NameTypeDefaultDescription
    triggerVHS_FILENAMES
    audioAUDIO
    thresholdINT3
    video_folderSTRINGvideo_output

    Outputs (0)

    No outputs