Update: MigzPlugins

Updated all plugins to include "-max_muxing_queue_size 4096"
make-only-subtitle-default
Migz93 6 years ago
parent 86835f6682
commit b22c576c84

@ -71,7 +71,7 @@ function plugin(file, librarySettings, inputs) {
}
videoIdx++
}
if (file.ffProbeData.streams[i].codec_type.toLowerCase() == "audio" && inputs.clean_audio.toLowerCase() == "true") {
if (file.ffProbeData.streams[i].tags.title.split('.').length-1 > 3) {
response.infoLog += `☒More then 3 full stops detected in subtitle title, likely to be junk metadata. Removing title from stream ${i} \n`
@ -80,7 +80,7 @@ function plugin(file, librarySettings, inputs) {
}
audioIdx++
}
if (file.ffProbeData.streams[i].codec_type.toLowerCase() == "subtitle" && inputs.clean_subtitles.toLowerCase() == "true") {
if (file.ffProbeData.streams[i].tags.title.split('.').length-1 > 3) {
response.infoLog += `☒More then 3 full stops detected in subtitle title, likely to be junk metadata. Removing title from stream ${i} \n`
@ -93,7 +93,7 @@ function plugin(file, librarySettings, inputs) {
if (convert == true) {
response.infoLog += "☒File has title metadata. Removing \n"
response.preset = `,${ffmpegCommandInsert} -c copy`
response.preset = `,${ffmpegCommandInsert} -c copy -max_muxing_queue_size 4096`
response.reQueueAfter = true;
response.processFile = true;
} else {

@ -15,10 +15,10 @@ function details() {
tooltip: `Specify language tag/s here for the audio tracks you'd like to keep, recommended to keep "und" as this stands for undertermined, some files may not have the language specified. Must follow ISO-639-2 3 letter format. https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes
\\nExample:\\n
eng
\\nExample:\\n
eng,und
\\nExample:\\n
eng,und,jap`
},
@ -27,7 +27,7 @@ function details() {
tooltip: `Specify if audio tracks that contain commentary/description should be removed.
\\nExample:\\n
true
\\nExample:\\n
false`
},
@ -36,7 +36,7 @@ function details() {
tooltip: `Specify a single language for audio tracks with no language or unknown language to be tagged with, leave empty to disable, you must have "und" in your list of languages to keep for this to function. Must follow ISO-639-2 3 letter format. https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes
\\nExample:\\n
eng
\\nExample:\\n
por
`
@ -46,7 +46,7 @@ function details() {
tooltip: `Specify audio tracks with no title to be tagged with the number of channels they contain. Do NOT use this with mp4, as mp4 does not support title tags.
\\nExample:\\n
true
\\nExample:\\n
false`
},
@ -70,14 +70,14 @@ function plugin(file, librarySettings, inputs) {
response.infoLog += "☒File is not video \n"
response.processFile = false;
return response
}
}
if (inputs.language == "") {
response.infoLog += "☒Language/s keep have not been configured within plugin settings, please configure required options. Skipping this plugin. \n"
response.processFile = false;
return response
}
}
var language = inputs.language.split(",")
var ffmpegCommandInsert = ''
var convert = false
@ -106,7 +106,7 @@ function plugin(file, librarySettings, inputs) {
try {
if (inputs.commentary.toLowerCase() == "true" && file.ffProbeData.streams[i].codec_type.toLowerCase() == "audio" && (file.ffProbeData.streams[i].tags.title.toLowerCase().includes('commentary') || file.ffProbeData.streams[i].tags.title.toLowerCase().includes('description') || file.ffProbeData.streams[i].tags.title.toLowerCase().includes('sdh'))) {
audioStreamsRemoved++
audioStreamsRemoved++
ffmpegCommandInsert += `-map -0:a:${audioIdx} `
response.infoLog += `☒Audio stream detected as being Commentary or Description, removing. Audio stream 0:a:${audioIdx} - ${file.ffProbeData.streams[i].tags.title}. \n`
convert = true
@ -120,7 +120,7 @@ function plugin(file, librarySettings, inputs) {
response.infoLog += `☒Audio stream detected as having unknown language tagged, tagging as ${inputs.tag_language}. \n`
convert = true
}
if (typeof file.ffProbeData.streams[i].tags.language === 'undefined' && file.ffProbeData.streams[i].codec_type.toLowerCase() == "audio") {
ffmpegCommandInsert += `-metadata:s:a:${audioIdx} language=${inputs.tag_language} `
response.infoLog += `☒Audio stream detected as having no language tagged, tagging as ${inputs.tag_language}. \n`
@ -148,7 +148,7 @@ function plugin(file, librarySettings, inputs) {
}
}
} catch (err) { }
}
if (audioStreamsRemoved == audioStreamCount) {
@ -159,7 +159,7 @@ function plugin(file, librarySettings, inputs) {
if (convert === true && (audioStreamsRemoved != audioStreamCount)) {
response.processFile = true
response.preset = `, -map 0 ${ffmpegCommandInsert} -c copy`
response.preset = `, -map 0 ${ffmpegCommandInsert} -c copy -max_muxing_queue_size 4096`
response.container = '.' + file.container
response.reQueueAfter = true
} else {

@ -15,7 +15,7 @@ function details() {
tooltip: `Specify language tag/s here for the subtitle tracks you'd like to keep. Must follow ISO-639-2 3 letter format. https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes
\\nExample:\\n
eng
\\nExample:\\n
eng,jap`
},
@ -24,7 +24,7 @@ function details() {
tooltip: `Specify if subtitle tracks that contain commentary/description should be removed.
\\nExample:\\n
true
\\nExample:\\n
false`
},
@ -33,7 +33,7 @@ function details() {
tooltip: `Specify a single language for subtitle tracks with no language or unknown language to be tagged with, leave empty to disable. Must follow ISO-639-2 3 letter format. https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes
\\nExample:\\n
eng
\\nExample:\\n
por`
},
@ -58,13 +58,13 @@ function plugin(file, librarySettings, inputs) {
response.processFile = false;
return response
}
if (inputs.language == "") {
response.infoLog += "☒Language/s keep have not been configured within plugin settings, please configure required options. Skipping this plugin. \n"
response.processFile = false;
return response
}
}
var language = inputs.language.split(",")
var ffmpegCommandInsert = ''
var subtitleIdx = -1
@ -84,7 +84,7 @@ function plugin(file, librarySettings, inputs) {
convert = true
}
} catch (err) { }
try {
if (inputs.commentary.toLowerCase() == "true" && file.ffProbeData.streams[i].codec_type.toLowerCase() == "subtitle" && (file.ffProbeData.streams[i].tags.title.toLowerCase().includes('commentary') || file.ffProbeData.streams[i].tags.title.toLowerCase().includes('description') || file.ffProbeData.streams[i].tags.title.toLowerCase().includes('sdh'))) {
ffmpegCommandInsert += `-map -0:s:${subtitleIdx} `
@ -102,7 +102,7 @@ function plugin(file, librarySettings, inputs) {
}
}
} catch (err) { }
try {
if (typeof file.ffProbeData.streams[i].tags.language == 'undefined' && file.ffProbeData.streams[i].codec_type.toLowerCase() == "subtitle") {
ffmpegCommandInsert += `-metadata:s:s:${subtitleIdx} language=${inputs.tag_title} `
@ -113,7 +113,7 @@ function plugin(file, librarySettings, inputs) {
}
if (convert === true ) {
response.processFile = true;
response.preset = `, -map 0 ${ffmpegCommandInsert} -c copy`
response.preset = `, -map 0 ${ffmpegCommandInsert} -c copy -max_muxing_queue_size 4096`
response.container = '.' + file.container
response.reQueueAfter = true;
} else {

@ -15,7 +15,7 @@ function details() {
tooltip: `Specify if any 2.0 audio tracks should be converted to aac for maximum compatability with devices.
\\nExample:\\n
true
\\nExample:\\n
false`
},
@ -24,7 +24,7 @@ function details() {
tooltip: `Specify if downmixing should be used to create extra audio tracks. I.e if you have an 8ch but no 2ch or 6ch, create the missing audio tracks from the 8 ch. Likewise if you only have 6ch, create the missing 2ch from it.
\\nExample:\\n
true
\\nExample:\\n
false`
},
@ -48,8 +48,8 @@ function plugin(file, librarySettings, inputs) {
response.infoLog += "☒File is not video. \n"
response.processFile = false;
return response
}
}
if (inputs.aac_stereo == "" && inputs.downmix == "") {
response.infoLog += "☒Neither aac_stereo or downmix options have been configured within plugin settings, please configure required options. Skipping this plugin. \n"
response.processFile = false
@ -68,22 +68,22 @@ function plugin(file, librarySettings, inputs) {
if (file.ffProbeData.streams[i].codec_type.toLowerCase() == "audio") {
if (file.ffProbeData.streams[i].channels == "2") {
has2Channel = true
}
}
if (file.ffProbeData.streams[i].channels == "6") {
has6Channel = true
}
}
if (file.ffProbeData.streams[i].channels == "8") {
has8Channel = true
}
}
}
} catch (err) { }
}
for (var i = 0; i < file.ffProbeData.streams.length; i++) {
if (file.ffProbeData.streams[i].codec_type.toLowerCase() == "audio") {
if (inputs.downmix.toLowerCase() == "true") {
if (has8Channel == true && has6Channel == false && file.ffProbeData.streams[i].channels == "8") {
ffmpegCommandInsert += `-map 0:${i} -c:a:${audioIdx} ac3 -ac 6 -metadata:s:a:${audioIdx} title="5.1 " `
ffmpegCommandInsert += `-map 0:${i} -c:a:${audioIdx} ac3 -ac 6 -metadata:s:a:${audioIdx} title="5.1 " `
response.infoLog += "☒Audio track is 8 channel, no 6 channel exists. Creating 2 channel from 6 channel. \n"
convert = true
}
@ -102,19 +102,19 @@ function plugin(file, librarySettings, inputs) {
}
audioIdx++
}
}
if (convert == true) {
response.processFile = true;
response.preset = `, -map 0 -c:v copy -c:a copy ${ffmpegCommandInsert} -strict -2 -c:s copy `
response.preset = `, -map 0 -c:v copy -c:a copy ${ffmpegCommandInsert} -strict -2 -c:s copy -max_muxing_queue_size 4096 `
} else {
response.infoLog += "☑File contains all required audio formats. \n"
response.processFile = false;
}
return response
}
module.exports.details = details;
module.exports.plugin = plugin;
module.exports.plugin = plugin;

@ -40,7 +40,7 @@ function plugin(file) {
}
videoIdx++
}
if (file.ffProbeData.streams[i].codec_type.toLowerCase() == "audio") {
if (subtitleIdx != "0") {
convert = true
@ -66,13 +66,13 @@ function plugin(file) {
response.infoLog += "☒ Audio 8ch not last. \n"
}
}
if (file.ffProbeData.streams[i].codec_type.toLowerCase() == "subtitle") {
subtitleIdx++
}
} catch (err) { }
}
for (var i = 0; i < file.ffProbeData.streams.length; i++) {
try {
if (file.ffProbeData.streams[i].codec_type.toLowerCase() == "video" && file.ffProbeData.streams[i].codec_name.toLowerCase() != "mjpeg") {
@ -80,7 +80,7 @@ function plugin(file) {
}
} catch (err) { }
}
for (var i = 0; i < file.ffProbeData.streams.length; i++) {
try {
if (file.ffProbeData.streams[i].codec_type.toLowerCase() == "audio" && file.ffProbeData.streams[i].channels == "2") {
@ -88,7 +88,7 @@ function plugin(file) {
}
} catch (err) { }
}
for (var i = 0; i < file.ffProbeData.streams.length; i++) {
try {
if (file.ffProbeData.streams[i].codec_type.toLowerCase() == "audio" && file.ffProbeData.streams[i].channels == "6") {
@ -96,7 +96,7 @@ function plugin(file) {
}
} catch (err) { }
}
for (var i = 0; i < file.ffProbeData.streams.length; i++) {
try {
if (file.ffProbeData.streams[i].codec_type.toLowerCase() == "audio" && file.ffProbeData.streams[i].channels == "8") {
@ -104,7 +104,7 @@ function plugin(file) {
}
} catch (err) { }
}
for (var i = 0; i < file.ffProbeData.streams.length; i++) {
try {
if (file.ffProbeData.streams[i].codec_type.toLowerCase() == "audio" && file.ffProbeData.streams[i].channels != "2" && file.ffProbeData.streams[i].channels != "6" && file.ffProbeData.streams[i].channels != "8") {
@ -112,7 +112,7 @@ function plugin(file) {
}
} catch (err) { }
}
for (var i = 0; i < file.ffProbeData.streams.length; i++) {
try {
if (file.ffProbeData.streams[i].codec_type.toLowerCase() == "subtitle") {
@ -123,7 +123,7 @@ function plugin(file) {
if (convert == true) {
response.processFile = true;
response.preset = `,${ffmpegCommandInsert} -c copy`
response.preset = `,${ffmpegCommandInsert} -c copy -max_muxing_queue_size 4096`
response.reQueueAfter = true;
response.infoLog += "☒ Streams are out of order, reorganizing streams. Video, Audio, Subtitles. \n"
} else {
@ -131,7 +131,7 @@ function plugin(file) {
response.processFile = false;
}
return response
}
module.exports.details = details;
module.exports.plugin = plugin;
module.exports.plugin = plugin;

Loading…
Cancel
Save