From 362de5938b9ba9513f2b76b9a6d2f88a07bd29de Mon Sep 17 00:00:00 2001 From: James Date: Fri, 24 Jan 2020 21:25:43 +0000 Subject: [PATCH] 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; +