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

Chris Pinkham cpinkham at bc2va.org
Mon Feb 24 23:13:49 EST 2003


> On February 24, 2003 06:38 pm, Chris Pinkham wrote:
> > does a shortcut on detecting a blank frame and also checks for
> > commercial lengths in a specific order.  Since most (U.S.) commercials
> > are 30 seconds in length, it checks that first.  Then it checks 15

> That is precisely what I was thinking of
> that it was less than efficient to check every 15 seconds

The whole section of commercial skip code is less than a week old. :)
Give it time...  I first had it scanning every frame as a proof of
concept, then did the 15-second thing, now it's more efficient.
Eventually we'll get to detecting blanks at record time and only have
to fallback to detecting them at playback time if for some reason the
blank-frame data doesn't exist (like on an old recording or for
hardware-MJPEG compression users).

> in fact I read the PDF linked from a post to this list which suggested that
> most commercial breaks last at least 3 ads long
> so it might make sense to check fisrst for a "90 second commercial"

Yeah, but I'm not sure about checking that long of an interval during
playback.  I'd rather it be a little slower than to accidentilly skip
part of a show.

I could probably make it check 90 or 120 first, then revert back to the
30,15,60 checks.  Nothing is going to be optimal for every station in
every city.  The latest code is pretty quick on my system and will only
get faster as we start detecting blanks during record.

Thanks for bringing that up though, it's definitely something to consider.
I think it would at least make sense to check 60 seconds into the future
the first time, then maybe revert back to the regular check sequence.

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