Skip to main content
Point a continuous sync at an S3 prefix and every new video becomes searchable segments without another API call. Sample videos are seeded so the first query works before you connect S3.

Jump to the manifest

ingest-video-from-s3.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 s3-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 s3-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 segments from every video the sync has ingested. Stages: feature_search Searches: video-segments

Collections

Each collection runs one extractor over a bucket, or over another collection’s documents.
multimodal_extractor@v1 over bucket s3-videos: one document per 10-second segment, with a visual embedding and a transcript embedding. Feeds s3-video-search.Reads bucket s3-videos with multimodal_extractor v1.Inputs: video ← videoCopied onto each document: 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.
ingest-video-from-s3.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/ingest-video-from-s3.md.
Prompt

How it works

The manifest declares four parts:
  1. A storage connection holds read access to your S3 bucket. It belongs to the organization, so other namespaces can reuse it.
  2. A bucket sync watches one S3 prefix through that connection. With sync_mode: continuous it checks for new files every polling_interval_seconds and creates one object in s3-videos per new file.
  3. The sync submits each new batch of objects for processing, so video-segments runs multimodal_extractor on them with no extra call. Each 10-second segment gets a visual and a transcript embedding.
  4. s3-video-search searches both embeddings with one text query and fuses the two lists with dbsf.
As published, the connection and the sync are commented out, because apply tests a connection before it saves it and placeholder credentials would fail. The seed’s sample commercials make the first query work before you connect anything. Synced files land in the same bucket and go through the same collection.
run_transcription and run_transcription_embedding both default to false; without them the speech search finds nothing. The manifest sets both to true.

Connect your S3 bucket

1

Grant read access

Mixpeek needs to list and read objects under your prefix. Object storage has the IAM policy, and the role trust policy if you use a role.
2

Store the keys as organization secrets

The connection reads its keys from ${{ secrets.AWS_ACCESS_KEY_ID }} and ${{ secrets.AWS_SECRET_ACCESS_KEY }}, so the manifest file never holds them. Create both once per organization, with these exact names. This takes an admin API key.
cURL
3

Uncomment the connection and the sync

In the manifest, remove the # in front of the storage_connections: and bucket_syncs: blocks. Set region to your bucket’s region. Set source_path to your bucket name and prefix, written as my-video-bucket/videos/ or s3://my-video-bucket/videos/.
4

Apply again

create_missing creates the connection and the sync and leaves everything else as it is.
Credentials that cannot reach the bucket fail the apply with the connection named.

Run the sync now

To start the first run without waiting for the polling interval, look up the sync’s id and trigger it:
cURL
healthy is false when the sync is inactive or paused, has consecutive failures, or has not progressed for two of its polling intervals. Files that fail after every retry are counted in dlq_total.

Change what the sync reads

Edit the bucket_syncs entry and apply with ?mode=upsert. Upsert updates source_path, file_filters, polling_interval_seconds, schema_mapping, reconcile and batch_collection_ids. It does not change sync_mode, so choose that before the first apply.
initial_only imports what is under the prefix once and then stops. Use it for an archive that does not grow.
ingest-video-from-s3.namespace.yaml

Map S3 metadata onto each object

schema_mapping decides what each synced file writes into the bucket object. The published mapping writes the parent folder’s name as category, so videos/household/tide.mp4 gets category: household, which field_passthrough copies onto every segment. Other sources for a field:
ingest-video-from-s3.namespace.yaml
Every key under mappings must be a property in the bucket schema, so add campaign and shoot_date to s3-videos as type: string in the same edit. To filter segments on a new field, append it to the collection’s field_passthrough; segments extracted after the change carry it. To filter a run to one folder:
cURL

Use an IAM role instead of keys

A role keeps long-lived keys out of Mixpeek. Replace the connection’s credentials block; its trust policy must allow Mixpeek to assume it with your external_id, as Object storage describes.
ingest-video-from-s3.namespace.yaml
Use your own account id, role name and external id. For S3-compatible storage such as MinIO, keep access_key credentials and add endpoint_url to config.

Seed from your own bucket

A seed blob written as {connection, path} reads one object through the connection, which gives you a first query on your own footage at apply time:
ingest-video-from-s3.namespace.yaml
The seed runs once, at apply, and every seeded minute is billed like a synced one.

Control cost

Processing costs 0.20 USD per minute of video, for every collection that reads the bucket. The namespace’s budget.daily_usd pauses new batches once a day’s spend reaches it. Raise it to cover a normal day of new video:
cURL
At 20 USD a day the namespace processes up to 100 minutes of new video a day. To ingest objects now and process them later, set skip_batch_submission: true on the sync: it creates objects and submits nothing, so nothing is searchable until you trigger the collection.

Other storage providers

The same bucket, sync and collection work with GCS, Azure Blob, R2 and other object stores. Change provider and config on the connection; Object storage lists each provider’s config fields. For fusion, moments, reranking and image queries on this kind of collection, see Video understanding.