DEV Community

QianGull
QianGull

Posted on AI-assisted

Transcript search turns "find that moment" into a text problem

I build a desktop app called ClipKnife for people who edit video on their own machines. A third of the design arguments I have with myself come down to one question: when someone says "find that moment", what am I actually searching?

There are two very different engineering problems hiding behind that sentence.

The expensive one: searching pixels

To search a shot by what happens in it, you need something to look at frames and write words down. So the pipeline is: split the video into shots, pick a representative frame from each, ask a model to describe it, store the description, and let the description be searched.

That works, and it is also the part I argue about most, because every step throws information away. A shot that lasts four seconds gets one frame. A handoff that happens at the end of a long take can be entirely outside the frame I chose. The model describes what it is confident about, which is not the same as what is interesting.

So I treat that pipeline as one signal, not as the truth. The interface has an input placeholder that says, roughly, "describe the picture, tags, or words spoken in audio or video" — one field, three kinds of memory. But the three kinds are not equally easy to serve.

The cheap one: searching words

If the moment you're looking for is something somebody said, the whole vision-model problem disappears. You run speech-to-text once, you get back segments with timestamps, and now the question "where does she say that thing about moving to a smaller city" becomes a substring search over text I already have.

This is the part of my product I'd defend hardest, and it is not clever. Text search is thirty years of solved engineering. What made it useful here was deciding what to store.

Every transcript segment carries: the text, its start and end time, which media file it belongs to, and a precision flag.

That flag is the decision that mattered.

Word timestamps are a promise you may not be able to keep

Word-level timing sounds obviously better: if you know the exact milliseconds of each word, you can cut precisely around a phrase. In practice, word timing quality depends on the audio, and I don't want to pretend otherwise in the data model.

So when word-level timing isn't available, the hit is marked as segment-level only, and the interface says so in plain text: "segment level only". It changes what the buttons offer. Instead of "add the sentence", you get "add the whole segment".

Encoding precision as data rather than as a footnote is the pattern I'd reuse in any text-heavy tool. The moment your UI has to explain that a number is approximate, that approximation should have been a field.

The search result is not a clip

Once you find the line, the naive move is to cut a file out of the original. That is how media libraries rot: now you have two copies, one of which is quietly stale.

So the output of my transcript-montage tool is one of two things. Either a rendered MP4 that keeps the original audio of the segments you queued, or an editor draft that references the original files and leaves them exactly where they are. The same segment can appear in several projects because nothing was duplicated to make the project.

The queue itself is where the human judgment lives. For each candidate you pick one of three grabs: the matched word, the whole sentence, or the whole segment. I kept them as three separate buttons rather than one smart default, because "which part of this take is usable" is the question I cannot answer for you.

What I'm careful not to claim

Transcription and indexing run on your own machine, and your raw footage is not uploaded. Activation and updates do need a connection — "local-first" describes where your media lives, not that the app never talks to a server.

I also don't publish recall or timing numbers. A search that returns something confident and wrong is worse than one that returns nothing, and the interesting engineering question is how the interface admits that, not how fast the first pass is.

If you work on any media tool: what did you end up storing next to your text index — offsets, confidences, precision flags? I'd like to hear what the people who do this at larger scale settled on.

Top comments (0)