[mythtv-users] How well does commercial detection work?

Chris Pinkham cpinkham at bc2va.org
Sat Apr 2 03:07:15 UTC 2005


> Is there a chance that those blank detection values for light and dark 
> could be made to be read from the DB and controlled from setup?  I have 
> a couple channels that suffer from slightly poorer signal than others 
> and the strict detection only really fails me on those poor channels.  
> I'd love to see if minor tweaks to the numbers made a difference here 
> but I'm not 100% sure where in the code to change them and thought maybe 
> that's a place where configuring them in setup would help people get 
> better results (which large disclaimers about changing the defaults 
> affecting commflag reliability)

How about an undocumented setting? :)  For now, I'd rather not start
making settings like this available on the setup screens because it is
so easy to really screw things up by changing one or two values, so I
made a new "CommBlankFrameMaxDiff" setting value that will be used for
the blank-frame detection.  Previously this was hardcoded in the blank-
frame detection routine.  Both the strict and non-strict blank-frame
code use this value.  If the difference between the max Y (as in YUV)
value in a frame and the min Y value in the frame is less than this
CommBlankFrameMaxDiff value (which defaults to 25), then the frame
is assumed blank.  The non-strict code also checks a few other things
like the average brightness, maximum Y value less than a certain
threshold, etc..

This is also a "CommBorder" setting value that determines the border
width of the frame to ignore when checking for blank, scene-changes,
etc..  The default CommBorder value is 20.

If you want to make the strict mode a little less strict, try
creating a setting in the settings table like this:

insert settings ( value, data ) values ( "CommBlankFrameMaxDiff", 30 );

then rerun flagging for a show.

I think I found that 35 was really bad on some fo my test cases because
it caused too many false positives (ie, thought the frame was blank
when it wasn't), so your best bet may be trying numbers less than 35,
but you can give it a shot and see.  If we find that 25 is a bit too
tight, the default could be bumped up, although it probably varies
per card especially when using software encoding since that has both
the analog -> digital conversion and gives the user the ability to
change the levels on this conversion.

I'd be interested to see what you find.  Are the channels you're talking
about fuzzy or what?
-- 

Chris



More information about the mythtv-users mailing list