You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OCR frame prep re-probes every frame and runs two serial upscales per frame #291
readFrames probes every frame with an unbounded Promise.all (up to 120 concurrent ffprobe) even though all frames share one known size, then runs the x2 and x4 lanczos upscales as separate ffmpeg passes writing compressed PNGs.
Where
src/utils/ocrScan.ts:27-47 (readFrames)
src/utils/ocrScan.ts:96 (MAX_SCAN_FRAMES)
src/utils/ocr.ts:20 (OCR_SCALES = [2, 4])
src/tools/findText.ts:22-23
Details
Measured locally on a 1080p frame: x2 upscale ~489 ms, x4 ~922 ms (2.7 MB PNG), ffprobe ~146 ms.
Impact
find_text/bug_report scans of 120 frames spend ~170 s upscaling before OCR, and spike to 120 concurrent ffprobe processes.
Pass the known width/height from scanVideoFrames to skip per-frame probes; produce both scales in one ffmpeg (split to two outputs); write intermediates uncompressed (-compression_level 0 or BMP); run frames through the bounded pool from the frame-extraction issue.
Fixed in 81a8a4f: frames from one video are probed once (readFrames(..., { sameSize: true })), buildOcrPassArgs writes both upscales from one ffmpeg run as uncompressed scratch PNGs, and probes and pass runs go through the bounded mapPool. Measured: 20 frames at 1080p, 17.8 s before vs 7.2 s after (2.5x). Verified: new args tests, including a real ffmpeg run checking both output sizes, and the full suite (1089 passed).
Activity
TMHSDigital commentedon Nov 10, 2026
Fixed in 81a8a4f: frames from one video are probed once (
readFrames(..., { sameSize: true })),buildOcrPassArgswrites both upscales from one ffmpeg run as uncompressed scratch PNGs, and probes and pass runs go through the boundedmapPool. Measured: 20 frames at 1080p, 17.8 s before vs 7.2 s after (2.5x). Verified: new args tests, including a real ffmpeg run checking both output sizes, and the full suite (1089 passed).chore: release 0.49.0