What it is
Upload a two-hour lecture and ask when backpropagation was explained, or find every segment with a red car. The answer should come back with the timestamps and frames that prove it, never a naked generation.
I built it to learn retrieval over time-based media, one measured module at a time on an M4 with 16 GB. Three pieces are written from scratch (a mini-CLIP, a nearest-neighbour index built up from brute force through IVF to HNSW, and a shot detector) and then measured against the production version behind the same interface. The scratch versions lose, and they're meant to: you can't reason about a retrieval stack you've never implemented.
How it works
- 1
Decode with real timestamps
Time comes from the container's presentation timestamps, not frame index divided by fps, which drifts without bound on variable-rate screen recordings. A two-hour 720p lecture is 556 GB fully decoded, so it never is: at 0.2 fps and 336 px it's 260 MB of pixels and 2.8 MB of index.
- 2
Select frames cheaply
A pixel-difference signal at 96 px scans every frame, and only frames that survive go to the encoder. On the test fixture that cut 354 frames to 57 with nothing lost.
- 3
Index three channels
Whisper base.en gives a transcript with word-level timestamps, chunked into 7–17 s segments. CLIP embeds the selected frames, and OCR reads on-screen text, deduplicated across near-identical slides (89 frames to 14 spans).
- 4
Retrieve and fuse over time
A two-hour lecture is 1,440 vectors, so each channel is searched exactly by brute force. Results are fused over time rather than by unit id, with a sum of calibrated scores, which gives hit@1 of 0.889.
- 5
Rerank into intervals
Adjacent hits are merged into one span and rescored with a cross-encoder at 2.6 ms per candidate, which lifts hit@1 from 0.889 to 0.944.
- 6
Answer with evidence
A token-budgeted packet of frames and text, each carrying its timestamp, goes to Qwen2-VL-2B running locally at 5.5 s per question. One 336 px frame costs 86 tokens, which is why the packet has a budget.
Decisions and trade-offs
Uniform sampling won
I expected content-aware frame selection to beat uniform sampling. It didn't, at any budget, because motion is anti-correlated with information: a sliding square scores 0.047 of change, a whole new slide 0.014.
Brute force over an index
There is no best index. IVF won on clustered data (0.917 vs 0.866) and HNSW on low-rank data (0.991 vs 0.792). My HNSW matched FAISS recall within 0.03 but ran queries 35× slower, and for 1,440 vectors exact search is the right answer anyway.
The metric was wrong, not the model
My timestamp metric reported 0.60 s mean error, and an oracle transcript that was perfect by construction scored 0.64 s. The metric picked which words to score using the predicted timings, which is circular. Aligning by text gave 0.15 s, four times better than the number I'd first published.
Finding the moment isn't answering
Visual questions scored hit@5 of 1.000 on a speech-only system: the narration found the right moment but never named the colour. A separate answerability metric read 0.778 for speech questions and 0.000 for every other type until CLIP and OCR came in.
