Custom Filename Examples


Let’s say you want the filename of the extracted track to include data contained in the input MKV file and do not want to change the filename options for every file set.

In this example we are going to set up the filename to include the delay for the audio track and the language of the track using variables.

The variables are based on the information contained in each MKV file and when using MKVCleaver are called placeholders. Each variable starts with [ and ends with ].

Configuring MediaInfo Parameters

Level: Intermediate – Advanced

If you haven’t configure any placeholders yet then

  1. Click on Custom button under File Options.
  2. Click on Customize button.
  3. Click on Menu->Parameter Config.

Here you have 2 fields Name and MediaInfo Parameter. The Name field can be anything you want, but it is recommended to set it to something that will identify its meaning for you.

Populate Name Field
Populate Name Field

The MediaInfo Parameter must be set to the value that you want to retrieve from a MKV file. Since most likely people do not know where to find these I provided a helper window. Click on Menu->Parameter List to open it.

Next, align the 2 windows so the Parameter List is on the right side of the MediaInfo Parameter Configuration window.

Populate MediaInfo Parameter
Populate MediaInfo Parameter

Keep in mind that some parameters are only available for certain track types. For example, Height and Width are only available for video tracks. However, a lot of them will work for any track type – such as Language and Duration.

Find the parameter you want and add it to the MediaInfo Parameter field in MediaInfo Parameters Configuration window. Drag & Drop or click Insert button or type it in manually.

  1. Close MediaInfo Parameters List window.
  2. Click Menu->Save.

Note: If you want to add multiple parameters then click Add button to create multiple entries before opening the MediaInfo Parameters List window.

Configuring Placeholders

Once you close the MediaInfo Configuration window, Custom Filename Configuration window will open.

This window allows you to configure the actual placeholders that will be replaced with the data from MKV files during extraction process.

Name field can be almost anything you want, but must start with [ and end with ]. The Example field should contain a recognizable value that is common for this type of parameter.

Populate Placeholders
Populate Placeholders

Click Menu->Save when done and close the window.

You will be presented with the window where you can customize the filename.

Populate Filename
Populate Custom Filename

You can Drag & Drop placeholders onto Filename field at the position you want it inserted.

Lets start with this line:

[TrackType]<-[TrackType#]<-[Filename]<__[Lang]_Delay>[General_Delay]
Populate Filename field
Populate Custom Filename field

Now let’s break down what the line means and how it will work.

[TrackType]<-

This is a built-in placeholder. It will be replaced with track type being extracted such as Video, Audio or Subtitles. The “<” tells MKVCleaver that the character(s) following it belong to the placeholder on the left. If for any reason that placeholder returns blank information then the character(s) belonging to it (and the placeholder itself) are removed from the file name.

[TrackType#]<-

Another built-in placeholder. It will be replaced with the number of the track type. For example, if you have 2 audio tracks then the placeholder will be replaced with either with 1 or 2.

[Filename]<__

Also built-in. This will be replaced with the name of the input file.

[Lang]

This is one of the placeholders we configured earlier. It tells MediaInfo.dll to retrieve full language string from the input MKV file. English, for example.

_Delay>[General_Delay]

The second placeholder we configured above. It will be replaced with the delay of the track being extracted in milliseconds.

Other Examples

[TrackType#]<-[Title] >[TrackType]->[Filename]_>[Lang]

I configured [Title] to extract track titles from MKV files.

Assuming we have a file named MyShow_Season1-Episode1.mkv, the output filename would be (if we assume Track Title is “Pilot” for all tracks):

01-Pilot Video-MyShow_Season1-Episode1.h264

01-Pilot Audio-MyShow_Season1-Episode1_English.aac

02-Pilot Audio-MyShow_Season1-Episode1_Japanese.aac

01-Pilot Text-MyShow_Season1-Episode1_English.srt
[TrackType]<-[TrackType#]<__[Filename]-->[CodecID]__>[Duration]

And this filename string would output:

Video-01__MyShow_Season1-Episode1--V_MPEG4_ISO_AVC__00.24.12.500.h264

Audio-01__MyShow_Season1-Episode1--A_AAC-2__00.24.10.200.aac

Audio-02__MyShow_Season1-Episode1--A_AAC-2__00.24.10.200.aac

Subtitles-01__MyShow_Season1-Episode1--S_TEXT_UTF8__00.24.12.500.srt