Nodes/ComfyUI-FFMPEGA/Frame Extract (FFMPEGA)
ComfyUI Node

Frame Extract (FFMPEGA)

Pull frames out of a video without melting your VRAM

By AEmotionStudio·Created 8 months ago·Updated 2 days ago· 16
Frame Extract (FFMPEGA)
  • images
  • audio
  • mask
  • frames
  • audio
  • video_path
  • mask_points
  • crop_data
  • mask
video_path
fps1.0
start_time0.00
duration0.00
max_frames100
input_video_path
mask_points

You generated a video, and now you want to do something with the frames - feed them to an upscaler, an img2img pass, a detailer, or run some analysis on them. Loading a whole clip into ComfyUI's tensor format is the blunt instrument: a few minutes of 1080p video can be gigabytes of VRAM. Frame Extract (FFMPEGA) is the scalpel. It uses ffmpeg to grab individual frames at a rate you choose and hands you a batched IMAGE tensor, plus the audio from the same segment, without dragging the entire file into memory.

The inputs that matter

  • video_path - absolute path to the source video. Or skip it and wire an upstream path (from Load Video Path or Save Video) into input_video_path, which overrides the text field when connected.
  • fps - extraction rate, not the source's frame rate. 1.0 = one frame per second, 0.5 = one every two seconds, 30 = a frame per source frame. This is the main dial for how many frames you get back.
  • start_time / duration - slice a segment instead of the whole video. start_time 0 starts at the beginning; duration 0 means "from start_time to the end."
  • max_frames - the safety cap (default 100, max 1000). This is your OOM guard. Long video at high fps without a cap is how you find out what your GPU's actual memory ceiling is.

The output worth caring about is frames (a batched IMAGE tensor), but there's real metadata hiding in the rest: frame_count, fps (the source frame rate, which is not the extraction rate - a trap worth knowing), duration, and the resolved video_path. It also passes through mask_points and crop_data from the point/crop selectors, which you can feed to the FFMPEG Agent to guide SAM3 masking. audio gives you the sound from the same segment unless you've wired in an audio input, in which case yours wins.

Where it fits

The README's own suggestion is the cleanest use: connect frames to the FFMPEG Agent's images_a input so the agent "analyzes frames before editing." That's how you get click-to-guide masking - the frames give SAM3 something to look at and the point data tells it where. It's equally natural as the front end of any frame-by-frame pipeline: extract, process each frame with image nodes, reassemble with Media Bridge.

Installing it

Part of the ComfyUI-FFMPEGA pack, so the install is the pack install: ComfyUI Manager → search ComfyUI-FFMPEGA → Install, or:

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

Restart ComfyUI, and make sure ffmpeg -version runs in your terminal - the whole pack is built on a system ffmpeg being on PATH.

Where people get burned

The two most common surprises: forgetting that fps is extraction rate while the fps output is the source rate, so don't use the two interchangeably; and setting a huge max_frames because "I want everything," which is exactly the memory blowup the cap exists to prevent. If you're pulling frames for an img2img loop, start at 1 fps and max_frames 100 - you can always raise it once you confirm it fits.

CategoryFFMPEGA

Inputs (10)

NameTypeDefaultDescription
video_pathSTRINGAbsolute path to the video file to extract frames from.
fpsFLOAT1.00.1–60Frames per second to extract. 1.0 = one frame every second, higher values extract more frames.
start_timeoptFLOAT0.000–3600Start time in seconds for frame extraction.
durationoptFLOAT0.000–3600Duration in seconds to extract frames from. 0 = full video from start_time.
max_framesoptINT1001–1000Maximum number of frames to return. Limits output to prevent memory issues with long videos.
imagesoptIMAGEOptional upstream IMAGE input (e.g. from VHS or Save Video). Accepted for wiring but frames are always extracted from the video.
audiooptAUDIOOptional upstream AUDIO. If connected, this audio is output instead of extracting from the video.
input_video_pathoptSTRINGOptional upstream video path (e.g. from Save Video or Load Video Path). Overrides the video_path text field when connected.
mask_pointsoptSTRINGOptional upstream mask_points pass-through. When connected, overrides the locally drawn mask points.
maskoptMASKOptional upstream MASK pass-through. Forwarded as-is to the mask output.

Outputs (6)

NameTypeDescription
framesIMAGEExtracted video frames as a batched image tensor.
audioAUDIOAudio from the extracted segment in ComfyUI AUDIO format.
video_pathSTRINGResolved absolute path to the video file.
mask_pointsSTRINGJSON-encoded point selection data from the Point Selector. Connect to FFMPEGA Agent's mask_points input for guided masking.
crop_dataSTRINGJSON-encoded crop rectangle from the Crop Selector. Format: {"x":N, "y":N, "w":N, "h":N}.
maskMASKUpstream MASK pass-through (or empty mask if not connected).