Nodes/ComfyUI-FFmpeg/🔥Video2Frames
ComfyUI Node

🔥Video2Frames

Turn a video into a folder of PNGs (and get the audio for free)

By MoonHugo·Created 2 years ago·Updated 4 months ago· 146
🔥Video2Frames
    • frame_path
    • fps
    • audio_path
    • total_frames
    • output_path
    video_pathC:/Users/Desktop/video.mp4
    output_pathC:/Users/Desktop/output
    frames_max_width0

    This is the node the whole ComfyUI-FFmpeg pack hangs on, and it's probably the one you came for. You feed it a video file path and it spits out one PNG per frame into a folder. That's the standard entry point for any "re-animate an existing clip" workflow: rip the frames, run them through img2img or AnimateDiff, then stitch them back together with Frames2Video from the same pack. ComfyUI is great at generating images; it's useless at getting them out of an mp4. This node is the bridge.

    How it works

    Under the hood it's just FFmpeg wearing a ComfyUI coat. The node shells out to ffprobe to read the video's fps, resolution, and duration, then runs an FFmpeg scale + PNG extraction into a frames subfolder of your output directory, numbered frame_00000001.png and up. It also extracts the audio track as audio.mp3 into the same output folder at the same time - a genuinely handy freebie, because that's exactly the file you'll want to hand back to Frames2Video later so your re-render isn't silent.

    The inputs that matter

    • video_path - the full path to your video. It must be a real file and end in a video extension (.mp4, .avi, .mov, .mkv, .rmvb, .wmv, .flv). This is a string field, so no ComfyUI file-picker magic - paste the path.
    • output_path - must be an existing directory, not a path that doesn't exist yet. The node checks and will throw output_path is not a directory if you didn't create it first. This is the single most common beginner stumble across the whole pack.
    • frames_max_width - default 0 means "keep the original size." Set it to something like 512 and any frame wider than that gets scaled down to fit, keeping aspect ratio. Note it only shrinks - it never upscales, per the README.

    Outputs

    You get five: frame_path (where the PNGs live), fps (the source frame rate as a float), audio_path, total_frames, and output_path. fps is the one to remember - pipe it straight into Frames2Video so your rebuilt clip plays at the same speed as the original instead of a different one.

    Install

    The pack's actual dependency list is laughably thin - requirements.txt is just pathlib. The real requirement is an FFmpeg binary on your system PATH, because every node in this pack is a wrapper around the ffmpeg and ffprobe commands. If you get a FileNotFoundError mentioning ffmpeg, that's your problem, not the node's.

    Easiest route: ComfyUI Manager → Install Custom Nodes → search "ComfyUI-FFmpeg". Or by hand:

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

    Restart ComfyUI. Verify FFmpeg first with ffmpeg -version in a terminal - if that errors, no node in this pack will work.

    Gotchas

    Watch for audio.mp3 collisions: the node always writes to output_path/audio.mp3, so running it twice into the same folder just overwrites - fine, but don't expect versioning. And because this pack auto-names most of its output videos with a timestamp, running Frames2Video twice gives you two files; the frames here aren't versioned, they just overwrite. If your pipeline feels broken because "it saved over my frames," that's normal behavior, not a bug.

    Category🔥FFmpeg

    Inputs (3)

    NameTypeDefaultDescription
    video_pathSTRINGC:/Users/Desktop/video.mp4
    output_pathSTRINGC:/Users/Desktop/output
    frames_max_widthINT00–1920

    Outputs (5)

    NameTypeDescription
    frame_pathSTRING
    fpsFLOAT
    audio_pathSTRING
    total_framesINT
    output_pathSTRING