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++ videoIdx++
} }
if (file.ffProbeData.streams[i].codec_type.toLowerCase() == "audio" && inputs.clean_audio.toLowerCase() == "true") { 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) { 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` 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++ audioIdx++
} }
if (file.ffProbeData.streams[i].codec_type.toLowerCase() == "subtitle" && inputs.clean_subtitles.toLowerCase() == "true") { 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) { 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` 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) { if (convert == true) {
response.infoLog += "☒File has title metadata. Removing \n" 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.reQueueAfter = true;
response.processFile = true; response.processFile = true;
} else { } 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 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 \\nExample:\\n
eng eng
\\nExample:\\n \\nExample:\\n
eng,und eng,und
\\nExample:\\n \\nExample:\\n
eng,und,jap` eng,und,jap`
}, },
@ -27,7 +27,7 @@ function details() {
tooltip: `Specify if audio tracks that contain commentary/description should be removed. tooltip: `Specify if audio tracks that contain commentary/description should be removed.
\\nExample:\\n \\nExample:\\n
true true
\\nExample:\\n \\nExample:\\n
false` 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 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 \\nExample:\\n
eng eng
\\nExample:\\n \\nExample:\\n
por 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. 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 \\nExample:\\n
true true
\\nExample:\\n \\nExample:\\n
false` false`
}, },
@ -70,14 +70,14 @@ function plugin(file, librarySettings, inputs) {
response.infoLog += "☒File is not video \n" response.infoLog += "☒File is not video \n"
response.processFile = false; response.processFile = false;
return response return response
} }
if (inputs.language == "") { if (inputs.language == "") {
response.infoLog += "☒Language/s keep have not been configured within plugin settings, please configure required options. Skipping this plugin. \n" response.infoLog += "☒Language/s keep have not been configured within plugin settings, please configure required options. Skipping this plugin. \n"
response.processFile = false; response.processFile = false;
return response return response
} }
var language = inputs.language.split(",") var language = inputs.language.split(",")
var ffmpegCommandInsert = '' var ffmpegCommandInsert = ''
var convert = false var convert = false
@ -106,7 +106,7 @@ function plugin(file, librarySettings, inputs) {
try { 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'))) { 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} ` 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` 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 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` response.infoLog += `☒Audio stream detected as having unknown language tagged, tagging as ${inputs.tag_language}. \n`
convert = true convert = true
} }
if (typeof file.ffProbeData.streams[i].tags.language === 'undefined' && file.ffProbeData.streams[i].codec_type.toLowerCase() == "audio") { 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} ` 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` 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) { } } catch (err) { }
} }
if (audioStreamsRemoved == audioStreamCount) { if (audioStreamsRemoved == audioStreamCount) {
@ -159,7 +159,7 @@ function plugin(file, librarySettings, inputs) {
if (convert === true && (audioStreamsRemoved != audioStreamCount)) { if (convert === true && (audioStreamsRemoved != audioStreamCount)) {
response.processFile = 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.container = '.' + file.container
response.reQueueAfter = true response.reQueueAfter = true
} else { } 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 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 \\nExample:\\n
eng eng
\\nExample:\\n \\nExample:\\n
eng,jap` eng,jap`
}, },
@ -24,7 +24,7 @@ function details() {
tooltip: `Specify if subtitle tracks that contain commentary/description should be removed. tooltip: `Specify if subtitle tracks that contain commentary/description should be removed.
\\nExample:\\n \\nExample:\\n
true true
\\nExample:\\n \\nExample:\\n
false` 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 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 \\nExample:\\n
eng eng
\\nExample:\\n \\nExample:\\n
por` por`
}, },
@ -58,13 +58,13 @@ function plugin(file, librarySettings, inputs) {
response.processFile = false; response.processFile = false;
return response return response
} }
if (inputs.language == "") { if (inputs.language == "") {
response.infoLog += "☒Language/s keep have not been configured within plugin settings, please configure required options. Skipping this plugin. \n" response.infoLog += "☒Language/s keep have not been configured within plugin settings, please configure required options. Skipping this plugin. \n"
response.processFile = false; response.processFile = false;
return response return response
} }
var language = inputs.language.split(",") var language = inputs.language.split(",")
var ffmpegCommandInsert = '' var ffmpegCommandInsert = ''
var subtitleIdx = -1 var subtitleIdx = -1
@ -84,7 +84,7 @@ function plugin(file, librarySettings, inputs) {
convert = true convert = true
} }
} catch (err) { } } catch (err) { }
try { 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'))) { 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} ` ffmpegCommandInsert += `-map -0:s:${subtitleIdx} `
@ -102,7 +102,7 @@ function plugin(file, librarySettings, inputs) {
} }
} }
} catch (err) { } } catch (err) { }
try { try {
if (typeof file.ffProbeData.streams[i].tags.language == 'undefined' && file.ffProbeData.streams[i].codec_type.toLowerCase() == "subtitle") { 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} ` ffmpegCommandInsert += `-metadata:s:s:${subtitleIdx} language=${inputs.tag_title} `
@ -113,7 +113,7 @@ function plugin(file, librarySettings, inputs) {
} }
if (convert === true ) { if (convert === true ) {
response.processFile = 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.container = '.' + file.container
response.reQueueAfter = true; response.reQueueAfter = true;
} else { } 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. tooltip: `Specify if any 2.0 audio tracks should be converted to aac for maximum compatability with devices.
\\nExample:\\n \\nExample:\\n
true true
\\nExample:\\n \\nExample:\\n
false` 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. 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 \\nExample:\\n
true true
\\nExample:\\n \\nExample:\\n
false` false`
}, },
@ -48,8 +48,8 @@ function plugin(file, librarySettings, inputs) {
response.infoLog += "☒File is not video. \n" response.infoLog += "☒File is not video. \n"
response.processFile = false; response.processFile = false;
return response return response
} }
if (inputs.aac_stereo == "" && inputs.downmix == "") { 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.infoLog += "☒Neither aac_stereo or downmix options have been configured within plugin settings, please configure required options. Skipping this plugin. \n"
response.processFile = false 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].codec_type.toLowerCase() == "audio") {
if (file.ffProbeData.streams[i].channels == "2") { if (file.ffProbeData.streams[i].channels == "2") {
has2Channel = true has2Channel = true
} }
if (file.ffProbeData.streams[i].channels == "6") { if (file.ffProbeData.streams[i].channels == "6") {
has6Channel = true has6Channel = true
} }
if (file.ffProbeData.streams[i].channels == "8") { if (file.ffProbeData.streams[i].channels == "8") {
has8Channel = true has8Channel = true
} }
} }
} catch (err) { } } catch (err) { }
} }
for (var i = 0; i < file.ffProbeData.streams.length; i++) { for (var i = 0; i < file.ffProbeData.streams.length; i++) {
if (file.ffProbeData.streams[i].codec_type.toLowerCase() == "audio") { if (file.ffProbeData.streams[i].codec_type.toLowerCase() == "audio") {
if (inputs.downmix.toLowerCase() == "true") { if (inputs.downmix.toLowerCase() == "true") {
if (has8Channel == true && has6Channel == false && file.ffProbeData.streams[i].channels == "8") { 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" response.infoLog += "☒Audio track is 8 channel, no 6 channel exists. Creating 2 channel from 6 channel. \n"
convert = true convert = true
} }
@ -102,19 +102,19 @@ function plugin(file, librarySettings, inputs) {
} }
audioIdx++ audioIdx++
} }
} }
if (convert == true) { if (convert == true) {
response.processFile = 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 { } else {
response.infoLog += "☑File contains all required audio formats. \n" response.infoLog += "☑File contains all required audio formats. \n"
response.processFile = false; response.processFile = false;
} }
return response return response
} }
module.exports.details = details; module.exports.details = details;
module.exports.plugin = plugin; module.exports.plugin = plugin;

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

Loading…
Cancel
Save