From 362de5938b9ba9513f2b76b9a6d2f88a07bd29de Mon Sep 17 00:00:00 2001 From: James Date: Fri, 24 Jan 2020 21:25:43 +0000 Subject: [PATCH 01/11] Create Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js An extension of 075b to use a CRF value of 20 for better quality transcodes. --- ...PEG_HEVC_Generic_Video_Audio_Only_CRF20.js | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js diff --git a/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js b/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js new file mode 100644 index 0000000..26d79e5 --- /dev/null +++ b/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js @@ -0,0 +1,68 @@ + + + +function details() { + + return { + id: "Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20", + Name: "FFMPEG H265 Video + Audio Kept Only With CRF 20", + Type: "Video", + Operation:"Transcode", + Description: `[Contains built-in filter] This plugin transcodes non h265 files into h265 mkv using default settings. Only video and audio streams are kept. Useful for if you're getting errors because of certain containers not being able to handle certain subtitle/data streams. A CRF value of 20 is used. \n\n`, + Version: "1.00", + Link: "https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_075c_FFMPEG_HEVC_Generic_Video_Audio_Only_CRF20.js" + } + +} + +function plugin(file) { + + + //Must return this object + + var response = { + + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '', + + } + + if (file.fileMedium !== "video") { + response.processFile = false + response.infoLog += "☒File is not a video! \n" + return response + } else { + response.infoLog += "☑File is a video! \n" + } + + + if (file.ffProbeData.streams[0].codec_name == 'hevc') { + response.processFile = false + response.infoLog += "☑File is already in hevc! \n" + return response + } + + + + response.processFile = true; + response.preset = `,-map 0:v -map 0:a -c copy -c:v:0 libx265 -crf 20` + response.container = '.mkv' + response.handBrakeMode = false + response.FFmpegMode = true + response.reQueueAfter = true; + response.infoLog += `☒File is not hevc! \n` + return response + + + +} + +module.exports.details = details; + +module.exports.plugin = plugin; + From 3e5cc78d2d986272ab2292ebbcaa444bd9891857 Mon Sep 17 00:00:00 2001 From: James Date: Sat, 25 Jan 2020 11:48:27 +0000 Subject: [PATCH 02/11] Create Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js GPU transcoding with FFMPEG and a CRF value of 20. --- ...HEVC_GPU_Generic_Video_Audio_Only_CRF20.js | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js diff --git a/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js b/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js new file mode 100644 index 0000000..7b34fa4 --- /dev/null +++ b/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js @@ -0,0 +1,68 @@ + + + +function details() { + + return { + id: "Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20", + Name: "FFMPEG H265 Video + Audio Kept Only With CRF 20 On The GPU", + Type: "Video", + Operation:"Transcode", + Description: `[Contains built-in filter] This plugin transcodes non h265 files into h265 mkv using the graphics card and a CRF value of 20. Only video and audio streams are kept. Useful for if you're getting errors because of certain containers not being able to handle certain subtitle/data streams. A CRF value of 20 is used. The GPU (graphics card) is used. \n\n`, + Version: "1.00", + Link: "https://github.com/moodiest/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_075d_FFMPEG_HEVC_GPU_Generic_Video_Audio_Only_CRF20.js" + } + +} + +function plugin(file) { + + + //Must return this object + + var response = { + + processFile: false, + preset: '', + container: '.mp4', + handBrakeMode: false, + FFmpegMode: false, + reQueueAfter: false, + infoLog: '', + + } + + if (file.fileMedium !== "video") { + response.processFile = false + response.infoLog += "☒File is not a video! \n" + return response + } else { + response.infoLog += "☑File is a video! \n" + } + + + if (file.ffProbeData.streams[0].codec_name == 'hevc') { + response.processFile = false + response.infoLog += "☑File is already in hevc! \n" + return response + } + + + + response.processFile = true; + response.preset = `,-map 0:v -map 0:a -c copy -c:v:0 hevc_nvenc -crf 20` + response.container = '.mkv' + response.handBrakeMode = false + response.FFmpegMode = true + response.reQueueAfter = true; + response.infoLog += `☒File is not hevc! \n` + return response + + + +} + +module.exports.details = details; + +module.exports.plugin = plugin; + From 6e7f8e5717294f3fd5c3de0bd226ced2e7661656 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Tue, 28 Jan 2020 23:50:59 +0000 Subject: [PATCH 03/11] Update Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js --- ...Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js b/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js index e954cf2..6b4bd0f 100644 --- a/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js +++ b/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js @@ -7,7 +7,7 @@ function details() { id: "Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast", Name: "TheRealShadoh FFmpeg Subs VeryFast, video MP4, audio AAC, keep subs. ", Type: "Video", - Description: `[Contains built-in filter] This plugin transcodes into H264 using FFmpeg's 'VeryFast' preset if the file is not in H264 already. It maintains all subtitles. It removes metadata (if a title exists), and maintains all audio tracks. The output container is MP4. \n\n + Description: `[Bug][Contains built-in filter] This plugin transcodes into H264 using FFmpeg's 'VeryFast' preset if the file is not in H264 already. It maintains all subtitles. It removes metadata (if a title exists), and maintains all audio tracks. The output container is MP4. \n\n `, Version: "1.00", Link: "https://github.com/TheRealShadoh/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_Veryfast.js" From 61746191bc936baa9fe9ad416f35220887ed1c06 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Tue, 28 Jan 2020 23:51:41 +0000 Subject: [PATCH 04/11] Update Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js --- .../Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js b/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js index acb940d..b8ed5a7 100644 --- a/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js +++ b/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js @@ -7,7 +7,7 @@ function details() { id: "Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow", Name: "TheRealShadoh FFmpeg Subs Slow, video MP4, audio AAC, keep subs. ", Type: "Video", - Description: `[Contains built-in filter] This plugin transcodes into H264 using FFmpeg's 'Slow' preset if the file is not in H264 already. It maintains all subtitles. It removes metadata (if a title exists), and maintains all audio tracks. The output container is MP4. \n\n + Description: `[Bug][Contains built-in filter] This plugin transcodes into H264 using FFmpeg's 'Slow' preset if the file is not in H264 already. It maintains all subtitles. It removes metadata (if a title exists), and maintains all audio tracks. The output container is MP4. \n\n `, Version: "1.00", Link: "https://github.com/TheRealShadoh/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js" From 35fa4a1bbe4f1ec802b15d1e0d304801fee47dc0 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Tue, 28 Jan 2020 23:52:18 +0000 Subject: [PATCH 05/11] Update Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js --- .../Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js b/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js index ea42d6c..e79cddb 100644 --- a/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js +++ b/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js @@ -7,7 +7,7 @@ function details() { id: "Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast", Name: "TheRealShadoh FFmpeg Subs Fast, video MP4, audio AAC, keep subs. ", Type: "Video", - Description: `[Contains built-in filter] This plugin transcodes into H264 using FFmpeg's 'Fast' preset if the file is not in H264 already. It maintains all subtitles. It removes metadata (if a title exists), and maintains all audio tracks. The output container is MP4. \n\n + Description: `[Bug][Contains built-in filter] This plugin transcodes into H264 using FFmpeg's 'Fast' preset if the file is not in H264 already. It maintains all subtitles. It removes metadata (if a title exists), and maintains all audio tracks. The output container is MP4. \n\n `, Version: "1.00", Link: "https://github.com/TheRealShadoh/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js" From af5aa9cc269d3bc138fba867f08ca3e10024a843 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Tue, 28 Jan 2020 23:52:47 +0000 Subject: [PATCH 06/11] Update Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js --- .../Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js index 940f154..49a9d0f 100644 --- a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js +++ b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js @@ -7,7 +7,7 @@ function details() { id: "Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium", Name: "TheRealShadoh FFmpeg Subs Medium, video MP4, audio AAC, keep subs. ", Type: "Video", - Description: `[Contains built-in filter] This plugin transcodes into H264 using FFmpeg's 'Medium' preset if the file is not in H264 already. It maintains all subtitles. It removes metadata (if a title exists), and maintains all audio tracks. The output container is MP4. \n\n + Description: `[Bug][Contains built-in filter] This plugin transcodes into H264 using FFmpeg's 'Medium' preset if the file is not in H264 already. It maintains all subtitles. It removes metadata (if a title exists), and maintains all audio tracks. The output container is MP4. \n\n `, Version: "1.00", Link: "https://github.com/TheRealShadoh/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js" From c0278f93a17841c3a87dcfdacd27a6c49810c2e4 Mon Sep 17 00:00:00 2001 From: Jack Dallas <3620144+JackDallas@users.noreply.github.com> Date: Wed, 29 Jan 2020 12:57:51 +0000 Subject: [PATCH 07/11] Add missing return --- .../Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js index 940f154..45239d5 100644 --- a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js +++ b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js @@ -122,7 +122,7 @@ function plugin(file) { response.FFmpegMode = true return response }else{ - response.infoLog += "☑File has no title metadata" + response.infoLog += "☑File has no title metadata \n" } if(!jsonString.includes("aac")){ From 9cd46d89c6da133d4b6d3c809b499aca10ff7028 Mon Sep 17 00:00:00 2001 From: Jack Dallas <3620144+JackDallas@users.noreply.github.com> Date: Wed, 29 Jan 2020 12:58:43 +0000 Subject: [PATCH 08/11] Only convert mp4 incompatible subs --- ...ugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js index 45239d5..0f18705 100644 --- a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js +++ b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js @@ -53,11 +53,9 @@ function plugin(file) { for (var i = 0; i < file.ffProbeData.streams.length; i++) { try { - - if(file.ffProbeData.streams[i].codec_type.toLowerCase() == "subtitle"){ - + let streamData = file.ffProbeData.streams[i]; + if(streamData.codec_type.toLowerCase() == "subtitle" && streamData.codec_name != "mov_text"){ hasSubs = true - } } catch (err) { } } @@ -140,15 +138,14 @@ function plugin(file) { if(hasSubs){ - response.infoLog += "☒File has subs \n" + response.infoLog += "☒File has incompatible subs \n" response.preset = ', -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text' - response.reQueueAfter = true; response.processFile = true; response.FFmpegMode = true return response }else{ - response.infoLog += "☑File has no subs \n" + response.infoLog += "☑File has no/compatible subs \n" } response.infoLog += "☑File meets conditions! \n" From efd9dcaded6975a21dde123faac3540a5645a33a Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Wed, 29 Jan 2020 21:54:44 +0000 Subject: [PATCH 09/11] Update Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js --- Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js b/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js index bd66b85..69048ad 100644 --- a/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js +++ b/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js @@ -7,7 +7,7 @@ function details() { id: "Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta", Name: "Nosirus h265, aac, no meta, subs kept", Type: "Video", - Description: `[Contains built-in filter] 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: `[Contains built-in filter] If the file is not in h265 it will be trancoded into h265 with FFmpeg 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.01", Link: "https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js" From d636c967a24893d532473c185f16dde68549a30c Mon Sep 17 00:00:00 2001 From: Jack Dallas <3620144+JackDallas@users.noreply.github.com> Date: Thu, 30 Jan 2020 11:24:50 +0000 Subject: [PATCH 10/11] Fix remaining TheRealShadoh plugins --- ...1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js | 20 +++++++++---------- ...2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js | 18 ++++++++--------- ...TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js | 16 +++++++-------- 3 files changed, 24 insertions(+), 30 deletions(-) diff --git a/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js b/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js index ea42d6c..c4a2292 100644 --- a/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js +++ b/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js @@ -53,12 +53,10 @@ function plugin(file) { for (var i = 0; i < file.ffProbeData.streams.length; i++) { try { - - if(file.ffProbeData.streams[i].codec_type.toLowerCase() == "subtitle"){ - - hasSubs = true - - } + let streamData = file.ffProbeData.streams[i]; + if(streamData.codec_type.toLowerCase() == "subtitle" && streamData.codec_name != "mov_text"){ + hasSubs = true + } } catch (err) { } } @@ -121,7 +119,7 @@ function plugin(file) { response.FFmpegMode = true return response }else{ - response.infoLog += "☑File has no title metadata" + response.infoLog += "☑File has no title metadata \n" } if(!jsonString.includes("aac")){ @@ -138,16 +136,16 @@ function plugin(file) { } if(hasSubs){ - - response.infoLog += "☒File has subs \n" + + response.infoLog += "☒File has incompatible subs \n" response.preset = ', -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text' response.reQueueAfter = true; response.processFile = true; response.FFmpegMode = true return response - }else{ - response.infoLog += "☑File has no subs \n" + }else{ + response.infoLog += "☑File has no/compatible subs \n" } response.infoLog += "☑File meets conditions! \n" diff --git a/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js b/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js index acb940d..5dba5ec 100644 --- a/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js +++ b/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js @@ -53,12 +53,10 @@ function plugin(file) { for (var i = 0; i < file.ffProbeData.streams.length; i++) { try { - - if(file.ffProbeData.streams[i].codec_type.toLowerCase() == "subtitle"){ - - hasSubs = true - - } + let streamData = file.ffProbeData.streams[i]; + if(streamData.codec_type.toLowerCase() == "subtitle" && streamData.codec_name != "mov_text"){ + hasSubs = true + } } catch (err) { } } @@ -122,7 +120,7 @@ function plugin(file) { response.FFmpegMode = true return response }else{ - response.infoLog += "☑File has no title metadata" + response.infoLog += "☑File has no title metadata \n" } if(!jsonString.includes("aac")){ @@ -140,15 +138,15 @@ function plugin(file) { if(hasSubs){ - response.infoLog += "☒File has subs \n" + response.infoLog += "☒File has incompatible subs \n" response.preset = ', -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text' response.reQueueAfter = true; response.processFile = true; response.FFmpegMode = true return response - }else{ - response.infoLog += "☑File has no subs \n" + }else{ + response.infoLog += "☑File has no/compatible subs \n" } response.infoLog += "☑File meets conditions! \n" diff --git a/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js b/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js index e954cf2..68aed80 100644 --- a/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js +++ b/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js @@ -53,12 +53,10 @@ function plugin(file) { for (var i = 0; i < file.ffProbeData.streams.length; i++) { try { - - if(file.ffProbeData.streams[i].codec_type.toLowerCase() == "subtitle"){ - - hasSubs = true - - } + let streamData = file.ffProbeData.streams[i]; + if(streamData.codec_type.toLowerCase() == "subtitle" && streamData.codec_name != "mov_text"){ + hasSubs = true + } } catch (err) { } } @@ -122,7 +120,7 @@ function plugin(file) { response.FFmpegMode = true return response }else{ - response.infoLog += "☑File has no title metadata" + response.infoLog += "☑File has no title metadata \n" } if(!jsonString.includes("aac")){ @@ -140,7 +138,7 @@ function plugin(file) { if(hasSubs){ - response.infoLog += "☒File has subs \n" + response.infoLog += "☒File has incompatible subs \n" response.preset = ', -map 0:v -map 0:s? -map 0:a -c:v copy -c:a copy -c:s mov_text' response.reQueueAfter = true; response.processFile = true; @@ -148,7 +146,7 @@ function plugin(file) { return response }else{ - response.infoLog += "☑File has no subs \n" + response.infoLog += "☑File has no/compatible subs \n" } response.infoLog += "☑File meets conditions! \n" From 55c35650b889af4d81e49c25d16efbc6e7e5eaad Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 2 Feb 2020 03:59:49 +0000 Subject: [PATCH 11/11] Moved package import location --- Community/Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Community/Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js b/Community/Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js index a81d881..f214467 100644 --- a/Community/Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js +++ b/Community/Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js @@ -1,5 +1,4 @@ const fs = require('fs'); -const iso6392 = require('/home/Tdarr/Documents/node_modules/iso-639-2'); function details() { return { @@ -14,6 +13,9 @@ function details() { } function plugin(file) { + //Additional packages used here so details function above will still work if packages aren't installed + const iso6392 = require('/home/Tdarr/Documents/node_modules/iso-639-2'); + var i = 0; //int for counting lang[position] var sub = 0; //becomes first subtitle stream var lang = iso6392; //languages to check against