Show HN: Gemini can now natively embed video, so I built sub-second video search
TL;DR Highlight
Embedding video chunks directly lets text queries find and trim the matching clip
Who Should Read
A backend developer building natural-language scene search over dashcam or CCTV video archives
Core Mechanics
- Video is embedded directly
- Videos are split into overlapping chunks and embedded with the Gemini Embedding API, Alibaba DashScope, or a local Qwen3-VL model.
- Vectors are stored in a local ChromaDB.
- A search returns a trimmed clip
- The text query is embedded into the same vector space and matched against stored video vectors.
- The top match is automatically trimmed from the original file and saved as a clip.
- Image search and anomaly finding are included
- The img command uses a reference image as the query to find similar scenes.
- The highlights command surfaces anomalous chunks whose embeddings sit far from the rest (knn, centroid, lof).
- Chunks default to 30s with 5s overlap
- Chunks are downscaled to 480p at 5fps before embedding.
- Chunks with no visual change are skipped, detected by comparing JPEG file sizes.
- Local models run without an API key
- qwen8b or qwen2b is auto-selected based on hardware.
- On Apple Silicon, the MLX backend runs the 2B model twice as fast in under half the memory at the same accuracy, per the README.
- Confidence cutoff and rerank refine results
- If the best score is below the default threshold of 0.41 (0.35 on mlx), it asks before trimming.
- --rerank has a VLM re-sort the candidate clips.
Community Reactions
- Concern that wider coverage enables surveillance
- One commenter says nobody being able to review all camera footage has kept a semblance of anonymity.
- They worry AI indexing every feed lets owners or governments set natural-language alerts for specific people or activities.
- Cost seen as practical
- One commenter says $2.50/hr makes this viable for personal and small-business use.
- They expect it to become a default feature of consumer cameras if cost drops another 10x.
- Doubt that 768 dimensions is enough for video
- One commenter built anime similarity search and says it worked okayish.
- They are curious how it holds up for video.
- Improvement and extension ideas
- One commenter suggests ffmpeg's select and scene parameters could replace the still-frame check.
- Others asked whether on-screen text or audio is captured in the embedding.
- Another asked for benchmarks showing how useful the 5s overlap is.
How to Apply
- Run index and search on a few sample videos
- Install with uv tool install and enter your Gemini key via sentrysearch init.
- Index a folder of short videos, then run natural-language searches to check clips come back.
- Run --dry-run first to see chunk counts and estimated cost.
- Tune chunk length and overlap for your footage
- If your events are short, change --chunk-duration and --overlap and compare rankings for the same query.
- Use --target-resolution and --target-fps to balance cost and accuracy.
- Index with a local backend if privacy matters
- Use --backend local or mlx so video never leaves your machine.
- Each backend gets its own index, so stick to one.
- Turn on threshold and rerank when results are noisy
- Raise --threshold and use --dedupe to filter duplicate chunks.
- Add --rerank for VLM re-sorting if false positives persist.
Try It
# Paste into a terminal (Python 3.11/3.12 and uv required)
git clone https://github.com/ssrajadh/sentrysearch.git
cd sentrysearch
uv tool install .
sentrysearch init
sentrysearch index {{path to video folder}} --dry-run
sentrysearch index {{path to video folder}}
sentrysearch search "{{scene description}}" --save-top 3 --rerank --results 10Terminology
Related Papers
FutureBench: A Renewable Framework for Evaluating Knowledge-Context Conflict in LLMs
Adding 'verify and prioritize the passage' to RAG prompts raised false-passage adoption; a knowledge-priority warning fixed it.
Faster Retrieval for Better, More Efficient RAG
Small neural nets learned query routing, hitting the same recall up to 8x faster in IVF search
Memorilla: Latent Semantic Memory for LLMs
Compressing documents into 16 memory tokens beat full-context accuracy on FactKG.
What the Author Wrote, What the Agent Reads: Silent Cue Loss in Enterprise Document Ingestion
Preserving red text and highlights in docx ingestion lifted marked-requirement F1 from 0.150 to 0.690.
Multimodal Reranking Is a System One Decision
One multiple-choice question to a VLM over 16 candidates reranks them, beating a dedicated 2B reranker.
You could have invented transformers from memory
Viewing linear, MLP and attention layers as memory stores: capacity goes ~64 to ~2,700 to over a million
Pointing AI at archives found a forgotten meteorite, lost rhinos, and more
Embedding search plus a cheap filter model surfaced unrecorded events in 400 years of archives
EmbeddingGemma 2: An open, lightweight multimodal embedding model
One open 740M model embeds text, images, audio and video into a single shared vector space