1.  [](/)
2.  [Code examples](/recipes)
3.  Reverse Video Search

Back to code examples

# Reverse Video Search

Search your video library by submitting a video clip as the query. The pipeline decomposes the query video into scene-level embeddings and matches them against your indexed video collection to find visually and semantically similar content.

video

Multi-Tier

[Run in Builder](/build?recipe=reverse-video-search)

Python

cURL

from mixpeek import Mixpeek

client \= Mixpeek(api\_key\="YOUR\_API\_KEY", namespace\="video-library")

\# 1. A bucket for the video library, and a collection that splits each video into scenes with a multimodal embedding

bucket \= client.buckets.create(

    bucket\_name\="video-library",

    bucket\_schema\={

        "properties": {

            "video": {

                "type": "video",

            },

        },

    },

)

collection \= client.collections.create(

    collection\_name\="video\_library",

    source\={"type": "bucket", "bucket\_ids": \[bucket\["bucket\_id"\]\]},

    feature\_extractor\={

        "feature\_extractor\_name": "multimodal\_extractor",

        "version": "v1",

        "parameters": {

            "split\_method": "scene",

        },

    },

)

\# 2. Upload and process

client.buckets.upload(

    bucket\["bucket\_id"\],

    blobs\=\[{"property": "video", "type": "video", "data": "s3://your-bucket/videos/launch-film.mp4"}\],

)

client.collections.trigger(collection\["collection\_id"\])

\# 3. A clip searched against indexed scenes, keeping the best scene per source video

retriever \= client.retrievers.create(

    retriever\_name\="reverse-video-search",

    collection\_identifiers\=\["video\_library"\],

    input\_schema\={

        "clip": {

            "type": "video",

            "required": True,

        },

    },

    stages\=\[

        {

            "stage\_name": "search",

            "stage\_id": "feature\_search",

            "parameters": {

                "searches": \[

                    {

                        "feature\_uri": "mixpeek://multimodal\_extractor@v1/vertex\_multimodal\_embedding",

                        "query": {

                            "input\_mode": "content",

                            "value": "{{INPUT.clip}}",

                        },

                        "top\_k": 100,

                    },

                \],

                "final\_top\_k": 100,

                "group\_by": {

                    "field": "source\_object\_id",

                    "max\_per\_group": 1,

                    "limit": 20,

                },

            },

        },

    \],

)

\# 4. Search

results \= client.retrievers.execute(

    retriever\["retriever\_id"\],

    inputs\={

    "clip": "https://example.com/query-clip.mp4",

},

)

for doc in results\["documents"\]:

    print(doc\["source\_object\_id"\], 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

filter

## Frequently asked questions

### How long can the query video be?

Query videos are automatically decomposed into scenes. Clips up to 10 minutes work best for targeted matching. For longer videos, consider splitting into shorter segments.

### Does this detect re-encoded or cropped copies?

Yes. The embedding-based approach is robust to common transformations like re-encoding, cropping, resolution changes, and watermarking.

### What video formats are supported?

MP4, MOV, AVI, WebM, MKV, and most common video containers are supported. The pipeline uses FFmpeg internally for format handling.

## Related code examples and resources

Pages on the same stages, extractors and patterns.

[

Extractor

### Multimodal Extractor

Unified embeddings for video, audio, image, and text: scene/silence chunking, Whisper transcription, thumbnails, and Gemini vision.

Learn more





](/extractors/multimodal)[

Extractor

### Scrolling Text Extractor

Read scrolling/marquee video text via phase-correlation band detection, panoramic stitching, and VLM OCR.

Learn more





](/extractors/scrolling-text)[

Extractor

### 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.

Learn more





](/extractors/transcoding)[

Recipe

### Searchable Video Library

Turn an unstructured video archive into a fully searchable library. Each video is decomposed into scenes with transcriptions, visual embeddings, and metadata. Users search by natural language and jump directly to the relevant moment in any video.

Learn more





](/recipes/searchable-video-library)[

Recipe

### Video Scene Search

Find specific scenes within videos using natural language descriptions. The pipeline detects scene boundaries, generates embeddings for each scene, and enables precise timestamp-level search across an entire video library. Query for visual content, actions, or spoken dialogue.

Learn more





](/recipes/video-scene-search)[

Recipe

### Video Semantic Search Pipeline

Build a production-ready video search engine that lets users find specific moments across thousands of hours of video using natural language queries.

Learn more





](/recipes/video-semantic-search)