How MythTV Detects and Flags Commercials
peterdaly writes "Automatic commercial detection is the "killer app" feature that none of the commercial DVR's dare to include. MythTV's automatic commercial detection does a great job of properly separating commercials from content. Here's how the commercial flagging works."
Automatic commercial detection is the "killer app" feature that none of the commercial DVR's dare to include.
A sentence that (I think) neatly points up the big problem with the USA's legal system...
Another thing they might try is to look at average loudness. It seems like commercials are pumped up a bit from regular shows.
Tom.
Videoredo edits mpeg files without re-encoding them a la adobe premiere. ( == lightning fast)
It also has extremely sophisticated commercial detection (never failed me), based on blackouts, duration of blackouts, duration between blackouts, percentage of screen changed to black, etc.
http://www.videoredo.com/
"Automatic commercial detection is the "killer app" feature that none of the commercial DVR's dare to include."
Ummm, no.... I'm sure many people here are already aware, but if not - check out Beyond TV (http://www.snapstream.com/). The guys over at Snapstream have been doing automatic commercial detection for a while now, and Beyond TV is in the category of a Commercial DVR. And, I'm pretty sure that other companies have been doing it too. This is nothing new - and hasn't yet been a 'killer app'.
.. is that you'll get people making cleverer or less obvious infomercials.
How does MythTV's Commercial Detection work? Surprisingly well. Ever wonder how it does such a good job of identifying commercials?
There are three key indicators that MythTV uses from recorded content to identify commercials.
A blank frame is many times sandwiched in-between the television show and the commercials. The most simple form of detecting commercials is to search for blank frames in the video feed. The problem with this is that it can be very misleading. There can be a blank frame anywhere. Just because there is a blank frame, doesn't mean it's a commercial break. You could easily end up with commercials marked as part of the show and parts of the show marked as commercial.
Scene transitions are another indicator. A scene transition is a cut between one video of something and a video of something else. A simple example would be in a newscast where someone is being interviewed. While the anchor is asking the question, you may see both the anchor and the person being interviewed. When the person being interviewed starts to answer the question, the scene "cuts" to a close-up of the face of the person answering the question. In regards to commercials, there is a scene transition "cut" between each commercial. Each commercial usually is unrelated to the next. The last frame of one commercial would be totally different from the first frame of the next. Looking for patterns in scene transitions is one way to identify commercials. Five groups of 30 second scenes all grouped together may be a good indication of a block of commercials. This method works better than the blank frame method, but also isn't foolproof. There's no reason scene changes in a show might not mimic commercials, and vis-versa.
The third indicator of commercials that MythTV uses I find rather ironic. Bugs, also referred to as DOGS (Digital On-Screen Graphics), or Watermarks. A Bug is that little TV station logo in usually the bottom right corner of your screen during a TV show. I find this ironic because one of the reasons or it being there is to build channel awareness in the world of digital video recorders like MythTV. Since DVR users usually find shows by name rather than by channel, they are less concerned with which station a show is on than are other viewers. MythTV watches for these things. Because the digital watermarks are generally not shown during commercials, identifying one and then watching for it is a good indication of when a commercial break starts or stops. While much more complicated to implement than watching for the blank frame or screen transition, in theory it's probably the most effective in some circumstances. Because in practice they are hard to identify on some stations, the actual implementation can be error prone.
MythTV looks for all three of these identifiers to locate commercials. It breaks each show up into scenes, and then applys a series of score for the scene based on looking at all three factors in relation to one another, especially taking timing and patterns into account. Based on the final score of a scene, it's either (essentially) dropped into the show bucket or the commercial bucket. It's not a black/white type thing. Because of the scoring, there are a whole range of grays in the middle. You end up with scenes that looks "more" like commercials or "more" like show content, and they are then flagged as such.
I've been quite impressed at the quality of the commercial flagger that MythTV has implemented. In my experience, the system does an excellent job.
Commercial flagging is set globally in:
Utilties/Setup -> Setup -> TV Settings-> General
Do you have ideas or talent that can help increase the quality of this great tool? Check out and contribute to the MythTV commercial flagging developers' wiki.
Well, it depends on how you set things up. It can be set to remove them, but personally, I just let it mark the commercials. Basically, it puts timestamps in the database for the start and end of a commercial. You can then set myth to automatically skip them during playback, or, as I do, play them, and then I use the remote to skip the commercial. I find myth to be probably around 85% accurate on its detection. Pretty good, but far from perfect.
...upon thinking about it, I don't know that it's all that far-fetched. Designing a system that can segregate commercials from television with a high degree of accuracy is probably comparable to information compression in the level of information/context comprehension required by the device. I begin to seriously wonder if there might be advances in AI that come out of work like this.
I say this because, ultimately, the difference between commercials and "content" is entirely made up of the information they present. As advertisers and broadcaster get better at removing the "flag" type of marker (blank frames, scene cuts, predictable timing) from commercials, there will be incentive to develop more intelligent ad-blocking mechanisms. Obviously, we're not at that point yet, as the methods described as employed by MythTV are fairly naive flag detection mechanisms - but with growing incentive, the odds of working towards a truly intelligent ad-removal scheme increase.
I think it would be hilarious if the biggest mind-mushing technology of all time (television) turned out, indirectly, to contribute to the rise of alternate, machine, intelligence.
Reality has a conservative bias: it conserves mass, energy, momentum...
Homeland Security and the CCLA (Concerned Citizens Liking Advertising*) can now reveal the horrible truth:
MythTV is a front for American's sworn enemy, Al-Qaida.
Also, some people who use MythTV have French accents, and many others have eaten French Bread.
Do the right thing. Install a wholesome, American operating system on your MythTV box and run a Advertising Ready (tm)** PVR solution.
It's the patriotic thing to do.
And we'll be watching.
* A product of the National Association of Broadcasters.
** Advertising Ready is a registered trademark of your friends and fellow consumers at AWMC (Americans Welcoming Mind Control) ***
*** A product of [REDACTED BY HOMELAND SECURITY]
You're not wrong, but you miss the point.
Consumers are tired of the commercial bombardment. And many of us are already paying to watch TV -- through payments to the cable company or to the satellite company. From the consumer's point of view, we're paying for the show, and then the viewing experience is degraded with non-content.
TV networks are in dire need of a better marketing model that better serves the consummer of their product.
The availability of this technology is a threat to the existence of less innovative networks. And it should be. Creative destruction is a good thing.
It's not slashdotted... it's just auto skipping the commercials.. ;-)
- F1 NEWS
Why not use volume? I think it would be a good addition. Anyone trying to NOT wake up their significant other, or a small child while watching TV has noticed this. The Volume for the commercials is much louder than that of the shows. I can't tell you how many times the 'kids' have been woken up because I was out of the room when the commercial came on, and it was LOUD.
Do not meddle in the affairs of sysadmins, for they are subtle, and quick to anger.
Comcast where I live (Boston, MA) has lately begun offering a targeted advertising service - "Spotlight" - which detects and overwrites network and affiliate commercials with their own (usually very cheaply done) local commercials. You'll get part of a network commercial, then some guy selling couches in the next town, then the tail end of another network commercial.
So, I'm sure they're compensating the networks for the commercials they're overwriting, right? I mean, with network commercial time costing in the gigabuck$ and all. And when we viewers do the same thing, we're stealing the networks' life blood...
I'm going to need a little more convincing.
A close buddy of mine who makes "ripping" software for Tivo, also has a suite of tools that he cannot make public, one of which automatically will remove the trailers and credits of a show, and all commercial breaks.
He wrote this on his own, and said it was pretty easy to figure out if you just watched the mpeg stream (though I've never done it...)
He had a discussion with the guys at Tivo once, and when they discovered that he had this feature, they told him NOT to make it public, and that if he did, "bad things" (involving lawyers) would happen.
So he kept the tools for his own personal use.
--Ray
http://www.beanleafpress.com
Maybe MythTV can also remove the BS filler that is in programming too. As an example take any HGTV half hour TV show:
Step 1(Minutes 0-2). Useless introduction and program intro
Step 2(Minutes 3-5). Explain the situation
Step 3(Minutes 6-8). Commercials
Step 4(Minutes 9-10). Re-explain the situation
Step 5(Minutes 11-14). Try to create some drama out of thin air
Step 6(Minutes 15-17). Commercials
Step 7(Minutes 18-19). Re-explain the situation
Step 8(Minutes 20-23). Try to create some more drama out of thin air
Step 9(Minutes 24-26). Commercials
Step 10(Minutes 27-29). Restate what happened
Step 11(Minutes 29-30). Cue the music and intro the next program
As you can see, there's not too much real show in there.
I think that there should be an open commercial ID (maybe a frame with certain properties, like a specific color or shade of grey - it should be very easy to pick out.
If there was one, we (AmericaFree.TV) would use it, and I suspect other Internet television broadcasters would too. Why ? Because in the long run commercials (as opposed to product placements, sponsored events, etc.) will only work if people want to receive them, and because people will just fast forward through them anyway.
Myself along with many others are looking to buy a set-top media box that:
- is open: can run MythTV,Linux,Vlc,mplayer,... and no reverse engineering is required to use basic hardware (and hopefully mpeg decoders).
- has DVI output
- has S/PDIF out
- is fanless
Basically an open DVD player with DVI out. A DVD player costs $50, but an "open" DVD player costs $1500? $300-$500 would be ok.
Or basically, a fanless mac mini, fanless MiniPC,...
I recently got so annoyed by this that I fired off a nastygram to Comcast. Here's their canned reply.
(I call B.S., of course. If I can do real-time "normalization" with MPC, AC3filter, etc. for free, you're telling me they can't figure it out on their budgets?)
Me: "Why is it that the commercials are about 50% louder than the regular programming content? It's bad enough that I have to pay a monthly bill to get so much advertising content, but it's even worse to have the ads shouted at me..."
Comcast: "This problem is not unique to any one station or company. The phenomenon has a lot to do with the varying sound levels of a television program as compared to the generally consistent sound level of commercials. Broadcasters like Comcast do not turn up the sound of commercials and in fact, we go to great lengths to minimize the sometimes-jarring effect when transitioning from a program to a commercial.
In an attempt to grab viewer's attention in only 15 or 30 seconds, most commercials are produced to be dynamic and exciting. To achieve this they make the sound at a constant maximum level for the duration of the commercial. In sharp contrast, many TV programs have a wider dynamic range or in other words, they can vary from sound passages as quite as a kitten purring to loud music and bombs exploding. If the final scene before a commercial is a quieter, subtler scene, the transition to a commercial can make that commercial seem louder and sometimes even send you diving for the remote control to turn it down.
Most TV program producers attempt to "compress" the program sound to lessen the sound difference between the quite and loud scenes. In addition, Comcast and most broadcasters use sophisticated sound processors to further monitor and "even out" the volume levels. After all, it's in both the producer's and the broadcaster's interest to make the viewer's TV experience an enjoyable one. In spite of these efforts, challenges remain and occasionally the commercials still sound louder. This is particularly true for other stations, whose broadcast schedules consist of movies. Most movies are made for a movie theatre and have a wide dynamic audio range. Films specifically designed for the theatre can have sound passages ranging from quiet whispers to extremely loud passages such as bombs or heavy metal music. This can sound fine in a controlled environment like a movie theatre but when the same film is played on TV, the viewer may find it necessary to raise the volume for the quieter passages and perhaps even turn down the volume on the louder passages.
This problem has been around since the beginning of television and at Comcast we go to great lengths to correct this as much as possible. At Comcast television we are always working hard to improve the viewing experience and we thank you for your comments.Please chat back after the hour if the problem persists for a tech visit."
What you want is irrelevant; what you've chosen is at hand! - Spock, ST VI