[PATCH] Re: [mythtv-users] How well does commercial detection

Chris Pinkham cpinkham at bc2va.org
Wed Apr 13 04:41:52 UTC 2005


> I sent this last night but it never showed up on the list, 
> So I am resending

Got both of these actually.

> The patch is attached and it replaces the previous patch and
> addresses all four issues.
> 
> 1) in strict mode - treat frames as blank only if logo is absent

I get this part of the patch and see why it may reduce false positives
where we detect show as commercial, but also see where it may cause
missing of the first and last commercials in a commercial break if the
network displays their commercial through all blank frames before and
after the commercial break.  Did you experience any of this after
applying this change?

> 2) more fixes for the "long long" issue

Thought these were OK since they were in a sprintf not an arg().  Were
these generating warnings somewhere?

> 3) fix for "white frames" triggering commercials

So strict means black, non-strict means blank, correct?

> 4) do not detect commercials less than 60 sec long, in the middle of a show

I had a question about this part, but after looking over the code 4-5 times,
I see what you're doing.  Seems to make sense.

> I also highly recommend changing the default max and min comm break lengths
> 
> -#define MIN_COMM_BREAK_LENGTH   60
> -#define MAX_COMM_BREAK_LENGTH  485
> +#define MIN_COMM_BREAK_LENGTH   55
> +#define MAX_COMM_BREAK_LENGTH  335
> 
> The combination of the above changes seems to detect at 99% accuracy 
> with no false positives so far for me.

I've seen commercial longer than the 00:05:35, but I think I may have calculated
wrong when I set the max to 485, that's 00:08:05 which is a bit too long. :)
Did you try any values in between 335 and 485 or did you pick 335 to start
with?

These look OK, I committed the patch to CVS, and changed MAX_COMM_BREAK_LENGTH
down to 395 for now.  That's 00:06:35 so we can see how that goes.  I don't
want to take it much lower before 0.18.

-- 
Chris



More information about the mythtv-users mailing list