Frame Extraction
Extract frames from clips or full videos at target rates and resolutions. Use frames for embeddings (such as Cosmos‑Embed1), aesthetic filtering, previews, and custom analysis.
Use Cases
- Prepare inputs for embedding models that expect frame sequences.
- Run aesthetic filtering that operates on sampled frames.
- Generate lightweight previews or QA snapshots.
- Provide frames for scene-change detection before clipping (TransNetV2).
Before You Start
If you need saved media files, frame extraction is optional. Embeddings and aesthetic filtering require frames.
Quickstart
Use the pipeline stages or the example script flags to extract frames for embeddings, filtering, and analysis.
Pipeline Stage
Script Flags
Options in NeMo Curator
NeMo Curator provides two complementary stages:
ClipFrameExtractionStage: Extracts frames from already‑split clips. Supports several target FPS values and computes an LCM rate to reduce decode work.VideoFrameExtractionStage: Extracts frames from full videos (for example, before scene‑change detection). Supports PyNvCodec (NVDEC) orffmpegCPU/GPU decode.
Extract Frames
From Clips
From Full Videos (Scene Change)
Parameters
LCM Sampling for Several FPS Values
If you provide several integer target_fps values (such as 1 and 2), the clip stage decodes once at the LCM rate and then samples every k‑th frame to produce each target rate. This reduces decode cost.
Hardware and Performance
- Prefer
pynvc(NVDEC) orffmpeg_gpufor high throughput when GPU hardware is available; otherwise useffmpeg_cpu. - Use batching where applicable and track worker resource use.
- Keep resolution modest if memory limits apply; set
target_reswhen needed.
Downstream Dependencies
- Embeddings: Cosmos‑Embed1 expects frames at specific rates. Refer to Embeddings.
- Aesthetic Filtering: Requires frames extracted earlier. Refer to Filtering.
- Clipping with TransNetV2: Uses full‑video frame extraction before scene‑change detection. Refer to Clipping.
Troubleshooting
- “Frame extraction failed”: Check decoder mode and availability; confirm
ffmpegand drivers for GPU modes. - Not enough frames for embeddings: Increase
target_fpsor adjust clip length; certain embedding stages can re‑extract at a higher rate when needed.