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; + 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; + 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 2d35279..68bd332 100644 --- a/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js +++ b/Community/Tdarr_Plugin_b38x_Nosirus_h265_aac_no_meta.js @@ -8,7 +8,7 @@ function details() { Stage: "Pre-processing", 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" diff --git a/Community/Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js b/Community/Tdarr_Plugin_e5c3_CnT_Add_Subtitles.js index dd3d0d9..8b7a619 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 { @@ -15,6 +14,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 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 8517050..3f8dc5c 100644 --- a/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js +++ b/Community/Tdarr_Plugin_z0ab_TheRealShadoh_FFmpeg_Subs_H264_Medium.js @@ -8,7 +8,7 @@ function details() { Stage: "Pre-processing", 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" @@ -54,11 +54,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) { } } @@ -123,7 +121,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")){ @@ -141,15 +139,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" 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 c7e2db0..b6699a6 100644 --- a/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js +++ b/Community/Tdarr_Plugin_z1ab_TheRealShadoh_FFmpeg_Subs_H264_Fast.js @@ -8,7 +8,7 @@ function details() { Stage: "Pre-processing", 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" @@ -54,12 +54,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")){ @@ -139,16 +137,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 72026c7..ea1126a 100644 --- a/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js +++ b/Community/Tdarr_Plugin_z2ab_TheRealShadoh_FFmpeg_Subs_H264_Slow.js @@ -8,7 +8,7 @@ function details() { Stage: "Pre-processing", 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" @@ -54,12 +54,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) { } } @@ -123,7 +121,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")){ @@ -141,15 +139,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 d1592de..58cd52f 100644 --- a/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js +++ b/Community/Tdarr_Plugin_z3ab_TheRealShadoh_FFmpeg_Subs_H264_VeryFast.js @@ -8,7 +8,7 @@ function details() { Stage: "Pre-processing", 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" @@ -54,12 +54,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) { } } @@ -123,7 +121,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")){ @@ -141,7 +139,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; @@ -149,7 +147,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"