nemo_curator.stages.video.clipping.clip_extraction_stages
nemo_curator.stages.video.clipping.clip_extraction_stages
Module Contents
Classes
API
Bases: ProcessingStage[VideoTask, VideoTask]
Stage that transcodes video clips into a standardized format.
This stage handles the conversion of video clips using FFmpeg, supporting both software (libx264, libopenh264) and hardware (NVENC) encoding with configurable parameters.
Parameters:
Number of CPUs per worker.
Video encoder to use.
Number of threads per encoder.
Number of clips to encode in parallel.
Number of streams per GPU.
Whether to use hardware acceleration.
Whether to use input video bit rate.
Number of clips per chunk. If the number of clips is larger than this, the clips will be split into chunks, and created VideoTasks for each chunk.
Whether to print verbose logs.
Whether to print FFmpeg verbose logs.
Post-initialization method called after all fields are set.
Add decoder thread options to command.
Add hardware acceleration options to command.
Add input options to command.
Add NVENC-specific encoding options.
Add output options to command.
Add video encoding options to command.
Build the FFmpeg command for extracting clips.
Extract clips using FFmpeg.
Handle FFmpeg command errors.
Read extracted clips back into memory.
Run the FFmpeg command and handle errors.
Ray stage specification for this stage.
Setup method called once before processing begins. Override this method to perform any initialization that should happen once per worker. Args: worker_metadata (WorkerMetadata, optional): Information about the worker (provided by some backends)
Bases: ProcessingStage[VideoTask, VideoTask]
Stage that extracts video clips using fixed-length intervals.
This stage splits videos into clips of specified length and stride, ensuring each clip meets minimum length requirements and optionally limiting total clips.