[mythtv-users] Commercial detection and PVR-250?

Chris Pinkham cpinkham at bc2va.org
Thu Jun 19 10:48:24 EDT 2003


> Just out of curiosity: can somebody explain how it works?

More detailed descriptions can be found on the mailing list archives,
but here's a quick description if you have blank frame with scene
change detection turned on.

Blank frame detection checks as many pixels as necessary to determine
if a frame is blank.  It performs a grid search and stops looking if it
encounters a bright pixel.

Some calculations are then done on the blank frames to see which occur
certain time distances apart (ie, 30, 45, 60, etc. seconds) to determine
which look like commercials.  The "commercials" are then merged together
into a commercial break list.

The scene change detection looks at the Luminance histogram for each
frame and determines if enough 'buckets' in the histogram differ by a
certain percentage between the current frame and the previous.  If the
difference is over a certain threshold, the code assumes the scene has
changed.  This isn't a "scene" as in a play/movie, but things like the
shot changing from one camera angle to another.

The scene change marks are then looked at to see where high rates of
scene change occur in the video since commercials have high rates of change.

The code then checks over the commercial break list to see if any small
holes (such as a 10-second spot at the beginning of a video and followed by
a commercial) look like commercials.  If the hole has is flagged in the
scene change table as having a high rate of scene changes then it's flagged as
a commercial also.

This is how the code works currently although it will probably be enhanced to
do even better detection in the future (although it is very good for most
things I watch even now).

Chris



More information about the mythtv-users mailing list