Video Extract Segment (FFmpeg)
Pull an Exact Slice of a Video Into Frames and Audio
- video
- images
- audio
Video Extract Segment is the bridge between "a video file" and "frames my ComfyUI graph can actually chew on." It takes a VIDEO input, cuts out an exact range of frames, and hands you that slice as an IMAGE tensor plus the matching audio. If you've ever needed to say "give me frames 60 to 89 of this clip, and the sound that goes with them," this is the node - it's frame-accurate where eyeballing a time range usually isn't.
The wider video workflow in ComfyUI is a pipeline, not a player: you generate clips with Wan or LTX, and half the interesting moves - img2vid conditioning, a second pass over one segment, checking a specific moment - require the frames as tensors, not as a file. This node is the extraction step of that pipeline, and it comes from the same small pack as Video Concat, so it carries the same caveats: a fresh, "vibe-coded by GLM5.2" project with no real community track record yet. The mechanics are solid, the support is "search with AI."
How it works
The node probes the video for fps, frame count, and dimensions, then converts your frame numbers to seconds (start_frame / fps) and pipes exactly that window out of FFmpeg as raw RGB24 bytes. It reshapes those into a [N, H, W, 3] float32 tensor in the [0, 1] range - the exact format every IMAGE socket in ComfyUI expects. Audio comes out separately as a ComfyUI AUDIO dict (waveform + sample_rate), padded or truncated so it lines up with the requested duration exactly. Two nice safety behaviors, both from the author's own description: if your segment runs past the end of the video, it clamps to whatever frames exist instead of erroring, and if the video has no audio track, you get silence rather than a crash.
The inputs and outputs
Only three knobs, and two of them are obvious:
video(VIDEO): the source clip. Needs to come from a node that emits the native VIDEO type - a core loader, or the output of a node like Video Concat.start_frame(INT, default 0): 0-indexed where you start. Frames 60–89 meansstart_frame = 60,length = 30. This is the one beginners trip on - frame 0 is the first frame.length(INT, default 30): how many frames to grab. It silently clamps to the frames remaining, so asking for too many just gets you less.
Outputs: images (IMAGE) goes anywhere image sockets go - a preview, a VAE encode, a frame-to-video model's input. audio (AUDIO) feeds audio nodes for generation, mixing, or pairing with the frames.
One honest note on scope: this returns tensors, not a new video file. If all you wanted was a trimmed mp4, this isn't the tool - it's for when you need the frames in the graph. And because it decodes into memory, the whole point of the pack's FFmpeg approach gets reversed here: don't extract a five-minute 1080p slice into the graph and expect the machine to stay happy. Keep segments short.
Installing it
Same story as every node in this pack - Manager, search "ComfyUI-FFmpeg-Video", install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/bbaudio-2025/ComfyUI-FFmpeg-Video
cd ComfyUI-FFmpeg-Video
pip install -r requirements.txt # ffmpeg-python
No model files, no VRAM-hungry dependencies - just ffmpeg-python and the FFmpeg binary on your PATH.
Common issues
- "start_frame exceeds video frame count" - you asked for a frame that doesn't exist. Drop the start number; frame counts are 0-indexed so the last valid start is total minus one.
- Silent audio output - either the source genuinely has no audio (this is the designed behavior) or your slice landed outside the audio stream's range.
- "FFmpeg binary is not installed" - PATH problem, not the node. Install FFmpeg so the shell can find it.
It's a small, sharp utility. You'll reach for it exactly when you need an exact moment of a video in tensor form, and it does that one job well.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| video | VIDEO | The source video to extract from. | |
| start_frame | INT | 0 | Frame number to start extraction from (0-indexed). |
| length | INT | 30 | Number of frames to extract. Clamped to the remaining frames in the video. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| audio | AUDIO | — |