Page 1 of 2

Default output file name template

Posted: Thu Nov 08, 2018 1:31 pm
by mike admin
Starting with 1.14.0 the default output file name is generated using a template string set in preferences. The template syntax is described below with default value being

Code: Select all

The template is a string with optional substitution variables enclosed in curly braces like {NAME}. For each title MakeMKV would expand the variables and assign the produced file name. If the produced file ends up being unique, that would be the file name you'll get. If your template would produce the same name for different titles, MakeMKV would still add _txx suffix. So it is highly recommended to use one of the variables to generate unique file name. The default template always generates unique file names.

There are 3 important attributes each title may (or may not) have, that define the value of substitution variables:
Name - this is the title name that usually comes from disc metadata, or the value assigned in GUI.
Comment - the comment string for title that comes from disc metadata. Cannot be changed in GUI, usually present on blu-ray discs with fake playlists.
DateTime - the date and time when the title was recorded. Always present on AVCHD discs, almost always present on BDAV discs.
These attributes define the values and presence of some substitution variables.

Each variable can be either defined - meaning it has some value, or not defined - meaning the value of the variable is unknown. The syntax of each substitution variable is {[Prefix:][+|-]Name} . If the variable is defined, then its value is put into output file name along with prefix (if specified). If the variable is not defined, then nothing is added to the file name at all, variable is ignored. For example variable {T3} is defined to a 3-digit title id for all titles except title 0. So the substitution {_t:T3} would produce text "_t001" for title #1, "_t002" for title #2, but would produce nothing for title #0.

All variables that hold the numeric value can have an optional suffix that specifies how many digits to use. For example the variable {AN} is always defined and holds the value of title id. One can use the {AN} directly or specify number of digits manually - {AN1} {AN2} etc. The default precision is variable-specific. For example, the variable {SN} holds the source title id if it is present. For blu-ray that would be id of mpls or clpi file, and for DVD that would be original title number as encoded in IFO. So value of {SN} on blu-ray could be "00000" and on DVD "00". But the value of variable {SN2} would be "00" in both cases.

The last syntax element - there is a way to test whether a variable is defined or not by putting a "+" or "-" before its name. The variable {+SomeName} is expanded to empty string if the variable {SomeName} is defined, and is not defined if {SomeName} is not defined as well. The "-" works in opposite way, producing empty string if variable is not defined. This can be used to output characters conditionally by using a prefix feature. For example the token {something:-DT} would output "something" if {DT} variable is not defined (title has no date/time meta info) and wold output nothing if {DT} is defined.

Below is the list of all variables.

Title Name:
{NAME0} - Name with cleansing level 0. This is minimal prepossessing - only characters absolutely forbidden if file names are replaced.
{NAME1} - Name with cleansing level 1. In addition to level 0 some problematic characters are replaced to underscores.
{NAME2} - Name with cleansing level 2. In addition to level 1 all spaces are replaced to underscores and all problematic characters are replaced with underscores as well.
{NAME} - alias to {NAME0}

Title Comment:
{CMNT} {CMNT0} {CMNT1} {CMNT2} - Title comment with the same cleansing rules as for {NAME}

Title Date/Time:
{DT} - Date/time string as "yyyy-mm-dd hh:mm:ss"
{DY} - year
{DM} - month
{DD} - day
{TH} - hour
{TM} - minute
{TS} - second

Title id (as assigned by MakeMKV):
Next 3 variables are defined only if {DT} is NOT defined, i.e. if the title has no recording date/time information
{N} - title id starting from zero
{M} - title id starting from one
{T} - title id, same as {N} but defined for all titles except title #0

{AN} {AM} {AT} - same as {N} {M} {T}, but are always defined, regardless if recording date/time information is present or not.

{SN} - source title number, as encoded on disc. For DVD it is the DVD title number. For Blu-ray it is MPLS id if title comes from MPLS or CLPI id if title comes from CLPI.

{DFLT} - a special variable. This variable is defined only if nothing was added to the output file name buffer so far. So the token {something:+DFLT} would produce "something" only if the file name is still an empty string - meaning all variables before were expanded to nothing.


If name is present, it is added with cleansing level 1, if comment is present then "-" is added following the comment cleansed with level 1, if recording date/time is present then "-" is added following "yyyy-mm-dd hh:mm:ss" string. If nothing was added so far (no name, comment or date/time) then the "title" string is added. Then the "_txx" suffix is added, where xx is a two-digit title id.
This is the default template.

{NAME}{tilte:+DFLT}{_t:T2} - Name with cleansing level 0 is added, if name is not defined then the string "title" is added instead. For title #0 nothing is added, for the rest the "_txx" would be added where xx is a two-digit title id.

{NAME1}{title:-NAME}{-:SN} - Name will be added, if name is not present then string "title" will be added, following by source title id (DVD id or MPLS id) if present.

Also, please note that the "default output file name template" is a "live" settings value. That means that you can open the disc, go to preferences, change the template, and MakeMKV would re-assign default names using the new template for the already-opened disc. This is the easiest way to play with this setting.

Re: Default output file name template

Posted: Tue Jan 22, 2019 12:16 am
by scottstone
Am i just missing something? I don't see the template. ver. 1.14.2.

Re: Default output file name template

Posted: Tue Jan 22, 2019 2:29 am
by Woodstock
Do you have Expert mode turned on? Preferences->General, make sure Expert mode is checked.

Then the Advanced tab will be available, and the template is the third text entry box.

Re: Default output file name template

Posted: Tue Jan 22, 2019 3:58 am
by scottstone
Who knew! Thanks.

Re: Default output file name template

Posted: Wed Mar 13, 2019 1:33 am
by Liliane11
mike admin wrote:
Thu Nov 08, 2018 1:31 pm
Starting with 1.14.0 the default output file name is generated using a template string set in preferences. The template syntax is described below with default value being

Code: Select all

(more stuff left out)
Thank you very much

Re: Default output file name template

Posted: Thu Apr 11, 2019 12:41 pm
by drguiom

The 'Comment' property is interesting in identifying the 'extras' in the extracted files. I can only get it on some Blu-ray though and in particular from Lionsgate when the JRE used.

Is there a way to get DVDs and other blu-ray metadata so that file identification is easier than going through each to work out which extra they relate to?

Re: Default output file name template

Posted: Fri Apr 19, 2019 7:41 pm
by zeker
I haven't been able to make it happen yet. Is there a way to have the output filename be the same as the source filename? For example, if the source file is "Stan and Ollie (2018).iso", can I have the output filename be "Stan and Ollie (2018).mkv"? With something added to make unique names if there are multiple output files from the same source file?

thanks from this newbie :wink:

Edit: just found a thread that points to how this is done in MakeMKV. I will experiment there. But I would like to do this with BatchMKV for multiple ISO files in the queue. :?:

Edit2: Got it! "{source-isfile}.mkv" works for this! I'll leave this up in case anyone is looking for this in partcular.

Edit3: No I don't. Anyone can help? Which tag and where to put it? Preferably in settings so it is set for all conversions. Thx. I'm using BatchMKV so far. So settings in MakeMKV that would work when using BatchMKV or in BatchMKV itself.

Edit4: :roll: - Ok, this time I do have it! Sorry for this ongoing process, but I'm pretty sure I've got it licked. Here's the settings in BatchMKV (Default title settings):


Re: Default output file name template

Posted: Sun Apr 21, 2019 10:44 am
by linux_ripper
Is there anyway to specify a base track number ideally for a given rip? It would be nice when ripping a season of something that the files could all start out with the correct episode numbers rather than having to fix the titles up afterwards.

Re: Default output file name template

Posted: Tue Apr 23, 2019 4:22 pm
by ltcolumbo0
I am also interested in a base number which would auto-increment for a given rip so that if several episodes are on a disc, the episode number is incremented for each file name.

Start with "Monk s01e09" and then increment the next file name to be "Monk s01e10", and then "Monk s01e11", ...

The best I can do now is "{Monk:+DFLT}{ s01e:M2}" and then edit each file name before burning

Re: Default output file name template

Posted: Thu May 02, 2019 5:25 pm
by websterd13
Is there a way to use the Disc Label as the file names automatically? This would be helpful when ripping a TV show...

Copy / paste is getting old...



Re: Default output file name template

Posted: Thu May 02, 2019 6:24 pm
by Woodstock
I've been doing the manual naming for a long time, and once you set the DISK name, that makes it go faster, especially if you're fine with keyboard navigation and are in Expert mode.


Disk is first disk of "Land of the Lustrous". It has episodes 1-9 on it.

Set directory name to "Z:\Land of the Lustrous". Use Tab to navigate to NAME box. Enter "Land of the Lustrous HD0" in box, highlight whole thing, copy to clip board. Press the down arrow. The rest of the files on the disk will have their name set to "Land of the Lustrous HD0". Add a 1 to the end of the first file, hit down arrow again. Continue down, incrementing "2", "3", etc.

At this point, the FILENAMES will be (depending on your template) something like "Land of the Lustrous HD01_t00.mkv". You can change them before the rip, or wait until after, but the episode number will be in the filename.

Doing this with a mouse is tedious. Keyboarding is much faster.

Re: Default output file name template

Posted: Sat May 04, 2019 10:36 pm
by flintcsci
I keep getting an error when I try to use {M}.

I've simply changed the end of the default template, so my template looks like this:

Then it shows the filename ends up being:

When the expected value is:
G_Gundam_S1_BD2_Ep01, where "G_Gundam_S1_BD2" is NAME.

Is there a trick I'm missing to using the "starting at 1" numbering scheme for title ID?

Re: Default output file name template

Posted: Mon Aug 26, 2019 7:11 am
by thermalz
Hi I am using makemkv to rip dvd in manual mode is there a way to change the output to show chapters?

eg: DVD Name, Disc ID, Chapters

DVDNAME S1_P1_ D1 1-7

It would make things alot easier for me if I could do this then I could rip all my dvd's to one directory and convert them form there.

Thanks for reply.

Re: Default output file name template

Posted: Sun Sep 08, 2019 4:55 pm
by ArnoldLayne
Thanks to Mike and Woodstock!
My humble request is to add an offset to begin the track numbering.
I use the following for TV series and would love to be able to start the suffix numbering with other than 1 (or 0):
After entering the title with "-s01" attached, the following numbers it correctly for Plex....

Re: Default output file name template

Posted: Mon Jan 20, 2020 10:23 am
by rakorm
I'm using makemkvcon on debian. Where (path/filename) can I place the settings for output file name template?

EDIT: Is it even possible to configure a default output file name template, using only the commandline-tool makemkvcon on a linux-system?

Thanks in advance and have a nice day,