11 Jul 2019


  1. Criteria repositories
  2. Criteria configuration
    1. Criteria conditions


When talking about a way to match media properties to some condition filter uses word criteria.

It is important to understand that filter operates files, not qualities. Result of its work is a file (or set of files) that are passed to downstream filter in DirectShow graph. So using criteria you select a file conforming conditions from criteria.

With that said, there are two media sources that you can setup in filter configuration. They are called main source and extra source. Main source is a first media file or live stream that will be provided by the filter. If this source does not have audio stream, and only in this case, filter searches for additional source using criteria from extra source and adds it to the resulting set of sources.

Main intention of this approach is support for DASH streams where video and audio are represented by separate files.

Criteria repositories

Top level criteria internally reside in criteria repositories. Criteria combo boxes (for example General Quality Main source) contain all criteria from single repo.

When you select Configure item from criteria combo box, a dialog box pops up where you can configure repository i.e. manage criteria within it.

This dialog box has list control will all criteria belonging to it. Use context menu in this list to explore available options.

Once you've added new criterion in order to use it, do not forget to select this criterion after you close repository config window. It is not selected automatically neither in this case nor when you remove from repo the criterion that is currently selected in this combo box.

Criteria configuration

To modify criterion, open criteria repository window, select criterion and use context menu item Modify. Criteria configuration window will appear after that and you can start modification.

Main UI element of this window is a tree control containing criteria tree. All modification options are available there via context menu.

Basically each criterion consists of two parts: property to which it applies and condition for its compliance. And when two qualities are compared, a check is performed whether they match this condition, and if both match - which one matches it better.

Available properties to match are grouped next way (you can find them in popup menu Add of tree context menu):

There are four types of criteria: numeric, textual, boolean and composite. Difference of first three ones comes from properties they match. For example container streams count is a number so it is covered by numeric criterion. Codec name is a string so criterion is textual. Whether container is HLS is a true/false flag so it is covered by boolean criterion. And so on.

Composite criteria are used to group other criteria and combine their results.

Criteria conditions

Each criteria type has its own set of conditions. Condition can be changed for selected criterion using context menu (popup menu Condition).


Composite criteria has two conditions. They specify how results of nested criteria should be combined.

Condition AND means that quality matches composite criteria if it matches all nested criteria.

Condition OR means that quality matches composite criteria if it matches at least one of nested criteria.


Conditions for numeric criteria are described in the following list. Note that when comparing two qualities using numeric criteria it checks not only if there is a match (aka yes/no) but which one matches better to sort qualities accordingly. Canonical number there is the number you specify when adjusting criteria.


Canonical string for textual criteria is a string you specify when adjusting criteria. All conditions are case-insensitive. Supported conditions:


There are only two conditions for boolean criteria: is true and is false. Condition also implies canonical value so it is not configured there separately.

Optional conditions

When properties are matched using some condition, match is marked as failed if given quality does not contain the property being matched. In some cases this is not the desired behavior.

Suppose you want to select audio that has the maximum bitrate. If quality does not contain bitrate info, that is ok - you have other conditions in the chain like number of channels, sample rate etc. You want bitrate condition to be skipped if it cannot be checked. But behavior is different: whole chain is marked as failed since there are no bitrate information.

Solution is to mark condition as optional. This is supported by all textual, numeric and boolean conditions using context menu item Optional Property.

For numeric properties it does more than just dealing with nonexistent properties. If property exists, it makes condition be considered as passed even if property value does not actually match condition. Qualities containing such properties will have lesser priority than ones that really match appropriate condition but greater than ones which do not have such properties at all. This way, for example, if you have condition bitrate the closest below 128kbps and the only one quality with, say, 256kbps bitrate, it will not be rejected.

Help Criteria