In order to tweak the settings, it is important to understand the basics of the very complex process that is automatic commercial detection (if you don't have ShowAnalzyer installed already see our How to Automatically skip commercials in Media Center feature). Basically every show on commercial TV is a series of blocks of time which are divided by prolonged black frames that have no audio. So the real key is to locate the dividers that form the blocks. Then you look at different characteristics of those blocks to try to determine which are commercials and which are part of the show. The dividers aren't usually hard to detect since normally there isn't a prolonged black frame without sound during the show. But sometimes the audio is out of sync or various other problems that can throw the whole thing off. Detecting which blocks are which is much easier than finding dividers because things like network logos -- see there is something good about them -- are usually only present during the show. But logos aren't the only way to determine if a block is a commercial, other tell tale signs are the number of audio channels and the length of the blocks. The longer blocks are almost always part of the show and the total length of commercial blocks are almost always devisable by 30 seconds (30, 60, 90, 120, 150 etc). Of course if all these were definitives instead of probabilities, we wouldn't need to know how to tweak these settings. The good news is that these exceptions are usually either per network or per show, and now we can configure profiles and apply the right settings when appropriate.
We're going to take two approaches here. First we'll give a practical example by creating a sample profile for a 30 minute comedy that always seems to throw the default settings for a loop. This is a good example because it includes two areas that are the easy to fix. The first is the initial segment that is never a commercial and the other is the last joke at the end of the show that is usually falsely detected as part of the last commercial. Then we'll run through what each of the settings do so that you'll be able to break beyond the basics -- a special thanks to the author of ShowAnalyzer, Jere Jones, for spending the time to explain what all these settings mean.
First launch the ShowAnalyzer User Interface then go to Tools and the select Settings. By default you'll be looking at the default Global Settings, next lets hit New Profile on the botton left and type a name for your profile. Then click ok and select the profile you created on the left and you'll have two tabs on the right with settings. If you want to override the defaults you click the check box and then adjust. There are lots of options here but for the most part you'll be adjusting just a few under the Analyzer tab. We'll start with the easiest to wrap your head around, so scroll down the AutoMark section and then under Beginning check Mark As and Length. Since the beginning of Rules of Engagement always seems to be detected as a commercial, we'll auto mark the beginning to always be a part of the show. Start by watching the show and noting how long it is before the first commercial break. For this particular show it is 100 seconds, so we'll set Mark As to Show and Length to 100 seconds, now that block will always be marked as part of the show.
Now this show also has one last joke at the end which usually gets detected as a commercial. So we scroll to the Smoother section and under Show we check the Override box next to the Minimum setting. This is the minimum length of any block that is part of the show. We watch the show and determine that the last joke is the shortest show segment at exactly one minute. So we set the Show Minimum to 59 seconds just to be safe.
Now we can hit Save Changes and click on Global Settings on the top left. We have to set a rule so that our new profile is used when scanning this show. So click the Add button and on the first drop down select the profile we just created. Then under Condition 1 make it say "If file name contains Rules of Engagement" and finally check the Enabled check box and hit save.
The nitty gritty settings
Now for those who really want to get deep into the nitty gritty settings, here is an explanation of each setting and how to adjust it. Unfortunately some of these settings require some knowledge of SQL to access the data needed to really tweak them. The ShowAnalyzer road map includes a companion app called SchoolHouse that will read this data for you and make it easier, but while we all continue to wait for that, you can mess around with them through trial and error or learn SQL. (These are listed in the order they show up in ShowAnalyzer, not in the order of usefulness.)
Sync error is how far apart, in seconds, a blank frame and a quiet point can be and still be considered related. If you look in the ShowAnalyzer database and see the luma dropping real low and the audio is dropping real close, but in the divider table there is no entry for it, it could be because they are half a second apart. If so, then you can increase the sync error. In SchoolHouse you'll be able to easily see the audio and video line dipping at different points.
These blocks will almost never actually get a perfect score of 0 or 1, so the fact that the shows and commercials usually alternate will help determine which is which. So if ShowAnalzyer was struggling to determine if a block was a commercial it would use the value of the previous blocks to guess, these are the Transitions from a show to a commercial. So the difference between the score of a show block and a commercial block is the Transition Threshold. Lets take the default .77 Show To Commercial Transition Threshold as an example. If the 3rd block has a score .11 and the 4th had a score of .89 then block four is marked as a commercial, if it was .87 then it wouldn't be. If you set the Show To Commercial threshold higher than the Commercial To Show, it is more likely to not skip a commercial then it is to skip through part of your show.
The Base setting is the starting point for the score of each block and probably isn't something that should be adjusted. Like each of the factors, the Base has a Confidence and a Weight. Basically you start with a base value and then you add characteristics and then it becomes a weighted average. The Confidence is on a scale of 0 to 1, this is the block's score we talked about before. The Weight is how important that one factor is compared to the others and is on a scale of 1 to 100.
The Length settings determines how likely a block is to be a commercial based on its length. If you are 100 percent confident that every 30 second block is a commercial then you'd set the Confidence to 1 and the Weight to 100. But it isn't this simple because not every commercial will be the same length and then there are those short blocks that aren't part of the show or a commercial, depending on your perspective -- a good example of a pseudocommercial is the numbers to text to vote on American Idol. That being said, you can easily set hard minimums and maximums for the length of blocks in the Smoother section which we'll go over next. The Maximum Individual setting is the longest a block will be and still be contention to be a commercial -- remember shows are only about 15 percent commercials. The Matches settings help determine which short segments are commercials or pseudocommercials, so a 30 second segment is divisible by 15 so it is a match, in addition the defaults are 10, 20 and 25 seconds.
Tolerance is how much give and take should be entered into the equation when considering the length. There are 29.9 frames per second so there is no number of frames that'll give you exactly 30 seconds. So this setting is how much of a tolerance all the other length settings have. The default is 1 and the minimum you'll want to use here is .5. If you set it as high as 5 seconds, just about everything will be set as a commercial so be careful with this one. In fact it is not something you'd typical adjust, but does come in handy for some specific issues.
Channel Count is the number of audio channels. If the show is in 5.1 and there are blocks that are stereo then the confidence level is .99 that the block is a commercial, since the odds of a show switching the number audio tracks is very unlikely. The same goes if the show is in stereo and one block is 5.1.
The Border settings (top, bottom, left, right) are the percentage of the screen that is ignored when looking for logos. This comes in handy if the network likes to run crawls on the screen, think ESPN. If the crawl is preventing logo detection, you can increase this number and ShowAnalyzer will ignore the crawl and find the logo. This will also help speed up the time to analyze files as ShowAnalyzer doesn't have to examine those parts. Some logos are only on the screen during the show, while others are only on the screen during commercials. Then at other times there aren't any logos at all.
The Minimum and Maximum Check Spacing determines how often ShowAnalyzer stops to decode a frame and check for a logo. Increasing the maximum and minimum settings speeds up the process, but increases your chance of missing a logo that isn't on the screen all the time. Because the logos aren't on the screen the whole time the Missing Logo Forgiveness Time is how long a logo can disappear before the show is considered to not have a logo. You want to keep it sub commercial length, which is 15 seconds.
The Missing Logo Search Time is the amount of time ShowAnalyzer keeps searching for a logo it has detected before it assumes the logo it previously found is useless. Typically you'd set this to no longer than a commercial break, so it doesn't start searching just because a comercial is on -- searching means more processing power and disk IO so this can really extend the time it takes to analyze a show if set wrong.
The Confidence and the Weight of the three types of logos can be assigned just like we did in the length section, which of course means it gets added to a block's total score. So if you had a network that always, and we mean always, showed a logo during the show and never during a commercial, you could crank up the confidence on the Show Logo and the No Logo and get much better results.
As you've already figured out, automatically detecting commercials is not an easy thing to do and while tweaking your way to 100 precent accuracy is not for the faint of heart; it is technically possible thanks to the new profiles feature in ShowAnalyzer. And while many of these settings aren't terribly useful until SchoolHouse is released, other settings like AutoMark and Smoother are very simple and effective at correcting specific detection problems.