The Ad Muter
Watch it work A real ad, covered and muted. 40 seconds on YouTube.A Mi TV Stick, a laptop, an AI, and a war on Prime Video ads.
Movie night at home: the projector on its tripod, Prime Video on the wall. Then the ads started, and there was no skip button. Every break meant grabbing the remote, muting, and remembering to unmute. Pritam wanted the TV to do that by itself and asked Claude to help. Together they started on a test bench: the Mi TV Stick on a small monitor.
The first idea was simple: let a camera watch the screen. Pritam set up a USB webcam on a tripod, pointed at the screen, and Claude wrote a small program on the laptop to read its picture. The bright screen blew the first frames out completely. With the exposure turned right down, the app tiles became readable, but everything still depended on the room light and on where the tripod stood.
Claude asked Pritam to switch on Developer options and USB debugging on the stick. From then on it could talk to the stick over Wi-Fi using ADB, Android's debugging connection, and it went through the options one by one, testing each on the real TV. Chromecast could mute the stick but had no idea what was on screen. The Google TV remote link knew which app was open, but not whether an ad was playing. Asking Prime for its on-screen text returned nothing at all.
- ✗Webcamworks, but glare and room light decide
- ✗Chromecast mutemutes fine, can't see ads
- ✗Google TV remote linkknows the app, not the ad
- ✗Read Prime's text over ADBPrime exposes no text at all
- ✓ADB screenshotsee the next panel
Then Claude took a screenshot over ADB while an ad was playing. The controls Prime draws on top of the video were perfectly sharp, including the yellow “Ad 0:19” badge in the corner. Counting yellow pixels in that corner was enough: 212 during the ad, none during the movie. No camera, no AI.
The first working version ran on Pritam's laptop. Every couple of seconds it checked whether Prime was open, looked at the badge corner, muted when the yellow “Ad” showed up, and unmuted when it was gone. It only ever undid its own mutes. Then a real ad break arrived in the middle of a movie.
Found it. The yellow "Ad" badge: 212 yellow pixels during the ad, 0 in the movie.
Plan: every ~2 s, if Prime is open, screenshot that corner. Badge there → mute. Gone twice in a row → unmute.
Only undo your own mutes. If I muted it myself, leave it alone.
Deal. And if you unmute during an ad, I stay out of it until that break is over.
Make it fun, but above all reliable. Use all the tricks.
Then I'll also read the countdown, and the ad-break dots on the progress bar, to look faster when a break is near.
Small job: one script on your laptop. Starting now.
Version 1 worked, but it was slow. One look at the screen took about 5 seconds on the little stick, so Claude grabbed only the thin strip with the badge instead of the whole picture. Android's normal key command could take up to 10 seconds, so it wrote straight to the stick's virtual remote. It also learned to read the countdown, and Prime's progress bar told it when the next break was due.
The audio is muted, but I can still see the ads.
Let's hide the video as well.
Doable. A tiny app on the stick can lay a full-screen cover over Prime whenever the watcher says "ad". The remote keeps working, and the countdown corner stays uncovered.
And if the watcher ever goes quiet, the cover removes itself after a few seconds. The screen can't get stuck dark.
Keep it non-invasive. Go.
$ ./build.sh compile resources …… ok compile Java ………… ok convert to dex ……… ok align + sign ………… ok $ adb install adcover.apk Success
Muting fixed the sound, but the ad was still on screen. That night Claude wrote a small app for the stick that lays a dark frosted cover over the TV while an ad plays. It leaves the badge corner clear so the countdown stays visible, and it removes itself if the watcher goes quiet, so the screen can never get stuck dark.
Version 1 lived on Pritam's laptop, and laptops go to sleep. If it slept in the middle of an ad, the TV could stay muted all evening. So the watcher moved to the Raspberry Pi that already sits on the home network. Claude installed ADB and a text reader for the countdown on the Pi, set the watcher up as a service that starts at boot and restarts itself, and switched the laptop's copy off so the two would never fight over the mute button.
muted-by-watcher.flag
Before muting, the watcher writes this note. If it crashes mid-ad, the new copy finds the note and unmutes. The TV never stays stuck on mute.
Next screen: the BenQ GV30 projector, which has its own Android TV dongle inside, the QS01. Same Prime, same yellow badge, but at 720p, so Claude scaled every measurement. Then a surprise: the projector's mute key didn't mute Android at all. It went down a wire to the projector's own speaker chip as a blind on/off toggle. Claude gave the cover app its own mute switch, so the watcher could always tell whether the sound was off.
- ✗Yellow movie artwork fooled it oncenow it checks the badge's shape: a word-sized yellow patch on dark grey
- ✗The movie's first seconds stayed muted for 9 snow it unmutes first and reads the bar later: 2 s
- ✓Real pre-roll, 22 smuted, covered, unmuted
- ✓Real mid-roll, 28 smuted, covered, unmuted on time
With two screens working, Pritam asked a simple question: does this really need a Raspberry Pi taking a screenshot every second? Claude looked at what Prime tells Android about playback, the same report that powers the remote's play button. During an ad, Prime still says “playing”, but it takes away seeking. That one change was the whole detector. No screenshots during playback, and faster than the badge watcher.
Does it even need the Pi?
Maybe not. Every video app tells Android what it's doing: playing, paused, which buttons work. Let me watch what Prime says during an ad.
Found it. During an ad, Prime still says playing, but seek, fast-forward and rewind disappear. The number goes 1049455 → 1049095: exactly 360 apart.
So the TV can watch itself?
Yes. One small app on the TV, listening to Prime. No Pi, no screenshots while you watch.
Prime was handled. But on the Mi TV Box, YouTube was still playing ads, so Pritam asked the obvious question. Good news: unlike Prime on that box, YouTube's TV app reports its ads honestly. During an ad it says “playing” and takes away seeking, the very same sign. So muting was instant. Even better, many YouTube ads can be skipped after five seconds, so Claude taught the app to spot the Skip button and press OK, the remote's own button, all by itself.
Can we do the same to YouTube?
YouTube tells Android the same story: during an ad it's playing, but seeking is gone (51 instead of 379).
So: mute and cover the moment an ad starts. And when the Skip button shows up, I'll press OK for you.
Do it.
- Ad starts (YouTube's status says so)
- Muted and covered
- Skip button appears → OK pressed
- The ad is gone
- Sound back, the song carries on
The ads were silent and hidden now, but a two-minute break staring at a dark screen that says “AD PLAYING” is still two minutes of nothing. So Pritam turned the cover into something worth looking at: a big clock and date, and a quote that changes every seven seconds, taking turns between English and Hindi. Forty of them, written for this. The corner with Prime's countdown stays open, so you always know how long is left.
Make the “AD PLAYING” text larger, and add some funny quotes while the ad runs. Make it less boring.
Done: bigger title, and 25 quotes that change every 7 seconds.
Add some quotes in Hindi too.
Show the date and time.
Alternate between Hindi and English.
Done. Clock and date top-left, quotes take turns: English, Hindi, English…
“AD PLAYING” that big isn't important. Put it below the clock.
Moved. Small and quiet under the clock, the quote gets the middle.
Pritam set up a phone to film a demo on the Mi Stick: a two-minute Prime ad break, covered and muted. It went perfectly, until one ad handed over to the next. The cover vanished for about eleven seconds, and a little sound slipped through. Pritam's guess: the muter had mistaken the end of one ad for the end of the whole break. Claude went through the video frame by frame and through Android's own logs, and found something else. The stick has only 1 GB of memory. Starting the next ad needed a bit more, and Android made room by closing the cover app, twice.
- Next ad starts. Memory runs out. Android closes the cover app
- Android restarts it. It unmutes before checking: the first blip
- Still no memory. Closed again
- Restarted again: the second blip
- Cover back up until the break ends
The cover dropped right after an ad changed. It's not counting the time. It should read the counter.
And the sound did come back.
You're right about the sound: two short blips, one at each restart. But the cover went away 0.24 s after Android closed the app, not because the muter decided anything.
Two fixes. After a restart, the mute and cover go straight back. And I'll teach it to read the countdown, so an ad change can never end the break early.
Do both. Keep Chromecast.
Pritam filmed a fresh demo for the cover of this comic. It worked perfectly, which was the problem: an ad break is long, and ninety seconds of a calm dark screen makes a slow video. So Claude became the editor. It found exactly where the ad began and ended, sped just that part up four times, cleaned up the sound the phone had picked up from across the room, and trimmed the whole thing to forty seconds. Then it wrote the YouTube title and description too.
Here is the video. The ad section is too long, speed it up 4×.
The ad runs from 12.8 s to 103.1 s: 90 seconds. At 4× that becomes about 23.
Don't lose the audio. Can we clean it up a bit?
It was recorded from across the room, very quiet. Cutting rumble and hiss, then bringing it up to YouTube level.
End the video at 40 s.
Give relevant text for each field.
Title, description with chapters, tags, category. And set it to Public or Unlisted, or the comic can't show it.
FilmCraft MCP: installed ✓
Pritam installed a video editor that Claude can drive directly. Its tools only load after a restart, so for this cut Claude reached for ffmpeg instead. Next video, maybe.
With the ads gone, Pritam wanted to tell the story. A blog post was the plan, until a better idea arrived: why write paragraphs when there was Claude to draw panels, dig up old screenshots and keep every fact straight? So Pritam brought the important bits, the photos and a lot of opinions, and Claude filled in the rest. Page by page, with a red pen never far away.
Let's write a blog. The story of how we built this ad muter.
Rethink. Let's make it a comic instead, because we have Claude.
Comic it is. You give me the important bits and the photos, I fill in the facts from our logs and draw the rest.
- the text is hiding important details
- don't club the chapters
- story is important, no need to shrink it
- Claude can't put a webcam on a tripod
- replace “I” with my name, Pritam
- people don't know what ADB is
- exact date and time is not needed
- this chapter is irrelevant for the story
- the failed demo chapter is missing
…and that's the comic you just read.Made by Pritam and Claude, one page after another.
The End
Ads, muted. Movie nights, back.