---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://mixpeek.com/.well-known/search?q={query}"
  method: GET
  documentation: "https://mixpeek.com/llms.txt"
---

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

Back to code examples

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

video

image

text

Multi-Tier

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

## How do you search a video for a specific scene?

Split each video into scenes, embed every scene, and search those embeddings with a text description. A scene detector marks where the picture changes. Each scene gets an embedding of its frames and one of its transcript, and a query like "person presenting a chart on a whiteboard" is matched against both. Each result is the video ID with the scene's start and end time, and a reranker orders the top scenes by what was said in them.

Updated 2026-10-10

Four ways to cut a video before you search it

Segmentation

Where it cuts

Works well for

Watch out for

Scene changes (split\_method: scene)

Where FFmpeg's frame-difference score passes a threshold (0.5 by default; lower finds more scenes)

Edited footage: film, TV, ads, sports

Slow fades and dissolves can be missed; static footage gives very long scenes

Fixed windows (split\_method: time)

Every N seconds

Lectures, surveillance, footage with few cuts

A moment that straddles two windows is split in half

Silence (split\_method: silence)

At pauses where audio drops below a dB level (-40 by default)

Talks, interviews, podcasts on video

Music or constant background noise leaves few places to cut

Frame sampling

One frame every second or so, each embedded on its own

Finding a moment that looks like a single still image

Loses motion and dialogue; far more vectors to store

*   [Video scene segmentation guide](/guides/video-scene-segmentation)
*   [Why video search misses on-screen text](/guides/why-video-search-misses-on-screen-text)
*   [Why AI misses things in a long video](/guides/why-does-ai-miss-things-in-a-long-video)
*   [Best video search tools](/curated-lists/best-video-search-tools)
*   [Best multimodal embedding models](/curated-lists/best-multimodal-embedding-models)
*   [Video search on Mixpeek](/video-search)
*   [MVS: vector search on object storage](/mvs)
*   [Pricing](/pricing)

Python

cURL

from mixpeek import Mixpeek

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

\# 1. A bucket for the videos, and a collection that detects scene boundaries and embeds each scene

bucket \= client.buckets.create(

    bucket\_name\="videos",

    bucket\_schema\={

        "properties": {

            "video": {

                "type": "video",

            },

        },

    },

)

collection \= client.collections.create(

    collection\_name\="video\_scenes",

    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,

            "run\_transcription": True,

            "run\_transcription\_embedding": True,

        },

    },

)

\# 2. Upload and process

client.buckets.upload(

    bucket\["bucket\_id"\],

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

)

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

\# 3. Scene search over visual and transcript embeddings, then a rerank against each scene transcript

retriever \= client.retrievers.create(

    retriever\_name\="scene-search",

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

    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": 50,

                    },

                    {

                        "feature\_uri": "mixpeek://multimodal\_extractor@v1/multilingual\_e5\_large\_instruct\_v1",

                        "query": {

                            "input\_mode": "text",

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

                        },

                        "top\_k": 50,

                    },

                \],

                "fusion": "rrf",

                "final\_top\_k": 50,

            },

        },

        {

            "stage\_name": "rerank",

            "stage\_id": "rerank",

            "parameters": {

                "inference\_name": "BAAI\_\_bge\_reranker\_v2\_m3",

                "query": "{{INPUT.query}}",

                "document\_field": "transcription",

                "top\_k": 10,

            },

        },

    \],

)

\# 4. Search

results \= client.retrievers.execute(

    retriever\["retriever\_id"\],

    inputs\={

    "query": "person presenting a chart on a whiteboard",

},

)

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

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

rerank

Rerank documents using cross-encoder models for accurate relevance

sort

## Frequently asked questions

### How are scene boundaries detected?

The multimodal extractor runs FFmpeg's scene-change filter, which scores how different each frame is from the one before it and starts a new scene where the score passes scene\_detection\_threshold (0.5 when you leave it unset). A lower threshold cuts more often and a higher one cuts less. Hard cuts are caught reliably. Slow fades and dissolves change the picture a little at a time and can stay under the threshold.

### Why does my video search return the wrong scene?

Most often the segments are the wrong size. A segment that spans two moments gets one embedding that blends both, so it matches either query weakly, and a segment that is too short loses the context that identifies it. Look at the scene lengths you actually get, move the threshold, and search the transcript embedding beside the visual one. The video scene segmentation guide covers the trade-offs in depth.

### Can I search both what is shown and what is said?

Yes. With run\_transcription and run\_transcription\_embedding on, each scene document carries a visual embedding and a transcript embedding. The retriever in the code above searches both, fuses the two result lists with reciprocal rank fusion, and reranks the top 50 against each scene transcript.

### What does a search result look like?

Each result is one scene: the ID of the video it came from, its start\_time and end\_time in seconds, and a score. A player can seek straight to the moment instead of opening the whole file.

### How long is a typical scene?

It depends on the footage. Edited film, TV and ads often cut every few seconds, while a presentation or a fixed surveillance camera can hold one shot for minutes. Footage with few cuts is usually better split by time or by silence.

## 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)[

Recipe

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

Learn more





](/recipes/hierarchical-classification)[

Recipe

### Brand Safety & Ad Verification Pipeline

Brand safety pipeline for ad networks. Scores video and image creatives against the GARM brand safety floor and suitability categories, which vendors still use after GARM wound down in 2024, before an ad is served.

Learn more





](/recipes/brand-safety-pipeline)[

Recipe

### Automated Video Tagging

Automatically generate descriptive tags for video content using scene analysis, object detection, and taxonomy classification. Each video receives structured labels for scenes, objects, actions, and custom business categories without manual annotation.

Learn more





](/recipes/automated-video-tagging)[

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

### Semantic Multimodal Search

Unified semantic search across all content types. Query by natural language and retrieve relevant video clips, images, audio segments, and documents based on meaning-not keywords or manual tags.

Learn more





](/recipes/semantic-multimodal-search)