Chris Pinkham and interested persons,

I've been messing with the commercial detector in 18.1 (very similar to svn 
version) to improve detection of Australian ads.  Here is what I've found so 
far using the ALL method:

 - Strict is better because otherwise all white screens detected as blanks.

 - Australia doesn't have blanks between ads so changed MAX_COMM_LENGTH to 
match MAX_COMM_BREAK_LENGTH (is this the right thing to do?)

 - Patch to 18.1 to zero formatCount and use format instead of aspect

 - Patches to match my global record before of 5 minutes and after 10 minutes
        - Pick format from 5 minutes to last 10 minutes
        - Move Logo detecting 6 minutes in and if not detected try in 15 
minutes in
        (it maybe more sensible to reduce my before time to 1 minutes)

Does commercial detection hang if never 8 minutes of video for logo detection?

Does it make sense to +10 score when format matches?  My understanding is 
format matches mean either show or ad.  And format non matches mean ad.

Having no experience with Fuzzy Logic I'm very impressed.

Thanks,
Paul
-- 
--- mythtv-0.18.1.oldpatched/libs/libmythtv/commercial_skip.h	2005-12-08 01:22:23.659174784 +1000
+++ mythtv-0.18.1/libs/libmythtv/commercial_skip.h	2005-12-09 00:04:17.915553784 +1000
@@ -46,7 +46,7 @@
 // Set max comm break length to 00:08:05 minutes & max comm length to 00:02:05
 #define MIN_COMM_BREAK_LENGTH   60
 #define MAX_COMM_BREAK_LENGTH  395
-#define MAX_COMM_LENGTH        125
+#define MAX_COMM_LENGTH        395
 #define MIN_SHOW_LENGTH         65
 #define LOGO_SAMPLES_NEEDED    240
 #define LOGO_SAMPLE_SPACING      2
--- mythtv-0.18.1.oldpatched/libs/libmythtv/commercial_skip.cpp	2005-12-08 01:22:23.659174784 +1000
+++ mythtv-0.18.1/libs/libmythtv/commercial_skip.cpp	2005-12-09 23:34:25.155961840 +1000
@@ -1037,6 +1037,8 @@
     QString msg;
     long formatCounts[COMM_FORMAT_MAX];
 
+    memset(&formatCounts, 0, sizeof(formatCounts));
+
     commBreakMap.clear();
 
     fblock = new FrameBlock[blankFrameCount + 2];
@@ -1073,17 +1075,22 @@
     }
     else
     {
-        for(long i = 0; i < framesProcessed; i++ )
-            formatCounts[frameInfo[i].aspect]++;
+        for(long i = (int)(fps * 5 * 60); i < (framesProcessed - (int)(fps * 10 * 60)); i++)
+            formatCounts[frameInfo[i].format]++;
        
         for(int i = 0; i < COMM_FORMAT_MAX; i++)
         {
+            msg.sprintf("format type count [%d]=%ld", i, formatCounts[i]);
+            VERBOSE(VB_COMMFLAG, msg);
+
             if (formatCounts[i] > formatFrames)
             {
                 format = i;
                 formatFrames = formatCounts[i];
             }
         }
+        msg.sprintf("max format type =%d", format);
+        VERBOSE(VB_COMMFLAG, msg);
     }
 
     while (curFrame <= framesProcessed)
@@ -2459,6 +2466,9 @@
 
     edgeCounts = new EdgeMaskEntry[width * height];
 
+    for (int time=0; time < 2; time++)
+    {
+
     for (i = 0; edgeDiffs[i] != 0 && !logoInfoAvailable; i++)
     {
         int pixelsInMask = 0;
@@ -2475,7 +2485,7 @@
         nvp->GetFrame(1,true);
 
         loops = 0;
-        seekFrame = seekIncrement;
+        seekFrame = seekIncrement + (int)(time==0?(fps*6*60):(fps*15*60));
 
         while(loops < maxLoops && !nvp->eof) 
         {
@@ -2614,6 +2624,8 @@
                                          .arg(pixelsInMask));
         }
     }
+    
+    }
 
     delete [] edgeCounts;
 
_______________________________________________
mythtv-dev mailing list
[email protected]
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev

Reply via email to