Page 1 of 1

Error/Wrong Audio

Posted: 03 May 2020, 11:53
by BabyRay
Hello,

i use a script from this board, but since the last update i get an error.
But i dont know how to fix it.
Maybe someone can help me out, please :)

Since last update my files look like this:

Code: Select all

../Series (2003)/Series (2003) [720p] [5.1 UNKNOWN_FORMAT--DTS [email protected] Deu, 5.1 UNKNOWN_FORMAT--DTS [email protected] Eng].eng

Code: Select all

../Movie (1979)/Movie (1979) [576p] [1.0 UNKNOWN_FORMAT--AC 3 [email protected]]
but it should look like this:

Code: Select all

../Series (2003)/Series (2003) [720p] [5.1 DTS Deu, 5.1 DTS Eng]

Code: Select all

../Movie (1979)/Movie (1979) [576p] [2.0 AC 3 Deu]
i use this code (it works not perfect with subs but its ok for me :) :

Code: Select all

{n} ({y}) - {'S'+s.pad(2)}E{e.pad(2)} - {t} [{vf}] [{
	// map codec + format_profile
	def mCFP = [ "MP3" : "MP3",
		"AC 3" : "AC3",
		"E AC 3" : "E-AC3",
		"E AC 3 JOC" : "E-AC3 Atmos",
		"MLP FBA" : "TrueHD",
		"MLP FBA 16 ch" : "TrueHD Atmos",
		"DTS" : "DTS",
		"DTS ES XXCH XBR" : "DTS-HD HRA",
		"DTS ES XBR" : "DTS-HD HRA",
		"DTS XBR" : "DTS-HD HRA",
		"DTS XLL" : "DTS-HD MA",
		"DTS ES XXCH" : "DTS-ES",
		"DTS ES" : "DTS-ES",
		"DTS XLL X" : "DTS.X",
		"DTS 96 24" : "DTS 96-24",
		"AAC LC" : "AAC"]
	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/,'5.1').replaceAll(/8/,'7.1') }
	audio.collect { au ->
		def channels = any{ channelClean(au['ChannelPositionsString2'])}{ channelClean(au['ChannelsOriginal'])}{ channelClean(au['Channels']) }
		def ch = channels
			.tokenize('\\/').take(3)*.toDouble()
			.inject(0, { a, b -> a + b })
			.findAll { it > 0 }.max().toString()
		def codec = audioClean(any{ au['CodecID/Hint'] }{ au['Format'] })
		def format_profile = { ( au['Format_AdditionalFeatures'] != null) ? audioClean(au['Format_AdditionalFeatures']) : '' }
		def combined = allOf{codec}{format_profile}.join(' ')
		def stream = allOf
		         { ch }
                   { mCFP.get(combined, 'UNKNOWN_FORMAT--'+combined+'--') }
                   { au.'LanguageString3'.upperInitial() }
		println "MISSING_mCFP_FORMAT: "+combined
		return stream
	}*.join(" ").unique().join(", ")
}]{fn =~ /eng|english/ ? '.eng' : fn =~ /ger|german/ ? '.ger' : null}{'.'+fn.match(/forced/)}{'-'+fn.match(/thumb/)}

Re: Error/Wrong Audio

Posted: 03 May 2020, 15:28
by rednoah
Try the latest beta release. It should have improved support for bad code.
viewtopic.php?t=1609

Re: Error/Wrong Audio

Posted: 04 May 2020, 00:08
by kim
problem line:

Code: Select all

def format_profile = { ( au['Format_AdditionalFeatures'] != null) ? audioClean(au['Format_AdditionalFeatures']) : '' }
replace with:

Code: Select all

def format_profile = any{ audioClean(au['Format_AdditionalFeatures']) }{''}
btw: you are using an old version
viewtopic.php?f=5&t=5285&p=44040#p48827