newbie help - naming UHD or 4K or 2160p and REMUX plus more

All about user-defined episode / movie / file name format expressions
Post Reply
mterrill
Posts: 32
Joined: 21 May 2018, 21:08

newbie help - naming UHD or 4K or 2160p and REMUX plus more

Post by mterrill »

Hi,

I have been using the following for nameing my movies for year.... but i now want to be able to add a few more things...

Existing naming scheme - D:/{ny.colon(' - ').replace('?', '!')} {tags}/{n.colon(' - ').replace('?', '!')} {tags}

Would someone please help me with doing the following....
  • If a file is 4K / UHD or 2160p (not sure what term i should use) can I add it to the folder name, if it is 1080p name it in folder name
  • If the filename has REMUX in it, keep it in the folder name
  • if the filename has WEBRip or WEBDL or any use or hyphens in it also, standardize it and keep it in the folder name
  • Keep and tags
  • Include the name of the best audio stream in the folder name
I guess the outcome would hopefully be something like

D:/Terminator - Dark Fate (2019) [Uncut] [UHD or 4K or 2160p] [REMUX] [Dolby Atmos]

I have seen something like this on viewtopic.php?f=5&t=2#p16614 but not even sure how to run this with GUI on windows 10 universal install.

Any help would be much appreciated....
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: newbie help - naming UHD or 4K or 2160p and REMUX plus more

Post by rednoah »

You will find dedicated threads for all your questions so I'll keep things short here:
* You can use {hd} to add UHD / HD / SD
* You can use fn.match(/REMUX/) for that
* You can use {vs} for that
* You can use {tags} for that
* Define "best" and then express that in code, or copy and paste what other people already wrote, but understand that blindly copying & pasting code you don't understand has it's drawbacks too ;)


You can prototype custom formats in the Format Editor:
https://www.filebot.net/naming.html


:idea: As far as formats are concerned, there is no difference between GUI and CLI.
:idea: Please read the FAQ and How to Request Help.
mterrill
Posts: 32
Joined: 21 May 2018, 21:08

Re: newbie help - naming UHD or 4K or 2160p and REMUX plus more

Post by mterrill »

rednoah wrote: 13 Jun 2020, 14:45 You will find dedicated threads for all your questions so I'll keep things short here:
Thank you, I will use what you have given me to try a few things,.... hopefully I can come back and ask a few more questions if I have trouble...
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: newbie help - naming UHD or 4K or 2160p and REMUX plus more

Post by kim »

I do not recommend having too much in folder name
title year tags... all else in filename only...

but this will give you most of it:

Code: Select all

{'D:/'}{plex.name}{allOf{tags.join(', ')}{vs}{hd}{fn.match(/REMUX/)}.joining('] [', ' [', ']')}
or

Code: Select all

{'D:/'}{plex.name}{allOf{tags.join(', ')}{any{vs}{'BluRay'}}{hd}{fn.match(/REMUX/)}.joining('] [', ' [', ']')}
e.g.
D:/Terminator - Dark Fate (2019) [Uncut] [WEB-DL] [UHD] [REMUX]
mterrill
Posts: 32
Joined: 21 May 2018, 21:08

Re: newbie help - naming UHD or 4K or 2160p and REMUX plus more

Post by mterrill »

kim wrote: 15 Jun 2020, 18:37 I do not recommend having too much in folder name
title year tags... all else in filename only...
Thanks soo much for this! - One thing I am trying to work out is how to include {hd} but only if it the file UHD

I.e.

This is what i have...

Code: Select all

{'D:/Movies to Move/'}{plex.name} {tags}{'/'}{plex.name}{allOf{tags.join(', ')}{vs}{hd}{fn.match(/REMUX/)}{aco}.joining('] [', ' [', ']')}
But what if I wanted to include the {hd} part if it returned UHD.... any ideas?

Thanks
mterrill
Posts: 32
Joined: 21 May 2018, 21:08

Re: newbie help - naming UHD or 4K or 2160p and REMUX plus more

Post by mterrill »

Actually is this how you do it?

Code: Select all

{hdr == 'HDR' ? ' [HDR]':''}
mterrill
Posts: 32
Joined: 21 May 2018, 21:08

Re: newbie help - naming UHD or 4K or 2160p and REMUX plus more

Post by mterrill »

mterrill wrote: 02 Jul 2020, 23:15 Actually is this how you do it?

Code: Select all

{hdr == 'HDR' ? ' [HDR]':''}
That doesn't work as HDR10 is not captured.... help please ... sorry .... new to this....

Basically, if it is any type of HDR i want to add [typeofhdr] to the name? so basically add [ then the value of{hdr} then ] if it is not HDR then dont add []
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: newbie help - naming UHD or 4K or 2160p and REMUX plus more

Post by kim »

so ?

Code: Select all

{hd.match('UHD')}

Code: Select all

{' ['+hdr+']'}
mterrill
Posts: 32
Joined: 21 May 2018, 21:08

Re: newbie help - naming UHD or 4K or 2160p and REMUX plus more

Post by mterrill »

kim wrote: 03 Jul 2020, 00:48

Code: Select all

{' ['+hdr+']'}
Perfect! Thanks..... Can you give some insight on how or what that actually does?
mterrill
Posts: 32
Joined: 21 May 2018, 21:08

Re: newbie help - naming UHD or 4K or 2160p and REMUX plus more

Post by mterrill »

Oh, and how do I add the [ and the ] to REMUX if it finds it? otherwise, dont put [ or ]?

Code: Select all

{fn.match(/REMUX/)}


something like below, but how do i match REMUX and Remux and remux?

Code: Select all

{fn.match(/REMUX/).replace('REMUX','[REMUX]')}
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: newbie help - naming UHD or 4K or 2160p and REMUX plus more

Post by rednoah »

mterrill wrote: 03 Jul 2020, 01:30 Oh, and how do I add the [ and the ] to REMUX if it finds it? otherwise, dont put [ or ]?

Code: Select all

{fn.match(/REMUX/)}
e.g.

Code: Select all

{" [" + fn.match(/REMUX/) + "]"}
:idea: viewtopic.php?f=5&t=1895
:idea: Please read the FAQ and How to Request Help.
haveabreak
Posts: 6
Joined: 05 Jul 2020, 21:35

Re: newbie help - naming UHD or 4K or 2160p and REMUX plus more

Post by haveabreak »

Code: Select all

movieFormat={plex.derive{' '+tags.join(' ')}{' ['+allOf{vf}{vs}{ac}{vc.replace('AVC':'x264','HEVC':'x265')}{group}.join(' ')+']'}.tail}
This is my movie naming format at the moment. How would I go about adding Remux and HDR to this? Thanks for the help :)

Would this work? Sorry, I am a complete newbie too. Not sure how to include the HDR

Code: Select all

movieFormat={plex.derive{' '+tags.join(' ')}{' ['+allOf{vf}{vs}{ac}{vc.replace('AVC':'x264','AVC':'REMUX','HEVC':'x265')}{group}.join(' ')+']'}.tail}

I am aiming towards a similar naming scheme as this (copied from my radarr):

Code: Select all

{Movie Title} ({Release Year}) {Edition Tags} [{Quality Title} {MEDIAINFO HDR} {MEDIAINFO VIDEO} {MediaInfo AudioCodec} {MediaInfo AudioChannels}]{-Release Group}

Code: Select all

The Movie - Title (2010) Ultimate Extended Edition [Bluray-1080p HDR X264 DTS 5.1]-EVOLVE
if thats possible. Really appreciate the help
kim
Power User
Posts: 1251
Joined: 15 May 2014, 16:17

Re: newbie help - naming UHD or 4K or 2160p and REMUX plus more

Post by kim »

Code: Select all

{plex.derive{' ' + tags.join(' ')}{' [' + allOf{vs}{vf}{hdr}{ac}{channels}{vc.replace('AVC','x264').replace('HEVC','x265')}{fn.match(/REMUX/).upper()}.join(' ') + ']' + {'-' + group}}.tail}
haveabreak
Posts: 6
Joined: 05 Jul 2020, 21:35

Re: newbie help - naming UHD or 4K or 2160p and REMUX plus more

Post by haveabreak »

kim wrote: 05 Jul 2020, 23:21

Code: Select all

{plex.derive{' ' + tags.join(' ')}{' [' + allOf{vs}{vf}{hdr}{ac}{channels}{vc.replace('AVC','x264').replace('HEVC','x265')}{fn.match(/REMUX/).upper()}.join(' ') + ']' + {'-' + group}}.tail}
Thank you so much!
haveabreak
Posts: 6
Joined: 05 Jul 2020, 21:35

Re: newbie help - naming UHD or 4K or 2160p and REMUX plus more

Post by haveabreak »

kim wrote: 05 Jul 2020, 23:21

Code: Select all

{plex.derive{' ' + tags.join(' ')}{' [' + allOf{vs}{vf}{hdr}{ac}{channels}{vc.replace('AVC','x264').replace('HEVC','x265')}{fn.match(/REMUX/).upper()}.join(' ') + ']' + {'-' + group}}.tail}
This worked perfectly! Would love to send some beer money if you dont mind. Are you on the filebot discord too?
haveabreak
Posts: 6
Joined: 05 Jul 2020, 21:35

Re: newbie help - naming UHD or 4K or 2160p and REMUX plus more

Post by haveabreak »

Thanks so much for your help man. I ran into a problem:

Do you know why it renames TrueHD to MLPFBA Microsoft and how I can fix this?

Code: Select all

Sherlock.S01.REPACK.1080p.BluRay.REMUX.VC-1.TrueHD.5.1-EPSiLON

Code: Select all

Sherlock - S01E01 - Pilot [BluRay 1080p MLPFBA 5.1 Microsoft REMUX]-EPSiLON.mkv

same happens with

Code: Select all

The.Alienist.S01E10.Castle.in.the.Sky.1080p.TrueHD.5.1.AVC.REMUX-FraMeSToR.mkv
to

Code: Select all

The Alienist - S01E10 - Castle in the Sky [BluRay 1080p MLPFBA 5.1 x264 REMUX]-FraMeSToR.mkv
Using MediaInfoLib - v19.04
Really appreciate your help.
AbedlaPaille
Posts: 107
Joined: 12 Apr 2020, 04:02

Re: newbie help - naming UHD or 4K or 2160p and REMUX plus more

Post by AbedlaPaille »

kim wrote: 05 Mar 2020, 22:11 Added addToList = to make it more user friendly ( output e.g. [Add to "DTS XBR" codecList] )
Added useChFilter = to make it more user friendly ( true or false, makes it more "scene" like )

Code: Select all

{
	def preferredLang = 'Eng'
	def useChFilter = false
	def filter = { [it.codec, it.ch, it.objects, it.lang] }

	def codecList =
	[
	'MP3' : 'MP3',
	'PCM' : 'PCM',
	'AAC LC' : 'AAC',
	'AAC LC SBR' : 'AAC',
	'AAC LC SBR PS' : 'AAC',
	'AC 3' : 'AC3',
	'AC 3 Dep' : 'EAC3',
	'E AC 3' : 'EAC3',
	'E AC 3 JOC' : 'EAC3 Atmos',
	'AC 3 Dep JOC' : 'EAC3 Atmos',
	'DTS' : 'DTS',
	'DTS 96 24' : 'DTS 96-24',
	'DTS ES' : 'DTS-ES',
	'DTS ES XXCH' : 'DTS-ES',
	'DTS XBR' : 'DTS-HD HRA',
	'DTS ES XBR' : 'DTS-HD HRA',
	'DTS ES XXCH XBR' : 'DTS-HD HRA',
	'DTS XLL' : 'DTS-HD MA',
	'DTS ES XLL' : 'DTS-HD MA',
	'DTS ES XXCH XLL' : 'DTS-HD MA',
	'DTS XLL X' : 'DTS X',
	'MLP FBA' : 'TrueHD',
	'MLP FBA 16 ch' : 'TrueHD Atmos'
	]

	def audioStreams = []
	def audioClean = { it.replaceAll(/[\p{Pd}\p{Space}]/, ' ').replaceAll(/\p{Space}{2,}/, ' ').slash(' ') }
	def channelClean = { it.replaceAll(/Debug.+|Object\sBased\s?\/?|(\d+)?\sobjects\s\/\s|0.(?=\d.\d)|20/).replaceAll(/6.0/,'5.1').replaceAll(/8.0/,'7.1') }
	def oneStream = { it.collect{ filter(it) }*.minus(null).unique().flatten().join(' ') }
	def dString = { it.toDouble().toString() }
	def toInt = { it.toInteger() }

	any{audio.collect{ au ->
		def codec = audioClean(any{ au['CodecID/Hint'] }{ au['Format'] })
		def format_profile = any{ audioClean(au['Format_AdditionalFeatures'])}{}
		def String ch = any{ channelClean(au.ChannelPositionsString2).tokenize('\\/')*.toDouble().toString().sum() }
			{ channelClean(dString(au.ChannelsOriginal)) } { channelClean(dString(au.Channels)) }

		def chFilter =	( ( ( (ac == 'AAC'||ac == 'MP3') && ch != '2.0') || ( (ac == 'AC3'||ac == 'EAC3'||ac == 'DTS'||ac == 'TrueHD'||ac == 'MLPFBA') && ch != '5.1' ) ) ? ch : null )

		def combined = allOf{codec}{format_profile}.join(' ')

		audioStreams << ['index' : codecList.findIndexOf { it.key == combined }, 'default' : any {au['default'][0].toBoolean() }{ audio.size == 1 ? true : '' },
		'codec' : codecList.get(combined, 'Add to "' + combined + '" codecList'), 'combined' : combined, 'ch' : useChFilter ? chFilter : ch,
		'bitrate' : any{ toInt(au.BitRate) }{ toInt(au.BitRate_Maximum) }{ dString(au.FrameRate) }{null},
		'objects' : any{ '[' + au['NumberOfDynamicObjects'] + ' Objs]' }{null}, 'lang' : any{ au.'LanguageString3'.upperInitial() }{null} ]
		return audioStreams
	}

	def addToList = audioStreams.codec.findAll{ it.contains('Add to') }.unique().sort()
	def allStreams = audioStreams.collect{ filter(it) }*.minus(null).unique()*.join(' ')
	def preferredStream = oneStream(audioStreams.findAll{ it.index == audioStreams.index.max() })
	def bestBitRate = oneStream(audioStreams.findAll{ it.bitrate == audioStreams.bitrate.max() })
	def defaultStream = oneStream(audioStreams.findAll{ it.default == true })
	def bestPreferredLang = any{ audioStreams.findAll{ it.lang == preferredLang }.sort{ a, b -> b.bitrate <=> a.bitrate }.collect{ filter(it) }*.minus(null).unique().get(0).join(' ') }{}

	allStreams.join(' & ').space('.')
	preferredStream.space('.')
	defaultStream.space('.')
	bestBitRate.space('.')
	[defaultStream, bestBitRate].unique().join(' & ').space('.')
	[bestBitRate, preferredStream].unique().join(' & ').space('.')
	any{addToList}{bestPreferredLang}{defaultStream}{bestBitRate}{preferredStream}
	}{'NO_AUDIO'}
}
Only use one of these lines:

Code: Select all

	allStreams.join(' & ').space('.')
	preferredStream.space('.')
	defaultStream.space('.')
	bestBitRate.space('.')
	[defaultStream, bestBitRate].unique().join(' & ').space('.')
	[bestBitRate, preferredStream].unique().join(' & ').space('.')
	any{addToList}{bestPreferredLang}{defaultStream}{bestBitRate}{preferredStream}
useChFilter = this line:

Code: Select all

def chFilter =	( ( ( (ac == 'AAC'||ac == 'MP3') && ch != '2.0') || ( (ac == 'AC3'||ac == 'EAC3'||ac == 'DTS'||ac == 'TrueHD'||ac == 'MLPFBA') && ch != '5.1' ) ) ? ch : null )
= if AAC/MP3 2.0 OR AC3/EAC3/DTS/TrueHD/MLPFBA 5.1, then don't show the 2.0/5.1 part

allStreams = All Audio Streams
preferredStream = The last (best) match from codecList (order matters, from low to high quality / or what you prefer)
defaultStream = The Audio Stream tagged "default=Yes" or if only one Stream
bestBitRate = The Audio Stream with the highest BitRate (with BitRate_Maximum/FrameRate as backup)
Should fix that and many more. The thread it's from might interest you: viewtopic.php?t=5285&start=25
mterrill
Posts: 32
Joined: 21 May 2018, 21:08

Re: newbie help - naming UHD or 4K or 2160p and REMUX plus more

Post by mterrill »

OK, can anyone help with why the following would cause a .rum to be inserted?

Code: Select all

{plex.name} {tags} {fn.match(/REMUX/).upper().replace('REMUX','[REMUX]')} {hd == 'UHD' ? ' [UHD]':''}{' ['+hdr+']'}{'/'}{plex.name}{allOf{tags.join(', ')}{vs}{hd}{hdr}{fn.match(/REMUX/)}{aco}.joining('] [', ' [', ']')}
Dante's Peak 1997 1080p Blu-ray Remux VC-1 DTS-HD MA 5.1 - KRaLiMaRKo.srt

gets renamed to Dante's Peak (1997).rum [REMUX]\Dante's Peak (1997).rum [BluRay] [HD] [Remux] [DTS-HD Master Audio]
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: newbie help - naming UHD or 4K or 2160p and REMUX plus more

Post by rednoah »

Are the subtitles in Romanian or similar sounding language?
:idea: Please read the FAQ and How to Request Help.
mterrill
Posts: 32
Joined: 21 May 2018, 21:08

Re: newbie help - naming UHD or 4K or 2160p and REMUX plus more

Post by mterrill »

Oh, Ok I dont want any of that detail... just want the name and year then tags and REMUX if it is :)

So does plex.name include language of subtitles?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: newbie help - naming UHD or 4K or 2160p and REMUX plus more

Post by rednoah »

rednoah wrote: 12 Sep 2016, 10:03 e.g. Movies/Avatar (2009)/Avatar (2009) by James Cameron [720p, x264, AC3].eng

Code: Select all

{plex.derive{" by $director"}{" [$vf, $vc, $ac]"}}
:idea: plex.derive() can be used to insert additional information after the file name but before the subtitle language suffix and file extension.
If you're using {plex} then File.derive() is more suitable if you wanna add information to the file name but before the language tag.
:idea: Please read the FAQ and How to Request Help.
Post Reply