Nodes/MediaForge/πŸ“₯ Load Video Frames
ComfyUI Node

πŸ“₯ Load Video Frames

Decode any video into ComfyUI's IMAGE + AUDIO tensors, AV1 and ProRes included

By leon80148Β·Created 4 months agoΒ·Updated 2 months agoΒ· 0
πŸ“₯ Load Video Frames
    • frames
    • audio
    • fps
    • width
    • height
    • frame_count
    • metadata_json
    β—„video_pathinput/sample.mp4β–Ί
    β—„target_fps0.0β–Ί
    β—„max_frames0β–Ί
    β—„load_audiotrueβ–Ί
    β—„audio_sr0β–Ί

    MF_LoadVideoFrames decodes a video into ComfyUI's canonical tensor shapes: an IMAGE batch ([B, H, W, C] float32), an AUDIO dict, and a pile of metadata. It's the front door of the pack's tensor side, and its superpower over the usual suspects is that it decodes with FFmpeg rather than OpenCV - so codecs that break other loaders (AV1, HEVC 10-bit, ProRes, VP9) just work here.

    It's the natural replacement for VideoHelperSuite's load node when the format is exotic, and the readme's honest framing is worth repeating: install both, use VHS for fast image-batch workflows and MediaForge for hard-to-decode formats and file-level operations. The author also makes the roundtrip claim: feed its output into MF_SaveVideoFrames with the fps wired through and you get a lossy-but-clean rawvideo roundtrip at PSNR > 38 dB.

    How it works

    FFmpeg decodes the source to raw video and audio, and the pack converts to float32 tensors. It's rotation-aware - portrait phone video comes out with correct display dimensions, not sideways. When the source has no audio stream, audio is None rather than a fake silent track, which is a deliberate design choice: a fake track would mislead MF_SaveVideoFrames's muxing.

    The inputs that matter

    • video_path - the source.
    • target_fps - 0 keeps the original rate; >0 runs an fps filter to resample (handy for aligning everything to 24/30 for a batch pipeline).
    • max_frames - 0 = unbounded. This is your memory cap; long 4K sources will eat VRAM, and previewing a 5-minute clip at full res is how people OOM. Set it when you just need a look.
    • load_audio - skip audio decode entirely with False if you only need frames.
    • audio_sr - 0 keeps the original sample rate; override if you want a consistent rate downstream.

    Outputs: frames (IMAGE), audio (AUDIO), fps, width, height (display, rotation-aware), frame_count, and metadata_json (full ffprobe metadata as a string - great for feeding a filename or a size check).

    Install

    Part of MediaForge:

    cd ComfyUI/custom_nodes
    git clone https://github.com/leon80148/comfyui_MediaForge.git
    # restart ComfyUI
    

    Or ComfyUI Manager β†’ "MediaForge". No Python deps beyond the pack's requirements.txt; the FFmpeg fallback binaries are auto-installed if you lack system ffmpeg.

    Common issues

    OOM on big files is the top complaint - set max_frames or lower target_fps; the node bounds memory by frame count. If audio comes back as None and you expected sound, the source genuinely has no audio stream (or load_audio is off) - check the source with MF_ProbeMedia. And when roundtripping, wire the node's fps output into MF_SaveVideoFrames's fps widget; guessing the fps is how you get a video that plays at the wrong speed.

    CategoryMediaForge/Video

    Inputs (5)

    NameTypeDefaultDescription
    video_pathSTRINGinput/sample.mp4β€”
    target_fpsFLOAT0.00–240β€”
    max_framesINT00–100000β€”
    load_audioBOOLEANtrueβ€”
    audio_srINT00–192000β€”

    Outputs (7)

    NameTypeDescription
    framesIMAGEβ€”
    audioAUDIOβ€”
    fpsFLOATβ€”
    widthINTβ€”
    heightINTβ€”
    frame_countINTβ€”
    metadata_jsonSTRINGβ€”