\

Show HN: Gemini can now natively embed video, so I built sub-second video search

146 points - today at 2:58 PM


Gemini Embedding 2 can project raw video directly into a 768-dimensional vector space alongside text. No transcription, no frame captioning, no intermediate text. A query like "green car cutting me off" is directly comparable to a 30-second video clip at the vector level.

I used this to build a CLI that indexes hours of footage into ChromaDB, then searches it with natural language and auto-trims the matching clip. Demo video on the GitHub README. Indexing costs ~$2.50/hr of footage. Still-frame detection skips idle chunks, so security camera / sentry mode footage is much cheaper.

Source
  • macNchz

    today at 5:56 PM

    This is a really cool implementation—embeddings still often feel like magic to me. That said, this exact use case is sort of also my biggest point of concern with where AI takes us, much more so than most of the common AI risks you hear lots of chatter about. We live in a world absolutely loaded with cameras now but ultimately retain some semblance of semi-anonymity/privacy in public by virtue of the fact that nobody can actually watch or review all of the video from those cameras except when there is a compelling reason to do so, but these technologies are making that a much more realistic proposition.

    The presence of cameras everywhere is considerably more concerning than the status quo, to me at least, when there is an AI watching and indexing every second of every feed—where camera owners or manufacturers or governments could set simple natural language parameters for highly specific people or activities notify about. There are obviously compelling and easy-to-sell cases here that will surely drive adoption as it becomes cost effective: get an alert to crime in progress, get an alert when a neighbor who doesn't clean up after his dog, get an alert when someone has fallen...but the potential implications of living in a panopticon like this if not well regulated are pretty ugly.

      • citruscomputing

        today at 7:07 PM

        It's being built as we speak. I attended at a city council meeting yesterday, discussing approving a contract for ALPR cameras. I learned about a product from the camera vendor called Fusus[0], a dashboard that integrates various camera systems, ALPRs, alerts, etc. Two things stood out to me: natural-language querying of video feeds, and future planned integration with civilian-deployed cameras. The city only had budget for 50 ALPRs, and they stressed how they're only deploying them on main streets, but it seems like only a matter of time before your neighbor is able to install a camera that feeds right into the local PD's AI-enabled systems. One council member raised concerns about integrations with the citizen app[1] specifically (and a few others I didn't catch the names of). I'm very worried about where all this is heading.

        [0]: https://www.axon.com/products/axon-fusus [1]: https://citizen.com/

        • janalsncm

          today at 7:44 PM

          For specific people they probably wouldn’t use general embeddings. These embeddings can let you search for “tall man in a trenchcoat” but if you want a specific person you would use facial recognition.

            • hypeatei

              today at 8:01 PM

              I think a general description is better for surveillance/tracking like this, no? If they're at a weird angle or intentionally concealing their face then it falls apart but being able to describe them naturally would result in better tracking IMO.

          • Ajedi32

            today at 7:27 PM

            Most cameras are also not queryable by any one person or organization. They are owned by different companies and if the government wants access they have to subpoena them after the fact.

            The problems start cropping up when you get things like Flock where governments start deploying cameras on a massive scale, or Ring where a single company has unrestricted access to everyone's private cameras.

              • Spivak

                today at 7:56 PM

                I think Flock is just a symptom of the underlying tech becoming so cheap that "just blanket the city in cameras" starts to sound like a viable solution when police rely so heavily on camera footage.

                I don't think it's a good thing but it seems the limiting factor has been technological feasibility instead of any kind of principle against it.

            • sohamrj

              today at 6:33 PM

              Totally valid concern. Right now the cost ($2.50/hr) and latency make continuous real-time indexing impractical, but that won't always be the case. This is one of the reasons I'd want to see open-weight local models for this, keeps the indexing on your own hardware with no footage leaving your machine. But you're right that the broader trajectory here is worth thinking carefully about.

                • mpalmer

                  today at 7:06 PM

                  It's 2.50 an hour because Google has margins. A nation state could do it at cost, and even if it's not a huge difference, the price of a year's worth of embeddings is just $21,900. That's a rounding error, especially considering it's a one time cost for footage.

                    • wholinator2

                      today at 7:12 PM

                      Right? $2.50 an hour is trivial to a Government that can vote to invent a trillion dollars. Even just 1 million dollars is the cost of monitoring 45 real time feeds for a year. I'm sure just many very rich people would pay that for the safety of their compound.

              • cake_robot

                today at 7:19 PM

                Yeah, the panopticon is now technically very feasible it's just expensive to implement (for now).

            • rigrassm

              today at 7:52 PM

              I picked up a Rexing dash cam a few months back and after getting frustrated with how clunky it is to get footage of it, I decided to look into building something out myself to browse and download the recordings without having to pull the SD card. While scrolling through the recordings, I explicitly remember thinking it would be nice to just describe what I was looking for and run a search. Looking forward to incorporating this into my project.

              Thanks for sharing!

              • cloogshicer

                today at 7:39 PM

                Could this be used for creating video editing software?

                Imagine a Premiere plugin where you could say "remove all scenes containing cats" and it'll spit out an EDL (Edit Decision List) that you can still manually adjust.

                • totisjosema

                  today at 7:53 PM

                  What is your experience so far with the quality of the retrieved pieces?

                    • sohamrj

                      today at 7:57 PM

                      I've found I have to be very specific to get the clip I'm searching for. For example, "car cuts me off" just returned a clip of a car driving past my blindspot. But, "car with bike rack on back cuts me off at night" gave me exactly the clip I was looking for.

                  • danbrooks

                    today at 6:13 PM

                    I work in content/video intelligence. Gemini is great for this type of use case out of the box.

                    • mdrzn

                      today at 4:23 PM

                      Very interesting (not for a dashcam, but for home monitoring).

                      • emsign

                        today at 4:56 PM

                        Where is the Exit to this dystopia?

                          • nclin_

                            today at 6:18 PM

                            Well, with data analysis powers like this a few treasonous words in front of a flock camera will show you the way.

                            • RobotToaster

                              today at 5:42 PM

                              In the matrix the exit was pay phones, which perhaps explains why our overlords are removing them

                              • jama211

                                today at 5:59 PM

                                I don’t think this means we’re in a dystopia

                                  • zwirbl

                                    today at 6:27 PM

                                    You might not have been paying attention

                                      • 52-6F-62

                                        today at 6:49 PM

                                        I think Radiohead said that

                                • draw_down

                                  today at 6:06 PM

                                  The dystopia of searching for video clips and finding them? What?

                                  • BrokenCogs

                                    today at 5:13 PM

                                    The Matrix style human pods: we live in blissful ignorance in the Matrix, while the LLMs extract more and more compute power from us so some CEO somewhere can claim they have now replaced all humans with machines in their business.

                                      • throwup238

                                        today at 5:26 PM

                                        I was thinking more of the season 3 episode of Doctor Who titled Gridlock where everyone lives in flying cars circling a giant expressway underground, while all the upper class people on the surface died years ago from a pandemic.

                                        • ting0

                                          today at 5:37 PM

                                          Ever get the feeling that the universe is reading your mind? Maybe there's some truth to that after all.

                                  • simonreiff

                                    today at 5:49 PM

                                    Very impressive! A webhook could be configured to trigger an alarm if a semantic match to any category of activities is detected, and then you basically have a virtual security guard and private investigator. Well played.

                                      • sohamrj

                                        today at 6:38 PM

                                        Thanks! Yeah that would be pretty cool, but continuous indexing would be pretty expensive now, because the model's in public preview and there are no local alternatives afaik.

                                        This very well might be a reality in a couple years though!

                                    • nullbyte

                                      today at 5:38 PM

                                      What a brilliant idea! is this all done locally? That's incredible.

                                        • apwheele

                                          today at 5:44 PM

                                          While the vector store is local, it is sending the data to Gemini's API for embedding. (Which if using a paid API key is probably fine for most use cases, no long term retention/training etc.)

                                      • kamranjon

                                        today at 5:18 PM

                                        Does anyone know of an open weights models that can embed video? Would love to experiment locally with this.

                                          • sohamrj

                                            today at 5:37 PM

                                            Not aware of any that do native video-to-vector embedding the way Gemini Embedding 2 does. There are CLIP-based models (like VideoCLIP) that embed frames individually, but they don't process temporal video. you'd need to average frame embeddings which loses a lot.

                                            Would love to see open-weight models with this capability since it would eliminate the API cost and the privacy concern of uploading footage.

                                        • ygouzerh

                                          today at 4:07 PM

                                          That's quite interesting, well done! I haven't thought of this use case for embeddings. It open the door to quite many potential applications!

                                            • stavros

                                              today at 4:34 PM

                                              Man, the surveillance applications for this are staggering.

                                          • dev_tools_lab

                                            today at 4:11 PM

                                            Nice use of native video embedding. How do you handle cases where Gemini's response confidence is low? Do you have a fallback or threshold?

                                              • sohamrj

                                                today at 4:37 PM

                                                as of now, no threshold but that is planned in the future.

                                                for example, for now if i search "cybertruck" in my indexed dashcam footage, i don't have any cybertrucks in my footage, so it'll return a clip of the next best match which is a big truck, but not a cybertruck

                                            • SpaceManNabs

                                              today at 5:25 PM

                                              > No transcription, no frame captioning, no intermediate text.

                                              If there is text on the video (like a caption or wtv), will the embedding capture that? Never thought about this before.

                                              If the video has audio, does the embedding capture that too?

                                                • sohamrj

                                                  today at 5:33 PM

                                                  Yes to both. The embedding is over raw video frames, so anything visible (text, signs, captions) gets captured in the vector. And Gemini Embedding 2 extracts the audio track and embeds it alongside the visual frames. So a query like 'someone yelling' would theoretically match on audio. My dashcam footage doesn't have audio though, so I haven't tested that side yet.

                                              • 7777777phil

                                                today at 5:00 PM

                                                Today I learned that Gemini can now natively embed video..

                                                Cool Project, thanks for sharing!

                                                • Aeroi

                                                  today at 4:35 PM

                                                  very cool, anybody have apparent use cases for this?

                                                    • sohamrj

                                                      today at 4:48 PM

                                                      dashcam and home security footage are the 2 main ones i can think of.

                                                      a bit expensive right now so it's not as practical at scale. but once the embedding model comes out of public preview, and we hopefully get a local equivalent, this will be a lot more practical.

                                                      • giozaarour

                                                        today at 5:16 PM

                                                        I think a good use case would be searching for certain products or videos across social media (TikTok and Instagram). especially useful for shopping, maybe

                                                          • vidarh

                                                            today at 5:28 PM

                                                            Branding/marketing monitoring companies would be all over this.

                                                        • hebelehubele

                                                          today at 5:00 PM

                                                          State surveillance

                                                            • wahnfrieden

                                                              today at 5:28 PM

                                                              Worker surveillance

                                                      • klntsky

                                                        today at 4:27 PM

                                                        why not skip the text conversion? is it usable at all?

                                                          • sohamrj

                                                            today at 4:32 PM

                                                            gemini embedding 2 converts straight video to vectors. in this case, dashcam clips don't have audio to transcribe and even if they did, it would be useless in the search

                                                              • password4321

                                                                today at 4:57 PM

                                                                What are the SoA audio models right now?