[mythtv] alternative method for commercial skipping

Chris Pinkham cpinkham at bc2va.org
Thu May 15 23:03:50 EDT 2003

> Chris Pinkham wrote:
> >I think that generic detection methods such as just detecting a still-frame
> >would work better than trying to capture every still-frame ad that every
> >station uses.
> >
> In case you mean a single picture that stays on screen for some time 
> without changing, that's not what I meant. Stations here don't use that, 
> they have a maybe 5 second clip (animation, video, moving pictures) 

I was replying to what you said about the full-screen logo the other guy
mentioned.  You said:

>> If you want to go with that fullscreen logo route (not sure, if your 
>> stations also do that), you could let the user hit a key when he sees 
>> that ad-start and end and then just store that frame for that station.

I was keying off "store that frame".  I know there are probably 100+
different ways that stations and networks separate their commercials
and I'm just tring to lay the framework to allow us to detect and skip
as many as possible. :)  I think that someone who has access to
stations like you're describing is going to have to do some
coding and/or debugging unless someone wants to put up some sample .nuv
files for me to download.  I'm not talking a 15-meg clip with one
commercial, I mean something like a half hour show so I can see how
the whole thing comes together and how well the code would work across
the board.

> involving the logo somewhere, e.g. some children playing ball with the 
> logo in the background as well as the word "Werbung" (advertizing) 
> somewhere etc.. In other words, if you look for a non-moving picture, 
> you'd probably fail.

If someone could think up a way to detect things like this on-the-fly
it would be great.  No one (or even 5) detection methods will catch
everything, so I think it's going to have to be a combination of things.
I thought about trying to have some sort of rating system to detect
commercials.  So if there's a scene change, then the odds of it
starting a commercial are say 30%.  If the audio is silent during the
change that adds another 20%, and if the scene change goes to black
or from black (either directly or fading), then that's another 20%.
If the 'rating' exceeds a certain value then that likely starts/ends a

> BTW: It is common here that commercial blocks are followed and sometimes 
> preceeded by one or more trailers/previews for other shows or movies of 
> that station. The normal commercial detection code might work for that 
> as well, just mentioning it just in case.

If they are fixed-length (ie, 10 seconds always), that's easier to detect.
If they vary then other methods will have to be used.

> Another idea: That scene change detection scares me a bit, that it might 
> trigger in a movie and that I might miss a small part of the movie that 
> way without noticing it. Maybe add an option to show 1 second of the 

If you're scared it might cut off part of a show then don't turn on
auto skipping.  wait and hit the 'Z' key yourself.  I wrote the code and
even I don't trust it enough yet to use auto-skip. :)  If a commercial
starts, I hit 'Z'.  If it looks like it might have cut something off
(which is rare for the stuff I record), I just back up 5 seconds and
double-check.  The current code shows you how many seconds it skipped
when you hit 'Z' or 'Q' so that's another indicator to make sure it
didn't skip too far.

> I am curious to try out the code you'll check in tonight, thanks for 
> working on it. The movie police will hate you - Cheers ;-P.

Just committed it now.  Let me know if (or how well) it works.


More information about the mythtv-dev mailing list