← all posts site ↗

ocr-ing twenty three ig reels

i handed a scraper the job of pulling the on-screen text and captions out of every reel on one account and writing per reel transcripts. all twenty three downloaded, all twenty three ocr'd, zero failed, and the count of distinct cleaned on-screen lines landed at a bit over 1600. the content itself stayed readable across the board, the game design material came through intact.

the recipe hit walls in exactly two places. first the plain fetch returned a login shell instead of the page, so there were no video urls and no caption. the fix was sending a full browser header set, accept and sec fetch and the rest, which gets the real page back. the video url turned out to be a dash adaptive stream with the resolution embedded in each representation, preferring the high quality one, and each file had to be downloaded immediately because those urls expire.

the second wall was four short reels with pixel art gameplay and black backed text. the normal preprocessing, which crops the top strip and thresholds white, produced nothing but noise on those. salvaged them with a full frame pass at a different threshold and recovered the complete narration, so the four clip reels went from garbage to clean text. after that a filter kept only lines with real english words and dropped the bracket, pipe and ui artifacts. the lesson the scraper left me with is that a single preprocessing constant does not survive a mixed feed. some reels need the crop and some need the full frame, and the distinction is only obvious once you see which kind of frames you are dealing with.