DTS-X Channels syntax

All about user-defined episode / movie format expressions
Post Reply
tbirz
Posts: 2
Joined: 28 Mar 2019, 06:31

DTS-X Channels syntax

Post by tbirz » 06 May 2019, 13:52

Hi everyone been using filebot gui for a while but I thought I would automate the process, cut out some handling time. I have become stuck with allocating channels for DTS-X. All other codecs that I am using are working well. By the way rednoah great job with the app! You must be very proud. It must keep you very busy though!
Here is a copy of my sysinfo:

C:/Users/Tony/Downloads/
Locking C:\Users\Tony\Downloads\amc.log
FileBot 4.8.5 (r6224)
JNA Native: 5.2.2
MediaInfo: 18.12
7-Zip-JBinding: 9.20
Chromaprint: fpcalc version 1.4.2
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2019-05-05 (r564)
Groovy: 2.5.6
JRE: OpenJDK Runtime Environment 11.0.2
JVM: 64-bit OpenJDK 64-Bit Server VM
CPU/MEM: 8 Core / 4 GB Max Memory / 42 MB Used Memory
OS: Windows 10 (amd64)
Package: APPX
License: Microsoft Store License
Done ?(?????)?
Batch File C:\Users\Tony\Downloads\ScriptInfo.bat is successfully completed

My Code is a follows:

Code: Select all

echo off
cls
PUSHD=%~dp0
rem echo Location: %~dp0
SET DirLoc=%~dp0
SET DirResult=%DirLoc:\=/%
echo %DirResult%

 filebot -script fn:amc %DirResult% --log-file %DirResult%"/amc.log" --output "//192.***.**.**/share/media_rw"  --action test --conflict skip -non-strict --def clean=n --lang=en --def "movieFormat=/{n =~ /^(?i)[0-9a-h]/ ? 'sda1/Movies A-H' : n =~ /^(?i)[i-p]/ ? 'sdb1/Movies I-P':'sdc1/Movies Q-Z'}:/{ny} [{any{audioLanguages[0].ISO3.lower()}{}}]{' '+vf}{' '+source}{fn.contains('3D') || fn.contains('3-D') ? '.3D':''}{' '+fn.replace(/(?i)\.DC\./, '.directors.cut.').replaceAll(/director\'?s|theatrical|ultimate/,'$0.Cut').matchAll(/UNCENSORED|UNRATED|REMASTERED|EXTENDED|UNCUT|DIRECTOR|WS\'?S.CUT|THEATRICAL.CUT|ULTIMATE.CUT|FINAL.CUT|SPECIAL.EDITION/)*.upperInitial()*.lowerTrail().sort().join(' ')}{' '+fn.matchAll(/PROPER|REPACK/)*.upper().sort().join(' ')}{' '+vc.replace('Microsoft', 'VC-1')} {' '+ac.replace('MLPFBA', 'TrueHD')}{audio.Format_String=~/E-AC-3 JOC/ ? ' Atmos ':''}{audio.Format_String=~/DTS XLL/ ? '-MA':''}{audio.Format_String=~/DTS XLL X/ ? '-X':''}{audio.Format_String=~/ES XXCH/ ? '-ES Discrete':''}{audio.Format_String =~/MLP FBA 16-ch/ ? ' Atmos':''}{audio.Format_String=~/AAC LC SBR/ ? '-HE':''} {af} [{'en' in text.language ? 'eng' :text.language.ISO3.lower}] ({minutes} mins) /{n} ({y}) [{any{audioLanguages[0].ISO3.lower()}{}}]{' '+vf}{' '+source}{fn.contains('3D') || fn.contains('3-D') ? '.3D':''}{' '+fn.replace(/(?i)\.DC\./, '.directors.cut.').replaceAll(/director\'?s|theatrical|ultimate/,'$0.Cut').matchAll(/UNCENSORED|UNRATED|REMASTERED|EXTENDED|UNCUT|DIRECTOR|WS\'?S.CUT|THEATRICAL.CUT|ULTIMATE.CUT|FINAL.CUT|SPECIAL.EDITION/)*.upperInitial()*.lowerTrail().sort().join(' ')}{' '+fn.matchAll(/PROPER|REPACK/)*.upper().sort().join(' ')}{' '+vc.replace('Microsoft', 'VC-1')} {' '+ac.replace('MLPFBA', 'TrueHD')}{audio.Format_String=~/E-AC-3 JOC/ ? ' Atmos ':''}{audio.Format_String=~/DTS XLL/ ? '-MA':''}{audio.Format_String=~/DTS XLL X/ ? '-X':''}{audio.Format_String=~/ES XXCH/ ? '-ES Discrete':''} {audio.Format_String =~/MLP FBA 16-ch/ ? ' Atmos':''}{audio.Format_String=~/AAC LC SBR/ ? '-HE':''} {af} [{'en' in text.language ? 'eng' :text.language.ISO3.lower}] ({minutes} mins){def g = c{group}; def m = c{fn.match(/(?:(?<=[-])[a-z0-9]+$)|(?:^[a-z0-9]+(?=[-]))/)}; if(g==null && m!=null) return '-'+m.replace(/^tpz$/, 'TOPAZ'); if(g!=null && m!=null && m.lower()!=g.lower()) return '-'+m.replace(/^tpz$/, 'TOPAZ'); if(g!=null) return '-'+g;}" 
 
 POPD
echo Batch File %~nf0% is successfully completed
pause
exit

The Resultant is as follows:
C:/Users/Tony/Downloads/
Locking C:\Users\Tony\Downloads\amc.log
Run script [fn:amc] at [Mon May 06 23:21:52 AEST 2019]
Parameter: clean = n
Parameter: movieFormat = /{n =~ /^(?i)[0-9a-h]/ ? 'sda1/Movies A-H' : n =~ /^(?i)[i-p]/ ? 'sdb1/Movies I-P':'sdc1/Movies Q-Z'}:/{ny} [{any{audioLanguages[0].ISO3.lower()}{}}]{' '+vf}{' '+source}{fn.contains('3D') || fn.contains('3-D') ? '.3D':''}{' '+fn.replace(/(?i)\.DC\./, '.directors.cut.').replaceAll(/director\'?s|theatrical|ultimate/,'$0.Cut').matchAll(/UNCENSORED|UNRATED|REMASTERED|EXTENDED|UNCUT|DIRECTOR|WS\'?S.CUT|THEATRICAL.CUT|ULTIMATE.CUT|FINAL.CUT|SPECIAL.EDITION/)*.upperInitial()*.lowerTrail().sort().join(' ')}{' '+fn.matchAll(/PROPER|REPACK/)*.upper().sort().join(' ')}{' '+vc.replace('Microsoft', 'VC-1')} {' '+ac.replace('MLPFBA', 'TrueHD')}{audio.Format_String=~/E-AC-3 JOC/ ? ' Atmos ':''}{audio.Format_String=~/DTS XLL/ ? '-MA':''}{audio.Format_String=~/DTS XLL X/ ? '-X':''}{audio.Format_String=~/ES XXCH/ ? '-ES Discrete':''}{audio.Format_String =~/MLP FBA 16-ch/ ? ' Atmos':''}{audio.Format_String=~/AAC LC SBR/ ? '-HE':''} {af} [{'en' in text.language ? 'eng' :text.language.ISO3.lower}] ({minutes} mins) /{n} ({y}) [{any{audioLanguages[0].ISO3.lower()}{}}]{' '+vf}{' '+source}{fn.contains('3D') || fn.contains('3-D') ? '.3D':''}{' '+fn.replace(/(?i)\.DC\./, '.directors.cut.').replaceAll(/director\'?s|theatrical|ultimate/,'$0.Cut').matchAll(/UNCENSORED|UNRATED|REMASTERED|EXTENDED|UNCUT|DIRECTOR|WS\'?S.CUT|THEATRICAL.CUT|ULTIMATE.CUT|FINAL.CUT|SPECIAL.EDITION/)*.upperInitial()*.lowerTrail().sort().join(' ')}{' '+fn.matchAll(/PROPER|REPACK/)*.upper().sort().join(' ')}{' '+vc.replace('Microsoft', 'VC-1')} {' '+ac.replace('MLPFBA', 'TrueHD')}{audio.Format_String=~/E-AC-3 JOC/ ? ' Atmos ':''}{audio.Format_String=~/DTS XLL/ ? '-MA':''}{audio.Format_String=~/DTS XLL X/ ? '-X':''}{audio.Format_String=~/ES XXCH/ ? '-ES Discrete':''} {audio.Format_String =~/MLP FBA 16-ch/ ? ' Atmos':''}{audio.Format_String=~/AAC LC SBR/ ? '-HE':''} {af} [{'en' in text.language ? 'eng' :text.language.ISO3.lower}] ({minutes} mins){def g = c{group}; def m = c{fn.match(/(?:(?<=[-])[a-z0-9]+$)|(?:^[a-z0-9]+(?=[-]))/)}; if(g==null && m!=null) return '-'+m.replace(/^tpz$/, 'TOPAZ'); if(g!=null && m!=null && m.lower()!=g.lower()) return '-'+m.replace(/^tpz$/, 'TOPAZ'); if(g!=null) return '-'+g;}
Argument[0]: C:\Users\Tony\Downloads
Ignore hidden: C:\Users\Tony\Downloads\desktop.ini
Input: C:\Users\Tony\Downloads\Lone Survivor (2013) 4K UHD BluRay 2160p x264 DTS-X 8CH\Lone Survivor (2013) 4K UHD BluRay 2160p x264 DTS-X 8CH.mkv
Input: C:\Users\Tony\Downloads\Rocky (1976) [eng] 2160p HEVC DTS-MA 6ch [eng] (119 mins).mkv
Group: [Movie:Lone Survivor (2013)] => [Lone Survivor (2013) 4K UHD BluRay 2160p x264 DTS-X 8CH.mkv]
Group: [Movie:Rocky (1976)] => [Rocky (1976) [eng] 2160p HEVC DTS-MA 6ch [eng] (119 mins).mkv]
Rename movies using [TheMovieDB]
Auto-detect movie from context: [C:\Users\Tony\Downloads\Lone Survivor (2013) 4K UHD BluRay 2160p x264 DTS-X 8CH\Lone Survivor (2013) 4K UHD BluRay 2160p x264 DTS-X 8CH.mkv]
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/C:/Program%20Files/WindowsApps/PointPlanck.FileBot_4.8.5.0_x64__49ex9gnthnt12/jar/groovy.jar) to method javax.script.AbstractScriptEngine.getScriptContext(javax.script.Bindings)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Stripping invalid characters from new path: /sdb1/Movies I-P:/Lone Survivor (2013) [eng] 2160p BluRay x264 DTS-MA-X [] (121 mins)/Lone Survivor (2013) [eng] 2160p BluRay x264 DTS-MA-X [] (121 mins)
[TEST] from [C:\Users\Tony\Downloads\Lone Survivor (2013) 4K UHD BluRay 2160p x264 DTS-X 8CH\Lone Survivor (2013) 4K UHD BluRay 2160p x264 DTS-X 8CH.mkv] to [\\192.***.**.**\share\media_rw\sdb1\Movies I-P\Lone Survivor (2013) [eng] 2160p BluRay x264 DTS-MA-X [] (121 mins)\Lone Survivor (2013) [eng] 2160p BluRay x264 DTS-MA-X [] (121 mins).mkv]
Processed 1 files
Rename movies using [TheMovieDB]
Auto-detect movie from context: [C:\Users\Tony\Downloads\Rocky (1976) [eng] 2160p HEVC DTS-MA 6ch [eng] (119 mins).mkv]
Stripping invalid characters from new path: /sdc1/Movies Q-Z:/Rocky (1976) [eng] 2160p HEVC DTS-MA 6ch [eng] (119 mins)/Rocky (1976) [eng] 2160p HEVC DTS-MA 6ch [eng] (119 mins)
[TEST] from [C:\Users\Tony\Downloads\Rocky (1976) [eng] 2160p HEVC DTS-MA 6ch [eng] (119 mins).mkv] to [\\192.***.**.**\share\media_rw\sdc1\Movies Q-Z\Rocky (1976) [eng] 2160p HEVC DTS-MA 6ch [eng] (119 mins)\Rocky (1976) [eng] 2160p HEVC DTS-MA 6ch [eng] (119 mins).mkv]
Processed 1 files
Done ?(?????)?
Batch File C:\Users\Tony\Downloads\TestrenameMovies.bat is successfully completed
Press any key to continue . . .
As you can see I have coupled the -MA and the -X to give DTS-MA-X when DTS-X is available. It just becomes DTS-MA when not. As you can see when the -MA only is used the {af} is displayed but when the -X is added I cannot get the {af} to display. I have tried all the combos I can think of to get it to work but it still will not display. I can get the channels to display when running on all the other formats I have coded. Nb the square boxes next to the {af} is for subtitle languages.
fyi, The Rocky Movie output is the desired output with the {af} displayed. Anyway, any ideas would be much appreciated. Thankyou.

User avatar
rednoah
The Source
Posts: 15813
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: DTS-X Channels syntax

Post by rednoah » 06 May 2019, 14:41

Presumably, this is about checking MediaInfo for specific audio fields:
viewtopic.php?f=5&t=4285

Using the GUI to prototyping and debugging custom format expressions is most highly recommended:
Image


:idea: {af} is based on the "Channel(s)_Original" or "Channel(s)" fields of the first audio stream, so if these fields are available it'll work.

:?: I'm not really sure what the problem is. Maybe you could illustrate the problem in a bare-bones simple example?

:?: Please copy & paste the Audio Stream 0 table for one of the files where {af} doesn't work so I can see which fields are available.
:idea: Please read the FAQ and How to Request Help.

kim
Power User
Posts: 730
Joined: 15 May 2014, 16:17

Re: DTS-X Channels syntax

Post by kim » 06 May 2019, 16:13

Code: Select all

{af}
on a dts-x file
=
Binding "af": No value present
Channel(s)_Original Object Based
Channel(s) 8
just replace with

Code: Select all

{any{af}{audio.Channels[0]+'ch'}}
or
you may like this:
viewtopic.php?f=5&t=5285&p=43844#p43844

User avatar
rednoah
The Source
Posts: 15813
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: DTS-X Channels syntax

Post by rednoah » 06 May 2019, 20:00

So we just can't use the Channel(s)_Original field at all then? Maybe just use Channel(s) for {af} then?
:idea: Please read the FAQ and How to Request Help.

kim
Power User
Posts: 730
Joined: 15 May 2014, 16:17

Re: DTS-X Channels syntax

Post by kim » 06 May 2019, 20:07

only a problem on dts-x files, in my test
because of the new mediainfo ;)

User avatar
rednoah
The Source
Posts: 15813
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: DTS-X Channels syntax

Post by rednoah » 06 May 2019, 20:08

Does {channels} work for DTS-X files?
:idea: Please read the FAQ and How to Request Help.

kim
Power User
Posts: 730
Joined: 15 May 2014, 16:17

Re: DTS-X Channels syntax

Post by kim » 06 May 2019, 20:12

no... again only dts-x
ChannelPositions/String2 Object Based
Channel(s)_Original Object Based
Channel(s) 8

tbirz
Posts: 2
Joined: 28 Mar 2019, 06:31

Re: DTS-X Channels syntax

Post by tbirz » 06 May 2019, 23:51

Hi guys, thanks for the quick reply. I substituted {af} with Kim's option {any{af}{audio.Channels[0]+'ch'}} and the resultant returned '8ch' which is what I was after. Many thanks.

kim
Power User
Posts: 730
Joined: 15 May 2014, 16:17

Re: DTS-X Channels syntax

Post by kim » 07 May 2019, 22:36

A quick test on new beta:
I'm not sure about the
if "Object Based" then f*ck that stream and go on to next ?
why not display '8ch' when "Channel(s) 8" is there ?
... but then again {channels} will not match or it will be a guess (like 8 ch is always 7.1) ?
it's down to, is some info better then none...

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests