About this project

SentrySearch is a command-line tool for semantic video search. It processes video files by splitting them into overlapping chunks (default 30 seconds with 5-second overlap), generates embeddings for each chunk using either Google's Gemini Embedding API, Alibaba DashScope's Qwen3-VL-Embedding (qwen-cloud), or a local Qwen3-VL model, and stores the vectors in a local ChromaDB database. Users can then search with natural language queries or reference images to retrieve matching video segments, which are automatically trimmed from the original files and saved as clips. Key features include: - Text and image-based semantic search over video - Multiple embedding backends: Gemini API (default), Qwen Cloud (DashScope), and local Qwen3-VL (8B or 2B variants with optional 4-bit quantization) - Automatic hardware detection for local model selection (qwen8b for NVIDIA GPUs 18GB+ VRAM or Apple Silicon 24GB+ RAM; qwen2b for smaller configurations) - Preprocessing pipeline that downscales chunks to 480p at 5fps via ffmpeg before embedding, reducing payload size and inference time - Still-frame skipping to avoid embedding visually static chunks - Confidence thresholding with optional VLM-based reranking (Gemini 2.5 Flash for cloud backends, local Qwen3-VL Instruct for local) - Deduplication of near-duplicate results via cosine similarity ceiling - Highlights mode to surface statistically anomalous clips (knn, centroid, or LOF methods) - Tesla dashcam metadata overlay (speed, GPS, reverse geocoding) on trimmed clips - Integration with SentryMerge for multi-camera event stitching and SentryBlur for face/plate/prompt-based redaction - Dead-letter queue for failed chunks with retry capability - Index management commands (stats, remove, reset) Installation uses uv (Python 3.11/3.12 required). The local backend requires ffmpeg on macOS and PyTorch with CUDA on NVIDIA. Embeddings from different backends/models are isolated in separate indexes. Cost for Gemini backend is approximately $2.84 per hour of footage indexed (default settings). DashScope bills per 1k input tokens by modality. Local backend runs entirely offline with no API costs. The tool is designed for dashcam/security footage workflows but works with any video files. It outputs standard MP4 clips playable anywhere.