Nodes/Boyonodes/Boyo Video Clipper
ComfyUI Node

Boyo Video Clipper

Slice Any Video to an Exact Frame Count at an Exact FPS

By DragonDiffusionbyBoyo·Created 2 years ago·Updated 26 days ago· 16
Boyo Video Clipper
    • frames
    • audio
    • metadata
    video
    start_time0.00
    target_fps16
    required_frames81

    Training data and test clips both demand precision: a clip that is exactly N frames at exactly 16 fps, starting at a specific timecode. Standard video loaders give you whatever's in the file. BoyoVideoClipper gives you the surgical version - it runs FFmpeg under the hood to cut a clip to an exact frame count, re-encoded to your target FPS, starting from wherever you say. Out come the frames as a ComfyUI IMAGE batch, the audio as an AUDIO tensor, and a metadata string summarising what it did.

    The inputs that matter

    • video - a dropdown of video files in ComfyUI's input/ directory (mp4, mov, avi, mkv, webm, m4v, flv). Drop your source there first.
    • start_time - seconds into the source where the clip begins (default 0, step 0.01).
    • target_fps - the output frame rate you want the clip re-sampled to (default 16 - a common training value).
    • required_frames - the exact number of frames to extract (default 81 - the standard Wan chunk length).

    How it works

    Under the hood it's FFmpeg + ffprobe: probe the source for width, height, fps and duration, then run an extraction with -ss <start> -vf fps=<target> -frames:v <count>. Frames land as numbered PNGs in a temp dir and are loaded into a tensor; audio is extracted separately (or a silent track is synthesized if the source has no audio, so the AUDIO output is never empty). Everything is cleaned up after. If FFmpeg isn't on your PATH, the node raises immediately - that's the first thing to check when it errors.

    Where it fits

    The textbook use is preparing dataset clips: instead of re-encoding by hand in a video editor to hit "81 frames @ 16 fps," you point this at a source, set the numbers, and get a loader-ready batch plus its audio in one go. The 16 fps / 81 frame defaults line up neatly with Wan's chunk format, which is clearly what the author tunes for.

    Installing it

    Ships with Boyonodes (DragonDiffusionbyBoyo):

    cd ComfyUI/custom_nodes
    git clone https://github.com/DragonDiffusionbyBoyo/Boyonodes
    

    Restart ComfyUI or install "Boyonodes" via ComfyUI Manager. It requires FFmpeg on your PATH - on Windows choco install ffmpeg, macOS brew install ffmpeg, Linux sudo apt-get install ffmpeg. The node does no Python-level video decoding; no extra pip packages needed.

    Gotchas

    • The video dropdown scans input/ at load time - if you add a file while ComfyUI is running, refresh/reload the node to see it.
    • If the source is shorter than start_time + required_frames/target_fps, FFmpeg just produces fewer frames than requested. Check the frame_count in metadata rather than assuming.
    • Audio is extracted at 44.1 kHz stereo; if your downstream TTS/lip-sync chain expects a different rate, resample after.

    Precision video slicing with none of the manual ffmpeg typing. If you've ever needed "exactly 81 frames at 16 fps" and didn't want to count frames by eye, this is your node.

    CategoryBoyo/Video

    Inputs (4)

    NameTypeDefaultDescription
    videoCOMBO0 options:
    start_timeFLOAT0.000–999999
    target_fpsINT161–120
    required_framesINT811–9999

    Outputs (3)

    NameTypeDescription
    framesIMAGE
    audioAUDIO
    metadataSTRING