Video Keyframe Extraction Pipeline
Extract representative keyframes from videos with scene detection. Generate thumbnails, visual summaries, and frame-level embeddings.
from mixpeek import Mixpeekclient = Mixpeek(api_key="YOUR_API_KEY", namespace="keyframes")# 1. A bucket for the videos, and a collection that cuts at scene changes and# writes a thumbnail and a multimodal embedding for every scenebucket = client.buckets.create(bucket_name="product-videos",bucket_schema={"properties": {"video": {"type": "video"}}},)collection = client.collections.create(collection_name="product-videos",source={"type": "bucket", "bucket_ids": [bucket["bucket_id"]]},feature_extractor={"feature_extractor_name": "multimodal_extractor","version": "v1","parameters": {"split_method": "scene","scene_detection_threshold": 0.5,"enable_thumbnails": True,},},)# 2. Upload and processclient.buckets.upload(bucket["bucket_id"],blobs=[{"property": "video", "type": "video", "data": "s3://your-bucket/product-videos/unboxing.mp4"}],)client.collections.trigger(collection["collection_id"])# 3. Search the scenes visuallyretriever = client.retrievers.create(retriever_name="keyframe-search",collection_identifiers=["product-videos"],input_schema={"query": {"type": "text", "required": True}},stages=[{"stage_name": "search","stage_id": "feature_search","parameters": {"searches": [{"feature_uri": "mixpeek://multimodal_extractor@v1/vertex_multimodal_embedding","query": {"input_mode": "text", "value": "{{INPUT.query}}"},"top_k": 20,},],"final_top_k": 20,},},],)results = client.retrievers.execute(retriever["retriever_id"], inputs={"query": "product being unboxed"})for doc in results["documents"]:print(doc["thumbnail_url"], doc["start_time"], doc["score"])
Feature Extractors
Multimodal Extractor
Unified embeddings for video, audio, image, and text: scene/silence chunking, Whisper transcription, thumbnails, and Gemini vision.
Retriever Stages
feature search
Search and filter documents by vector similarity using feature embeddings
Frequently asked questions
How are keyframes selected?
The scene detection model identifies visual transitions and selects the most representative frame from each scene.
Can I control the number of keyframes per video?
Yes. You can set a maximum keyframe count or minimum scene duration threshold in the extractor configuration.
Are keyframes stored as separate documents?
Yes. Each keyframe becomes a document with its own embedding, timestamp, and parent video reference in the lineage chain.
Related Recipes & Resources
Pages on the same stages, extractors and patterns.
Multimodal Extractor
Unified embeddings for video, audio, image, and text: scene/silence chunking, Whisper transcription, thumbnails, and Gemini vision.
Processing a Large Media Library
Run extraction over tens of thousands of files without paying for the same object twice. Price the job before you submit it, keep new uploads flowing in on their own, and move cold collections out of the vector store while they stay searchable.
Scrolling Text Extractor
Read scrolling/marquee video text via phase-correlation band detection, panoramic stitching, and VLM OCR.
Video Transcoding (H.264/H.265)
Convert RED R3D, ARRI RAW and mixed-codec video to a web-playable MP4 on your object storage, with codec probing so a misleading file extension does not pick the wrong decoder.
Dataset Versioning
Treat versioned object storage as your dataset's source of truth. Capture complete snapshots-raw assets, embeddings, and cluster assignments-for deterministic reconstruction at any point in time.
Hierarchical Classification
Assign content to multi-level category hierarchies using embedding-based classification. Define your taxonomy once, then classify new content automatically with confidence scores.