[mythtv] PATCH: Commercial detection/skip using blank frames

Chris Pinkham cpinkham at bc2va.org
Sat Feb 22 07:48:27 EST 2003

> 1) On my PIII-800 (512mb RAM), it takes about 4 seconds per minute to "find"
> the end of the commercial.  This means that for the first 4 minute
> commercial in Joe Millionaire it took about 16 seconds to skip through the

Thanks for the reference.  I was thinking that mine was faster than that
and I have my vide stored over nfs so that takes a little longer to jump

> idea to make the wait more bearable... How about progress messages on-screen
> while we're waiting?  Give us something to look at.  Maybe:  "Skipping
> Commercials: 30 sec, 30 sec, 60 sec, 60 sec "  Bing! We're done.  Kinda
> makes us feel like it's not off in lala land.

I was thinking about this.  I know it's possible, just take a little
coding.  I'll probably add something like this today and will probably
rewrite the blank screen detection code to see if I can make it faster,
I have an idea about that already.

> 2) On the first CVS I downloaded earlier tonight I applied your patch and
> saw a "switch" to toggle auto detection on/off.  In the latest (1 a.m.today)
> CVS version, that seems to be gone.  Is that right?  Will you be able to
> make it a manual (z key) only thing or will it always be on?

Yeah, Isaac disabled auto-detection in the CVS version until it's tested
a little more.  You can reactivate it by editing
programs/mythfrontend/globalsettings.cpp and going to line 773 and
uncommenting the line.  It looks like this:

//    seek->addChild(new AutoCommercialSkip());

> 3) Final question... When does it start "looking" for commercials?  I
> started playback of a show, fast fwded to the first commercial, backed up 10
> seconds and hit play to watch it in action and it slept right through the
> fade to black (and it was a long one too).  Does that mean auto-detect isn't
> turned on or that it just missed it.  I tried other shows & spots and it
> never auto detected, I had to hit Z to get it to take off.

It should start looking for commercials right away when you hit 'Z'.  It
will rewind 2 seconds (in case a commercial just started), then scan forward
up to 64 seconds to find the first blank.  Once it finds a blank, then it
will jump in ~14 second increments looking for commercials that are 15, 30,
45, and 60 seconds long.  I might modify this a little today.  Last night I
found a show with a 20 second commercial and the current code wouldn't
catch that.  I'll also play around with seeing how fast/slow it is if I
put the .nuv files on the local drive (and just link to them in my nfs-mounted
video directory).


** Chris Pinkham                  Linux v2.2.18, Sane v1.0.4, Cajun v3.0-8 **
** cpinkham at bc2va.org                          http://www.bc2va.org/chris/ **

More information about the mythtv-dev mailing list