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

Chris Pinkham cpinkham at bc2va.org
Wed Feb 26 23:08:58 EST 2003


> 1) When skipping a commercial, can we have an on-screen indicator saying how
> long it's skipping?  I'd like to see something like, "Skipping 3 minute
> commercial" popup for say at least 3 seconds.  Otherwise, we might have

Currently it will print messages out like "Found 30 second commercial".
I made a note to possibly display a message something like this when
it skips (auto or manual) based upon the cutlist of commercials.  If the
cutlist was handmade (or edited after being automatically made), then
the display probably wouldn't be needed.

> 2) For doing the detection, it seems the fastest algorithm would be to skip
> forward in 60 sec chunks until no commercial break was found, then back up
> through that last minute to verify if there was a half or quarter minute
> commercial in there.  Starting out looking for a commercial in the first

The code already runs pretty quick and backing up is very costly.  I have
a couple other ideas to speed it up, but am going to concentrate on
detecting blanks and building a commercial cutlist at encode time now.  The
commercial detection code at playback is a fallback but the greater speed
increase is if they are detected prior to playback.

I worked a litle yesterday on integrating some code into MythTV that will
build a cutlist to skip commercials.  I hope to have a patch ready on
this within the next week.  I know how it's going to be done, and have
chunks of code done, just need to fill in some blanks and glue it all
together.

> 3) Most of our systems sit idle for many hours at a time.  Doing back-end
> processing (no matter how slow and thorough) and sending the results to the
> "cutlist" database is a great solution for people with lightly owered

I've broken the blank frame detection function out into a separate file
so it can be a part of libmythtv but can be used by other processes other
than mythfrontend during playback.  I enision most of the commercial
detection code doing into this and then there could be an offline program
to scan new recordings or mythbackend could just fire off a thread when it
thought/knew it was going to be idle for a while.

> Ideally, we'd see an on-screen indicator in the playback list of shows that
> have been "scanned" so that we know that we can watch those commercial-free.

I made a note about possibly putting an indicator on the playback selection
screen to indicate whether there is a cutlist for the selected video. (that
is if this doesn't exist yet since I haven't played with editing yet). :)

Chris

*****************************************************************************
** 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