Skip to main content
Find the moment in a video where something is shown or said, with one text query. Each 10-second segment carries a visual embedding and a transcript embedding, and the retriever ranks over both.

Jump to the manifest

video-understanding.namespace.yaml: apply it with one API call, then read the walkthrough below to change it.

At a glance

How the pieces connect

Buckets hold what you upload, collections turn it into searchable documents, and retrievers answer queries over the collections.

Deploy it

1

Get the manifest

2

Validate it

Validate runs every check apply runs and creates nothing. Fix each entry in errors, then run it again.
3

Apply it

Apply creates every resource in one call. wait_for_seed=true also waits until the sample objects are processed, so the first query below has documents to return.
The response lists each resource with its outcome in resources. Apply refuses a resource that already exists and rolls the whole apply back, so to apply the file again over this namespace add ?mode=create_missing, which creates only what is missing.

Run the first query

Look up the namespace id by name, then run video-search. Check status and warnings along with documents: a run that times out still answers 200, with status degraded.

Add your own data

Each object you add to a bucket is processed by every collection that reads it. This adds one object to videos. NAMESPACE_ID is the id from the namespace lookup above.
The object is PENDING until processing finishes, then COMPLETED or FAILED. Buckets and objects covers object states, retries and duplicates.

Retrievers

Type what a moment shows or what someone says in it, and get the matching 10-second segments, ranked over the frames and the transcript together. Stages: feature_search Searches: video-moments

Collections

Each collection runs one extractor over a bucket, or over another collection’s documents.
multimodal_extractor@v1 over bucket videos: one document per 10-second segment, with a visual embedding and a transcript embedding. Feeds video-search.Reads bucket videos with multimodal_extractor v1.Inputs: video ← videoCopied onto each document: title, category

The manifest

Every resource above comes from this file. Change it and apply it again with ?mode=upsert to update what exists. Manifests documents each field.
video-understanding.namespace.yaml

Hand it to an agent

Paste this prompt into Claude Code, Cursor or another coding agent. To give the agent this whole page instead, use Copy page in the menu at the top of the page, or point it at the page’s Markdown at https://mixpeek.com/docs/templates/video-understanding.md.
Prompt

How it works

Each video in videos becomes one document per 10-second segment in video-moments. Every document carries the segment’s start_time and end_time in seconds, its transcription, a thumbnail_url, the source video’s URL in source_video_url, and the bucket object’s title and category. One multimodal_extractor@v1 run writes two vector indexes per segment: video-search sends the same text query to both indexes and fuses the two ranked lists into one. A query like “a man shaving with an electric razor” finds the segment by its frames. A query that repeats a line from the voice-over finds the segment by its transcript, even when the frames show something else.
run_transcription and run_transcription_embedding both default to false. Leave either one out and the speech index stays empty: the second search returns nothing and every result comes from the frames alone. The manifest sets both to true.

Why these parameters

  • split_method: time with time_split_interval: 10 cuts every video into fixed 10-second segments. Shorter segments give tighter timestamps; longer ones cost the same per minute and return coarser moments.
  • fusion: dbsf rescales each search’s scores to 0 to 1 before it applies the weights. The two indexes come from different models with different score ranges.
  • weight: 0.6 and weight: 0.4 let the frames lead. Swap them for spoken-word video such as interviews, lectures or podcasts.
Video costs 0.20 USD a minute to process, so the 3.5 minutes of seed video cost about 0.70 USD. The namespace’s budget.daily_usd of 2 pauses new batches once a day’s spend reaches 2 USD.

Change the fusion

Edit the hybrid_search stage and apply again with ?mode=upsert, which patches the retriever’s stages in place.
rrf ranks by position in each list and ignores the raw scores. Use it when you do not want to tune weights.
video-understanding.namespace.yaml
A field upsert cannot change is reported in the response’s refused, with the resource and the field named.

Filter at query time

Pass filters with the execute call to narrow one run without changing the retriever. This one keeps only segments from automotive videos:
cURL
Segment times are filterable the same way. To search only the part of each video after its first 30 seconds, replace the filter with this one:
Filter by time
Filters lists every operator.

Return moments instead of segments

Adjacent segments often match the same query: a shaving scene that runs 25 seconds spans three 10-second segments. The moment_group stage merges matching segments of the same video into one time range. Add it after hybrid_search in the retriever’s stages, then apply with ?mode=upsert.
video-understanding.namespace.yaml
time_field: start_time reads each segment’s own start and end in seconds, which is the right source for a text query. annotated keeps the best segment per video and attaches a moments array of merged ranges to it. Gaps up to merge_tolerance_ms (2 seconds here) are bridged. See Moment group.

Rerank by what was said

A cross-encoder scores the query against each segment’s transcript, which separates close matches better than vector similarity. Add a rerank stage after hybrid_search:
video-understanding.namespace.yaml
Each scored document adds latency, so keep max_candidates near the number of results you show. A segment with no transcript is left out of the scoring, with a warning in the response. See Rerank.

Search with a reference image

The visual index embeds images and text into one space, so a photo can be the query. Add this second retriever to the manifest’s retrievers list and apply with ?mode=upsert, which creates it beside video-search:
video-understanding.namespace.yaml
Query it with a photo of a car. The AMC Jeep segments should rank first:
cURL

Split video a different way

Upsert changes an extractor’s parameters only on an empty collection. Once video-moments holds documents, apply refuses the change and names the collection, because the stored segments were cut with the old settings. To try another split, add a second collection over the same bucket. This one cuts at scene changes, with each scene capped at 30 seconds:
video-understanding.namespace.yaml
Add it under collections, apply with ?mode=upsert, then process the videos already in the bucket. This bills the same 0.20 USD a minute again for the new collection.
cURL
Point a retriever at it by adding video-scenes to its collections. Other splits: silence cuts at pauses in the audio, which suits lectures, and whole keeps one segment per video. Multimodal extractor documents every parameter, including run_ocr for on-screen text and run_video_description with response_shape for structured labels per segment.

Next steps

Ingest video from S3

Feed the same pipeline from an S3 prefix with a continuous sync.

Feature search

Every search, fusion and query mode the retriever stage accepts.

Tag segments

Label segments such as “product demo” or “interview” with a taxonomy.

Find recurring scenes

Cluster segment embeddings to group visually similar footage.