@ -9,7 +9,7 @@ function details() {
Type : "Video" ,
Type : "Video" ,
Description : ` If the file is not in h265 it will be trancoded into h265 with HandBrake using the following command '-e x265 -q 22 --encoder-preset slow --all-audio --all-subtitles copy:aac -E fdk_aac -Q 4 -x aq-mode=3'. If no aac, aac track will be added. Subtitles are kept. Metadata is removed. \n \n
Description : ` If the file is not in h265 it will be trancoded into h265 with HandBrake using the following command '-e x265 -q 22 --encoder-preset slow --all-audio --all-subtitles copy:aac -E fdk_aac -Q 4 -x aq-mode=3'. If no aac, aac track will be added. Subtitles are kept. Metadata is removed. \n \n
` ,
` ,
Version : "1.0 0 ",
Version : "1.0 1 ",
Link : "https://github.com/HaveAGitGat/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta"
Link : "https://github.com/HaveAGitGat/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta"
}
}
@ -22,13 +22,13 @@ function plugin(file) {
var response = {
var response = {
processFile : false ,
processFile : false ,
preset : '' ,
preset : '' ,
container : '.mp4' ,
container : '.mp4' ,
handBrakeMode : false ,
handBrakeMode : false ,
FFmpegMode : false ,
FFmpegMode : false ,
reQueueAfter : false ,
reQueueAfter : false ,
infoLog : '' ,
infoLog : '' ,
}
}
@ -45,16 +45,13 @@ function plugin(file) {
} else {
} else {
var jsonString = JSON . stringify ( file )
if ( file . ffProbeData . streams [ 0 ] . codec _name != 'hevc' ) {
if ( file . ffProbeData . streams [ 0 ] . codec _name != 'hevc' ) {
response . processFile = true ;
response . processFile = true ;
response . preset = ' -e x265 -q 22 --encoder-preset slow --all-audio --all-subtitles copy:aac -E fdk_aac -Q 4 -x aq-mode=3 '
response . preset = ' , -map 0 -c copy -c:v:0 libx265 -preset:v slow -pix_fmt yuv420p10le -x265-params "crf=22:aq-mode=3" '
response . container = '.mkv'
response . container = '.mkv'
response . handBrakeMode = true
response . FFmpegMode = true
response . FFmpegMode = false
response . reQueueAfter = true ;
response . reQueueAfter = true ;
response . infoLog += "☒File is not in hevc! \n"
response . infoLog += "☒File is not in hevc! \n"
return response
return response
@ -64,19 +61,66 @@ function plugin(file) {
}
}
if ( file . meta . Title != undefined ) {
var audioIdx = - 1
var ffmpegCommandInsert = ''
var hasnonAACTrack = false
for ( var i = 0 ; i < file . ffProbeData . streams . length ; i ++ ) {
try {
if ( file . ffProbeData . streams [ i ] . codec _type . toLowerCase ( ) == "audio" ) {
audioIdx ++
}
} catch ( err ) { }
try {
if ( file . ffProbeData . streams [ i ] . codec _name !== 'aac' && file . ffProbeData . streams [ i ] . codec _type . toLowerCase ( ) == "audio" ) {
ffmpegCommandInsert += ` -c:a: ${ audioIdx } aac -vbr 4 `
hasnonAACTrack = true
}
} catch ( err ) { }
}
var ffmpegCommand = ` ,-map 0 -c:v copy -c:a copy ${ ffmpegCommandInsert } -c:s copy -c:d copy `
if ( hasnonAACTrack == true ) {
response . processFile = true ;
response . preset = ffmpegCommand
response . container = '.mkv'
response . handBrakeMode = false
response . FFmpegMode = true
response . reQueueAfter = true ;
response . infoLog += "☒ File has audio which is not in aac! \n"
return response
} else {
response . infoLog += "☑ All audio streams are in aac! \n"
}
if ( file . meta . Title != undefined ) {
response . infoLog += "☒File has title metadata \n"
response . infoLog += "☒File has title metadata \n"
response . preset = ',-map_metadata -1 -c:v copy -c:a copy'
response . preset = ',-metadata title="" -metadata comment="" -map 0 -c copy'
response . container = '.mkv'
response . reQueueAfter = true ;
response . reQueueAfter = true ;
response . processFile = true ;
response . processFile = true ;
response . FFmpegMode = true
response . FFmpegMode = true
return response
return response
} else {
} else {
response . infoLog += "☑File has no title metadata \n"
response . infoLog += "☑File has no title metadata \n"
}
}
response . infoLog += "☑File meets conditions! \n"
response . infoLog += "☑File meets conditions! \n"
return response
return response