Default output file name template

Discussion of advanced MakeMKV functionality, expert mode, conversion profiles
mike admin
Posts: 4075
Joined: Wed Nov 26, 2008 2:26 am
Contact:

Default output file name template

Post 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

{NAME1}{-:CMNT1}{-:DT}{title:+DFLT}{_t:N2}
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.

Examples:

{NAME1}{-:CMNT1}{-:DT}{title:+DFLT}{_t:N2}
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.
scottstone
Posts: 4
Joined: Wed Jul 23, 2014 2:51 am

Re: Default output file name template

Post by scottstone »

Am i just missing something? I don't see the template. ver. 1.14.2.
Woodstock
Posts: 10312
Joined: Sun Jul 24, 2011 11:21 pm

Re: Default output file name template

Post 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.
scottstone
Posts: 4
Joined: Wed Jul 23, 2014 2:51 am

Re: Default output file name template

Post by scottstone »

Who knew! Thanks.
Liliane11
Posts: 1
Joined: Wed Mar 13, 2019 1:09 am

Re: Default output file name template

Post 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

{NAME1}{-:CMNT1}{-:DT}{title:+DFLT}{_t:N2}
(more stuff left out)
Thank you very much
drguiom
Posts: 7
Joined: Thu Apr 11, 2019 12:21 pm

Re: Default output file name template

Post by drguiom »

Hello,

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?
zeker
Posts: 5
Joined: Tue Aug 19, 2014 10:34 pm

Re: Default output file name template

Post 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):

Image
linux_ripper
Posts: 1
Joined: Thu Feb 14, 2019 2:59 pm

Re: Default output file name template

Post 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.
ltcolumbo0
Posts: 2
Joined: Thu Apr 18, 2019 3:47 pm

Re: Default output file name template

Post 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.

Example:
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
websterd13
Posts: 2
Joined: Thu Jul 09, 2015 6:09 pm

Re: Default output file name template

Post 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...

https://www.screencast.com/t/5UlFYh1uifoK

Image


Thanks!
Woodstock
Posts: 10312
Joined: Sun Jul 24, 2011 11:21 pm

Re: Default output file name template

Post 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.

Example:

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.
flintcsci
Posts: 1
Joined: Sat May 04, 2019 10:27 pm

Re: Default output file name template

Post 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:
{NAME1}{-:CMNT1}{-:DT}{title:+DFLT}{_Ep:M2}

Then it shows the filename ends up being:
G_Gundam_S1_BD2!ERRtemplate_t00.mkv

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?
thermalz
Posts: 2
Joined: Mon Aug 26, 2019 6:41 am

Re: Default output file name template

Post 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.
ArnoldLayne
Posts: 3
Joined: Sun Sep 08, 2019 4:47 pm

Re: Default output file name template

Post by ArnoldLayne »

Thanks to Mike and Woodstock et.al.!
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....
{NAME1}{-:CMNT1}{-:DT}{title:+DFLT}{e:M2}
Thanks!
rakorm
Posts: 4
Joined: Mon Jan 20, 2020 8:09 am

Re: Default output file name template

Post 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,
Rainer.
Post Reply