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.
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.
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:
- Screenshot only the strip with the badge , not the whole screen: about 5 s → 0.9 s on the little stick.
- Press keys through the stick's virtual remote instead of Android's slow key command: up to 10 s → instant.
- Read the countdown and Prime's progress bar, which has dots where the ad breaks are.
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.
From the laptop to everywhere #
- Raspberry Pi: laptops sleep, so the watcher moved to my Pi as a service that starts at boot and restarts itself.
- The projector (BenQ GV30): same Prime, same badge, but its mute key toggles the speaker chip blindly, so the cover app got its own mute switch.
- No Pi at all: during an ad, Prime still says "playing" but takes away seeking. The app on the box watches for exactly that, with no screenshots.
- YouTube: reports its ads the same way, so it gets muted and covered too, and the app presses Skip as soon as it appears.
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.