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

2005-04-13 Thread Risto Treksler
On Tuesday 12 April 2005 10:41 pm, Chris Pinkham wrote:
  So I am resending

 Got both of these actually.

sorry about the logjam
Thank you for commiting the patch

 
  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?

at least for me, the positives far outweigh the negatives

happened in two shows out of fifty that i have on the drive right now
but over all, even these shows detect better now than before.

a) far fewer false positives
b) it's consistent, and thus predictable
c) it's a minor problem 
   - it only misses a few seconds at the end of the comm block
 for only a couple of shows


  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?

Remember this ?

2005-04-11 14:31:23.171 d : 102549 (00:04:00.56) (58)
2005-04-11 14:31:23.171 d : 107739 (00:05:00.59) (51)
-^--^---
for some reason, if it was long long it would display a d and insert a 0 
into the argument list, causing a frame shift - making all debug output 
useless

basically this makes debug output work for me

  3) fix for white frames triggering commercials

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

more or less
-strict means blank that is also reasonably dim
-non-strict means any blank

  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 tested this quite a bit
- b4 this patch i was getting tons of 1 second breaks
- so this fixes this bug (of not honoring the min_comm_break_length)
- but still allows for short commercials in the beginning of the show

 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

I have seen a few that are longer than 00:05:35 as well
heck i saw an 11 minute break the other day

It's just been my experience that
if a block of 6 minutes or longer was marked,
then quite often some of the actual show was being cut off.

 These look OK, I committed the patch to CVS, 

Thanks again

 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.

maybe make strict be 335 and non-strict be 395?
I'll try to test with 395 to see if it's better or worse

i was thinking about making this also an undocumented  setting in the 
database:

maxCommBreakLength= gContext-GetNumSetting(MaxCommBreakLength,
  MAX_COMM_BREAK_LENGTH);


ttyl
-- 
Risto Treksler
Elkhorn Lodge
Banff, Alberta, Canada
___
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


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

2005-04-12 Thread Risto Treksler
Fixed it myself :)

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
2) more fixes for the long long issue
3) fix for white frames triggering commercials
4) do not detect commercials less than 60 sec long, in the middle of a show


PS
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.


PPS

On Monday 11 April 2005 11:07 pm, Risto Treksler wrote:
 1) I DO NOT ignore logos in blank frames in STRICT mode

what I meant is that i do not ignore the logo area in strict mode
in effect i do ignore the logo
:)


commercial_skip.updated.diff.bz2
Description: BZip2 compressed data
___
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


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

2005-04-12 Thread Risto Treksler
Hmm, 

I sent this last night but it never showed up on the list, 
So I am resending
...
Fixed it myself :)

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
2) more fixes for the long long issue
3) fix for white frames triggering commercials
4) do not detect commercials less than 60 sec long, in the middle of a show


PS
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.


PPS

On Monday 11 April 2005 11:07 pm, Risto Treksler wrote:
 1) I DO NOT ignore logos in blank frames in STRICT mode

what I meant is that i do not ignore the logo area in strict mode
in effect i do ignore the logo
:)


commercial_skip.updated.diff.bz2
Description: BZip2 compressed data
___
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


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

2005-04-12 Thread Chris Pinkham
 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

___
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


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

2005-04-11 Thread Risto Treksler
Hi,

I haven't figured out why the minimum length is still not being honoured 
and so I am going to privately send you the full debug output
from a couple of such shows

NOTE:
I think it's OK to have commercials shorter than 60sec 
right in the beginning of the show!! 
these are detected fine all the time and should continue to be detected as is

however there shouldn't be any really short commercial sections 
in the middle of the show, but it's flagging them nonetheless
- (using method all with strict checking enabled)


ALSO here's a patch that fixes a few things

1) I DO NOT ignore logos in blank frames in STRICT mode

- this alone has eliminated virtually all false positives
- it even works reasonably well with shows that leave the logo up
  i end up having to watch the first or the last commercial, 
  but that's ok b/c there are no false positives.
  (There has got to be a way to: ONLY ignore these logos
   if there are no completely blank frames at all in the show)

2) fix for the messed up data in my previous post 

- long long vs. long
- (long)it.key()  probably would have done it as well
- it didn't like %7lld either

3) fix for white frames triggering false positives

- NOT ONLY  (max - min) = blankFrameMaxDiff
- BUT ALSO max  some reasonable amount



On Monday 11 April 2005 04:07 pm, Chris Pinkham wrote:
  downloaded todays CVS and reflagged
  it detected and flagged an obviously false commercial of just 8 frames
  long
 
  white frames like those in explosions and in scene transitions in Cold
  Case also trigger false positives every time

 If you use the same instructions I gave the others earlier in this thread
 and email me (privately) the debug output, it might help me find and fix
 this.

  2005-04-11 14:31:23.170 Final Commercial Break Map
  2005-04-11 14:31:23.170
  ---
 
  2005-04-11 14:31:23.170 d : 7639 (00:04:00.04) (14)
  2005-04-11 14:31:23.171 d : 7646 (00:05:00.04) (14)
  2005-04-11 14:31:23.171 d : 102549 (00:04:00.56) (58)
  2005-04-11 14:31:23.171 d : 107739 (00:05:00.59) (51)
  2005-04-11 14:31:23.171
  ---

 On second thought, something looks plain weird about this output anyway. 
 The output is all weird.  Have you done a make distclean lately?  If not,
 can you do that then remake and rerun flagging and see if you get the same
 results.

-- 
Risto Treksler
Elkhorn Lodge
Banff, Alberta, Canada


commercial_skip.diff.gz
Description: GNU Zip compressed data
___
mythtv-users mailing list
mythtv-users@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users