Create a Video Pipeline
Learn the basics of creating a video pipeline in Curator by following a split-and-clip pipeline example.
Before You Start
- Follow the Get Started guide to install the package, prepare the model directory, and set up your data paths.
Concepts and Mental Model
Use this overview to understand how stages pass data through the pipeline.
- Pipeline: An ordered list of stages that process data.
- Stage: A modular operation (for example, read, split, encode, embed, write).
- Executor: Runs the pipeline (Ray/Xenna backend).
- Data units: Input videos → clip windows → frames → embeddings + files.
- Common choices:
- Splitting: fixed stride vs. scene-change (TransNetV2)
- Encoding:
libopenh264,h264_nvenc, orlibx264 - Embeddings: Cosmos-Embed1
- Outputs: Clips (mp4), previews (optional), and parquet embeddings for downstream tasks (such as semantic duplicate removal).
For more information, refer to the Video Concepts section.
1. Define Imports and Paths
Import required classes and define paths used throughout the example.
2. Create the Pipeline
Instantiate a named pipeline to orchestrate the stages.
3. Define Stages
Add modular stages to read, split, encode, extract frames, embed, and write outputs.
Read Input Videos
Read videos from storage and extract metadata to prepare for clipping.
Split into Clips
Create clip windows using fixed intervals or scene-change detection.
Fixed stride
TransNetV2 (scene change)
Encode Clips
Convert clip buffers to H.264 using the selected encoder and settings. Refer to Clip Encoding for encoder choices and NVENC setup.
Prepare Frames for Embeddings (Optional)
Extract frames at target rates for downstream embedding models.
Generate Embeddings (Cosmos-Embed1)
Create Cosmos-Embed1-ready frames and compute clip-level embeddings.
Write Clips and Metadata
Write clips, embeddings, and metadata to the output directory. Refer to Save & Export for a full list of parameters.
ClipWriterStage
CLI
4. Run the Pipeline
Run the configured pipeline using the executor.