<- cd ~/andacbasaran.com
$cat ~/notes/88ms-offline-screen-translation-pipeline.md 4 min read
2026-11-28 · Developer Note

88 ms Offline On-Screen Subtitle Translation on 0 MB VRAM

How SubVision AI pairs RapidOCR ONNX with CTranslate2 INT8 in an asynchronous latest-frame-wins pipeline.

Translating subtitles in fast-paced games or live streams fails immediately if frames queue up. A naive FIFO queue builds multi-second lag the moment a cutscene flashes rapid dialogue.

1. Latest-Frame-Wins Architecture

Instead of queuing every captured region, SubVision AI uses a single-slot atomic overwrite between capture, RapidOCR (~20 ms), and CTranslate2 INT8 NMT (~68 ms). If a new subtitle appears while an older frame is waiting, the stale frame is dropped immediately.

2. Near-Zero Idle CPU Cost

Before running OCR, a lightweight perceptual frame-diff hash checks whether the subtitle bounding box actually changed. During static scenes or dialogue pauses, CPU usage drops to 0.18 ms (~0.2% CPU), keeping game frame pacing untouched — even on Steam Deck.

3. Transparent Click-Through Overlay

Rendering translated text directly over the original subtitle box requires OS-specific click-through window flags so mouse and controller inputs pass seamlessly to the underlying game without stealing focus.