Show HN: Gemini can now natively embed video, so I built sub-second video search
Recorded: March 25, 2026, 3 a.m.
| Original | Summarized |
GitHub - ssrajadh/sentrysearch: Semantic search over videos using Gemini Embedding 2. · GitHub Skip to content Navigation Menu Toggle navigation
Sign in
Appearance settings PlatformAI CODE CREATIONGitHub CopilotWrite better code with AIGitHub SparkBuild and deploy intelligent appsGitHub ModelsManage and compare promptsMCP RegistryNewIntegrate external toolsDEVELOPER WORKFLOWSActionsAutomate any workflowCodespacesInstant dev environmentsIssuesPlan and track workCode ReviewManage code changesAPPLICATION SECURITYGitHub Advanced SecurityFind and fix vulnerabilitiesCode securitySecure your code as you buildSecret protectionStop leaks before they startEXPLOREWhy GitHubDocumentationBlogChangelogMarketplaceView all featuresSolutionsBY COMPANY SIZEEnterprisesSmall and medium teamsStartupsNonprofitsBY USE CASEApp ModernizationDevSecOpsDevOpsCI/CDView all use casesBY INDUSTRYHealthcareFinancial servicesManufacturingGovernmentView all industriesView all solutionsResourcesEXPLORE BY TOPICAISoftware DevelopmentDevOpsSecurityView all topicsEXPLORE BY TYPECustomer storiesEvents & webinarsEbooks & reportsBusiness insightsGitHub SkillsSUPPORT & SERVICESDocumentationCustomer supportCommunity forumTrust centerPartnersView all resourcesOpen SourceCOMMUNITYGitHub SponsorsFund open source developersPROGRAMSSecurity LabMaintainer CommunityAcceleratorGitHub StarsArchive ProgramREPOSITORIESTopicsTrendingCollectionsEnterpriseENTERPRISE SOLUTIONSEnterprise platformAI-powered developer platformAVAILABLE ADD-ONSGitHub Advanced SecurityEnterprise-grade security featuresCopilot for BusinessEnterprise-grade AI featuresPremium SupportEnterprise-grade 24/7 supportPricing Search or jump to... Search code, repositories, users, issues, pull requests...
Search Clear
Search syntax tips Provide feedback Include my email address so I can be contacted Cancel Submit feedback Saved searches
Name Query To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up
Appearance settings Resetting focus You signed in with another tab or window. Reload to refresh your session. Dismiss alert ssrajadh sentrysearch Public
Notifications
Fork
Star Code Issues Pull requests Actions Projects Security Insights
Additional navigation options
Code Issues Pull requests Actions Projects Security Insights
masterBranchesTagsGo to fileCodeOpen more actions menuFolders and filesNameNameLast commit messageLast commit dateLatest commit History23 Commits23 Commitsdocsdocs natural-language-video-searchnatural-language-video-search sentrysearchsentrysearch .env.example.env.example .gitignore.gitignore README.mdREADME.md pyproject.tomlpyproject.toml View all filesRepository files navigationREADMESentrySearch demo.mp4 How it works Clone and install: git clone https://github.com/ssrajadh/sentrysearch.git Set up your API key: sentrysearch init Index your footage: sentrysearch index /path/to/dashcam/footage Search: sentrysearch search "red truck running a stop sign" Manual setup: If you prefer not to use sentrysearch init, you can copy .env.example to .env and add your key from aistudio.google.com/apikey manually. Usage --chunk-duration 30 — seconds per chunk Search Saved clip: ./match_front_2024-01-15_14-30_02m15s-02m45s.mp4 1 hour = 3,600 seconds of video = 3,600 frames processed by the model. The Gemini API natively extracts and tokenizes exactly 1 frame per second from uploaded video, regardless of the file's actual frame rate. The preprocessing step (which downscales chunks to 480p at 5fps via ffmpeg) is a local/bandwidth optimization — it keeps payload sizes small so API requests are fast and don't timeout — but does not change the number of frames the API processes. Preprocessing (on by default) — chunks are downscaled to 480p at 5fps before uploading. Since the API processes at 1fps regardless, this only reduces upload size and transfer time, not the number of frames billed. It primarily improves speed and prevents request timeouts. Search queries are negligible (text embedding only). --chunk-duration / --overlap — longer chunks with less overlap = fewer API calls = lower cost Limitations & Future Work Still-frame detection is heuristic — it uses JPEG file size comparison across sampled frames. It may occasionally skip chunks with subtle motion or embed chunks that are truly static. Disable with --no-skip-still if you need every chunk indexed. Compatibility Python 3.10+ About Semantic search over videos using Gemini Embedding 2. video gemini semantic-search dashcam chromadb gemini-embedding-2 Resources Readme Uh oh! There was an error while loading. Please reload this page. Activity 355 1 9 Report repository Releases Packages
Uh oh! There was an error while loading. Please reload this page. Contributors ssrajadh
Languages Python
Footer © 2026 GitHub, Inc. Footer navigation Terms Privacy Security Status Community Docs Contact Manage cookies Do not share my personal information You can’t perform that action at this time. |
Soham Rajadhyaksha’s `sentrysearch` project provides a semantic search solution for dashcam footage, leveraging the Gemini Embedding 2 model. The core functionality allows users to effectively search through hours of video data by typing a textual query, receiving a trimmed clip of the relevant footage. The system operates by initially dividing the dashcam footage into overlapping chunks, embedding each chunk using the Gemini Embedding 2 model, and storing these embeddings within a ChromaDB database. When a user initiates a search, the query is also embedded, and the system retrieves the most similar video embedding, subsequently extracting a relevant clip from the original footage. The project’s setup involves cloning the repository, creating a Python virtual environment, installing dependencies, and initializing the `sentrysearch` tool with a Gemini API key. The index creation process categorizes the dashcam footage into specified chunks, utilizing options for adjusting parameters like chunk duration, overlap, and preprocessing settings – the latter involving downscaling the video to 480p at 5fps to optimize API requests and reduce costs. The system is designed to handle various file formats, specifically mp4 files, and automatically scans directories for all mp4 files, regardless of their location. The `sentrysearch` tool incorporates several optimization strategies to minimize costs associated with utilizing the Gemini API. These include preprocessing, which downscales video chunks, and still-frame skipping, which intelligently avoids embedding completely static frames. Users are provided with options to control these settings, allowing them to tailor the system to their specific footage and desired level of accuracy. The cost of indexing 1 hour of dashcam footage is approximately $2.84, calculated based on the Gemini API’s pricing. The search queries themselves are considered negligible in terms of cost, owing to the use of text embedding only. The technology behind `sentrysearch` relies on the native video embedding capability of Gemini Embedding 2, enabling direct comparisons between text queries and video pixels without the need for transcription or frame captioning. This enables sub-second semantic search over extensive video data. The system utilizes ffmpeg for video chunking and trimming, simplifying the process for users. However, the project acknowledges certain limitations, primarily related to the heuristic nature of still-frame detection and the potential for inaccuracies in search results based on chunk boundaries. Future development could focus on more sophisticated scene detection techniques to enhance search quality. The project provides a command-line interface with parameters that control several facets of the operation including chunk duration, overlap, and preprocessing resolutions. The system is designed to be compatible with a wide range of dashcam footage, regardless of whether it is Tesla Sentry Mode or other sources. The project is currently in preview, and it's important to acknowledge that Gemini API behavior and pricing may evolve. |