Pritam Writes

I taught my TV to mute Prime Video ads

Movie night: projector on its tripod, Prime Video on the wall. Then the ads started, with no skip button. Every break meant grabbing the remote, muting, and remembering to unmute. I wanted the TV to do that by itself, so I asked Claude to help.

The finished thing: a real Prime ad break, muted and covered (40 s, the ad part sped up 4×).

Plan A: a webcam

We started with a test bench: the Mi TV Stick on a small monitor, a USB webcam on a tripod, and the laptop.

Test bench: Mi TV Stick on a small monitor, a webcam on a tripod, and a laptop
The test bench. The webcam watched the screen; the laptop ran the code.

It sort of worked. The bright screen blew the picture out, and turning the exposure right down helped, but everything still depended on the room light and where the tripod stood. Not reliable.

The breakthrough: a black screenshot

I switched on Developer options on the stick, so Claude could talk to it over Wi-Fi with ADB (Android's debugging connection). It tried everything: Chromecast could mute but couldn't see the screen, the Google TV remote link knew the app but not whether an ad was playing, and Prime's on-screen text came back empty.

Then Claude took a screenshot during an ad.

ADB screenshot during a Prime ad: the video is black, but the yellow Ad 0:19 badge is sharp
Prime protects its video, so the picture is black. The yellow "Ad 0:19" badge isn't.

Counting yellow pixels in that corner was enough: 212 during an ad, zero during the movie. No camera, no AI.

Version 1, then fast

The first version ran on my laptop: every couple of seconds, look at the badge corner, mute when the yellow "Ad" appears, unmute when it's gone. It only ever undoes its own mutes. A real mid-movie ad break arrived, and it worked.

Then we made it quick:

Hide the ad, not just the sound

Muted is good, but the ad was still on screen. So Claude wrote a tiny app for the stick that lays a dark cover over the TV during an ad. It leaves the countdown corner visible, and it removes itself if the watcher goes quiet, so the screen can never get stuck dark.

Later I made the wait nicer: a big clock, and a quote that changes every seven seconds, taking turns between English and Hindi.

The ad cover on the TV: clock, date, AD PLAYING and the quote 'Somewhere, a marketing team is crying into their KPIs.', with Prime's ad countdown in the corner
The cover today: clock, a quote, and Prime's countdown still visible in the corner.

From the laptop to everywhere

The demo that failed

Filming the demo, the cover vanished for about eleven seconds between two ads. My guess was a timing bug. Claude went through the video frame by frame and through Android's logs: the stick has only 1 GB of memory, and Android closed the cover app to make room for the next ad. Two fixes later, it held.

The comic

I first told this story as a comic, with panels, chats and a lot of red pen: read The Ad Muter comic. The app's code is on GitHub.

Ads are now silent, hidden, and sometimes skipped. Movie night is movie night again.


Want something like this for your TV, or help automating an Android device? Get in touch.

#adb #ai #android-tv #prime-video #raspberry-pi