Hacker News new | ask | show | jobs
by 171243 2623 days ago
I was thinking of a device similar to a pi-hole for blocking TV commercials. It plugs into your TV's HDMI port and somehow as soon as a commercial starts it switches to playing some relaxing music or a low key picture slide show. Even just switching to a blank screen would be better than the commercials yelling at me. Not really sure if it is feasible because it would have to have the smarts to distinguish between the actual tv show and a commercial but I'd play good money for something like this. And for bonus there would be some running metrics, just like how those water fountains that say something like "saved 3432 plastic bottles from entering the environment," this would say "saved you for seeing 242 hours of commercials"
17 comments

The easiest way to achieve this is just don't watch live.

I honestly don't remember the last time I watched actual live TV. I just recorded it and watch it later, then fast forward through all the ads.

Even if I'm watching it the same night, I'll just sit down to watch it slightly late, so I've got enough of a buffer to skip the ads, and catch back up to live by the end of the show.

Rarely if ever see commercials. Everytime I go to my grandparents I am shocked at how obnoxiously loud commercials are. And how desensitized I was for decades when I never noticed them.
Surely a computer can do that in sub-second time? As soon as it sees the signature of a well known advert start blocking.

Then again, what about clips from the show that you're watching, it might start blocking part of the show as it thinks it's an advert.

I think that you can just look for specific markers in the stream to detect ads. e.g. I look for SCTE-35 (https://en.wikipedia.org/wiki/SCTE-35) in Twitch streams to filter out their ads. It takes no CPU at all to do. I believe broadcast TV has a similar thing in many places.
What software do you use to do that?
Well, I watch Twitch using a personal fork of https://github.com/SebastianRask/Pocket-Plays-for-Twitch (which isn't really actively maintained), so when Twitch ads became in-stream this year, I replaced the default Android media player it uses with Google's ExoPlayer, and then made a bunch of changes to ExoPlayer to be able to detect when SCTE35 segments would be played, and silenced them.

I modeled my change on similar changes made by Streamlink's Twitch plugin recently: https://github.com/streamlink/streamlink/pull/2372

I have used this method with node.js+ffmpeg for Australian TV streams;

https://gist.github.com/satori99/2cb06938bfe8532ecc00e609065...

Seems like this is something machine learning would be very good at, given that commercial visuals look very different from “real” show visuals
> Seems like this is something machine learning would be very good at, given that commercial visuals look very different from “real” show visuals

This feature was in MythTV literally 10+ years ago. Commercials are very easy to detect using simple methods [0].

[0] https://www.mythtv.org/wiki/Commercial_detection

As far as I know audio levels in commercials are different too. I don't know the exact number, but I seem to recall reading some time commercials are usually 30% louder or something. They are definitely noticeably louder than most shows, except maybe sitcoms.

ETA: Looking it up it looks like America has laws about this now. I'm in Canada I'm not sure if it's the same here.

And on further reading, it seems like advertisers may be using excessive compression to artificially boost loudness and skirt the law.

There's volume and then there's "loudness."

Even if peak volume is under some prescribed maximum, compressed audio can feel very loud. Commercials often leave very little dynamic space, which makes them jarring in that they feel "loud."

Movies also have loud scenes which would false positive.
Why bother? There are already known ways to detect commercial breaks like so many milliseconds of black screen, and such. Also, there are very few commercials on television at any time, including local ads. You could just fingerprint them.
Just look for consistently louder volume.
Or check if the TV-Channel Logo is shown in the corner. At least in Germany the Logo is hidden during commercials.
Surely subtitles would be an awesome signature to use?
Plex says this about their commercial removing tech:

"The process is CPU-intensive and can take several minutes to complete, depending on the recording duration. On a reasonably fast CPU, we typically see a 30-minute recording take 2-4 minutes to process."

Assuming they know what they are doing, real time blocking seems not possible with a reasonably modern approach.

What leads you to believe that something that can process a 30 minute file in 3 minutes, can't be done in real time?
Maybe more context:

"The recording is analyzed on various characteristics such as black frames, silences and changes in aspect ratio.

Based on this information Comskip segments the recording in blocks and using heuristics, together with additional information such as the presence of logo, the scene change rate, Close Captioning information and other information sources Comskip tries to determine what blocks of the recording are to be characterized as commercials."

It doesn't say it explicitly, but based on this and the note on high CPU utilization, I get the impression it has to look back and forward to determine where the commercial is.

Given enough of a buffer and a historical corpus, it should be possible to do this in near-realtime, but likely with a few minutes of buffer. Especially with some kind of historical trained classifier, it should be possible to do this in close-enough-to-realtime-to-be-useful scale.
I've been beating my head against a brick wall trying to encourage my (elderly) parents to get (& use) a dvr. To this day they channel surf when the ads come on, grumbling every time.
Live TV is still the best way to watch live events. Sports and live news broadcasts etc.

If you want to watch a prerecorded show then skipping is feasible but for watching a live event at a distance (proper tele-vision) it’s obviously not.

I don’t think many fans of live sports TV would consider watching the game starting 20 minutes after to be able to skip commercial breaks.

This is a good point. Not really being much of a sports fan myself it's not a problem that had occurred to me.

I guess it depends on the type of programmes you watch.

Who said we want easy solutions?
Sitting there holding the remote then pressing fast forwarding and watching closely, usually overshooting then jumping back a bit is not ideal or necessarily easy.
The breaks are always about the same length here so it's more like: hit skip 30s forward four times and you're good.
I pay for TV (not by choice, bundled into my internet), but I still watch the illegal sports streams because the video quality is just as good and the streamers automatically block out the commercials during the breaks. I also get to watch with Twitch chat and can easily rewind the stream if I miss a big play. Television is an awful way to consume media.
> Not really sure if it is feasible because it would have to have the smarts to distinguish between the actual tv show and a commercial but I'd play good money for something like this.

If you live in the US, and broadcasts are delivered to you with IPTV, then reading about SCTE-35 might be of interest.

https://en.wikipedia.org/wiki/SCTE-35

Though I don’t know if these control messages are actually included in the video stream that is broadcast to the viewers, so it might be a dead end, but I think I read that at least some channels do include them in the broadcast stream. Might be worth looking into.

Coordinated agents could probably do well at this.

You and your neighbor may not be seeing the same ads[0]. The cable companies and advertising companies can show each subscriber something different on the same channel. But they only do that during ad time- when more customized content is a way to make money. During the show, they're currently incentivized to show you both the same content. Even if this type of thing isn't going on, it's been obvious for 20 years that some ad time is given to local ads vs national ads.

All we need then is a system where each member shares some small hash of what they're seeing on this channel every second or so. When the group sees their hashes diverge, it's ad-time. Turn on your relaxing music.

So long as this doesn't become too common, the cable networks would have a hard time changing their behavior to try to fight this. They make too much additional money with the customized advertising.

[0]When I was a Google intern almost a decade ago, another intern explained to me that her division of Google had bought out 100% of the ad time on a cable network and resold the ad time with targeted customer demographics, making a profit doing so. I can only imagine how crazy the targeting systems are now.

> it would have to have the smarts to distinguish between the actual tv show and a commercial but I'd play good money for something like this

Pre-CALM[1], you might have been able to use the relative volume change to detect ads. Not sure if that will work anymore. Some kind of visual/audio fingerprinting might work best these days, collecting information about new ads in the process.

[1]: https://en.wikipedia.org/wiki/Commercial_Advertisement_Loudn...

I was thinking along the same lines. In response to CALM they started basically maxing out the sounds of the commercials. Technically they’re no louder than the loudest part of the program but it’s ALL that loud so it sounds like they’re yelling at you. I don’t know how easy that would be to detect versus a loud sequence in a show, but I think detecting it as one metric amongst others would be doable.
There was a project that did exactly this, I'll see if I can find the link, most of the work was spent stripping HDCP. The key heuristic in ad detection is that (at least in 2014) there is usually a single black frame between content and advertisements, and ads are rarely transmitted with more that stereo audio, while most content comes as 5.1 or 7.1 channels, even if it is a naive upscale.
This seems awfully specific, but people are already working on this full time [1]. Their hardware detects the commercials and swaps them out for content of your choosing. Seems like it's targeted toward businesses who want to show their own ads instead of commercials.

[1] https://taiv.tv/

I actually run the team behind this - really cool to see it come up here! It's a much harder problem than it sounds like at first. Our solution uses custom hardware and a lot of AI and has taken our 4 person team over 9 months to build. We are b2b for now, but that could always change. Hopefully we'll have some big updates to share soon!
They broadcast a code at the start and end of the ad segment for networks. I have vcr from 1996 that skips ads. Once it saves the recording it rewinds and fast forwards until it finds the ad marks it. When viewing an ad it automatically fast forwards. RCA
The NeTV board by Bunnie Huang is intended for use cases like this:

https://www.bunniestudios.com/blog/?p=5308

It would sit between your set-top box and your TV, analysing the incoming HDMI signal, changing things in the video stream, and then outputting the new signal to the TV.

I especially want something like this for nhl.tv (hockey games streamed) they literally play a sole commercial about 20 to 30 times a game. The same commercial gets used for about 5 games too. It’s borderline torture. I’ve gotten very good at muting.
I haven’t had an arial lead for my tv for a long time but have an Apple TV and so have actually been watching commercial tv through that (the tv app aggregates all shows so you can use it as a bit of a TV guide, and it seems to come preloaded with the app for each of the Australian stations).

I haven’t configured this setup, but when I watch the shows delayed on my pc (on delay, not live) the ads are blocked due to my browser ad blocking - which shortens the overall length of the show as they seem to be injected rather than part of the stream

I wonder if you could repurpose the mythflagcommercials process from MythTV to do this. It has a variety of methods to detect commercial breaks.
This came to mind as well great suggestion.

I haven’t used MythTV in years but I remember it being quite decent at commercial detection. Sometimes it missed the boundary between show and commercial by 1-2s, but otherwise was great.

(I bet they check for volume changes as one of the algorithms)

The big problem with MythTV commercial detection is that transitions that fool the algorithm into cutting off some of the desired content will almost always fool you too. It's fairly rare, but you might not even realize that it happened, only that the plot seems disjointed or incomplete.

I suspect that other commercial skipping systems would have the same problem.

TiVo does this in many cases if you turn on the parental controls. It will hide the commercials if it isn’t sure what the rating is. On recorded shows it also has a skip commercials function on most of them as well.

By far the best way to watch TV these days IMO.

Yes, yes, yes, yes! I dream about the same thing. And an overlay with a light gun to shoot holes in whatever's on. And this device could do some processing, like SETI, or whatever other useful thing.
ReplayTV a precursor to Tivo had this funciontaity back in 2000. It did it very well. So this is a solved problem. and they did it with simple hardware.

They did get sued into bankrupcy for it

Maybe if the hypothetical device had access to closed captioning? The idea being that the closed captioning text for commercials should be easily recognizable.
I know laziness sells, but really is it so bad to just click the mute button and turn on some music? I rarely watch TV these days but when I do I often sit with a different form of entertainment (music player, laptop, handheld video game system) and just switch to that during commercials.

To me the real issue with commercials isn't the fact that they're selling me something, it's the fact that they're interrupting my entertainment. That will happen regardless of whatever pops up on my screen.

In saying all that, I do like the concept. Perhaps video taping a show and removing the ads afterwards would have the optimal effect? Just googling around I seem to find some video taping software already has this feature, not sure how well it all works though.

Unless I'm watching the muted commercials intently (which sort of defeats the purpose), I'll commonly miss the beginning of whatever show I was watching when it comes back from the commercial break. I'd really appreciate some automation to handle that for me.