mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-13 09:20:27 -07:00
commit
c0a62ac3c8
2 changed files with 16 additions and 4 deletions
|
|
@ -6,7 +6,7 @@ function details() {
|
||||||
Type: "Video",
|
Type: "Video",
|
||||||
Operation:"Transcode",
|
Operation:"Transcode",
|
||||||
Description: `Files will be transcoded using Nvidia GPU with ffmpeg, settings are dependant on file bitrate, working by the logic that H265 can support the same ammount of data at half the bitrate of H264. NVDEC & NVENC compatable GPU required. \n\n`,
|
Description: `Files will be transcoded using Nvidia GPU with ffmpeg, settings are dependant on file bitrate, working by the logic that H265 can support the same ammount of data at half the bitrate of H264. NVDEC & NVENC compatable GPU required. \n\n`,
|
||||||
Version: "2.10",
|
Version: "2.20",
|
||||||
Link: "https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js",
|
Link: "https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js",
|
||||||
Tags:'pre-processing,ffmpeg,video only,nvenc h265,configurable',
|
Tags:'pre-processing,ffmpeg,video only,nvenc h265,configurable',
|
||||||
Inputs: [
|
Inputs: [
|
||||||
|
|
@ -55,7 +55,7 @@ function plugin(file, librarySettings, inputs) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inputs.container == "mkv") {
|
if (inputs.container == "mkv") {
|
||||||
extraArguments = "-map -0:d "
|
extraArguments += "-map -0:d "
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file.fileMedium !== "video") {
|
if (file.fileMedium !== "video") {
|
||||||
|
|
@ -70,6 +70,8 @@ function plugin(file, librarySettings, inputs) {
|
||||||
var duration = (file.ffProbeData.streams[0].duration * 0.0166667)
|
var duration = (file.ffProbeData.streams[0].duration * 0.0166667)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var videoIdx = 0
|
||||||
|
var extraArguments = ""
|
||||||
var bitrateSettings = ""
|
var bitrateSettings = ""
|
||||||
var filesize = (file.file_size / 1000)
|
var filesize = (file.file_size / 1000)
|
||||||
var currentBitrate = ~~(file.file_size / (duration * 0.0075))
|
var currentBitrate = ~~(file.file_size / (duration * 0.0075))
|
||||||
|
|
@ -100,6 +102,9 @@ function plugin(file, librarySettings, inputs) {
|
||||||
}
|
}
|
||||||
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() == "video") {
|
if (file.ffProbeData.streams[i].codec_type.toLowerCase() == "video") {
|
||||||
|
if (file.ffProbeData.streams[i].codec_name == 'mjpeg') {
|
||||||
|
extraArguments += `-map -v:${videoIdx} `
|
||||||
|
}
|
||||||
if (file.ffProbeData.streams[i].codec_name == 'hevc' && file.container == inputs.container) {
|
if (file.ffProbeData.streams[i].codec_name == 'hevc' && file.container == inputs.container) {
|
||||||
response.processFile = false
|
response.processFile = false
|
||||||
response.infoLog += `☑File is already in ${inputs.container} & hevc. \n`
|
response.infoLog += `☑File is already in ${inputs.container} & hevc. \n`
|
||||||
|
|
@ -111,6 +116,7 @@ function plugin(file, librarySettings, inputs) {
|
||||||
response.processFile = true;
|
response.processFile = true;
|
||||||
return response
|
return response
|
||||||
}
|
}
|
||||||
|
videoIdx++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ function details() {
|
||||||
Type: "Video",
|
Type: "Video",
|
||||||
Operation:"Transcode",
|
Operation:"Transcode",
|
||||||
Description: `Files will be transcoded using CPU with ffmpeg, settings are dependant on file bitrate, working by the logic that H265 can support the same ammount of data at half the bitrate of H264. \n\n`,
|
Description: `Files will be transcoded using CPU with ffmpeg, settings are dependant on file bitrate, working by the logic that H265 can support the same ammount of data at half the bitrate of H264. \n\n`,
|
||||||
Version: "1.0",
|
Version: "1.1",
|
||||||
Link: "https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js",
|
Link: "https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js",
|
||||||
Tags:'pre-processing,ffmpeg,video only,configurable,h265',
|
Tags:'pre-processing,ffmpeg,video only,configurable,h265',
|
||||||
Inputs: [
|
Inputs: [
|
||||||
|
|
@ -55,7 +55,7 @@ function plugin(file, librarySettings, inputs) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inputs.container == "mkv") {
|
if (inputs.container == "mkv") {
|
||||||
extraArguments = "-map -0:d "
|
extraArguments += "-map -0:d "
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file.fileMedium !== "video") {
|
if (file.fileMedium !== "video") {
|
||||||
|
|
@ -70,6 +70,8 @@ function plugin(file, librarySettings, inputs) {
|
||||||
var duration = (file.ffProbeData.streams[0].duration * 0.0166667)
|
var duration = (file.ffProbeData.streams[0].duration * 0.0166667)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var videoIdx = 0
|
||||||
|
var extraArguments = ""
|
||||||
var bitrateSettings = ""
|
var bitrateSettings = ""
|
||||||
var filesize = (file.file_size / 1000)
|
var filesize = (file.file_size / 1000)
|
||||||
var currentBitrate = ~~(file.file_size / (duration * 0.0075))
|
var currentBitrate = ~~(file.file_size / (duration * 0.0075))
|
||||||
|
|
@ -99,6 +101,9 @@ function plugin(file, librarySettings, inputs) {
|
||||||
}
|
}
|
||||||
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() == "video") {
|
if (file.ffProbeData.streams[i].codec_type.toLowerCase() == "video") {
|
||||||
|
if (file.ffProbeData.streams[i].codec_name == 'mjpeg') {
|
||||||
|
extraArguments += `-map -v:${videoIdx} `
|
||||||
|
}
|
||||||
if (file.ffProbeData.streams[i].codec_name == 'hevc' && file.container == inputs.container) {
|
if (file.ffProbeData.streams[i].codec_name == 'hevc' && file.container == inputs.container) {
|
||||||
response.processFile = false
|
response.processFile = false
|
||||||
response.infoLog += `☑File is already in ${inputs.container} & hevc. \n`
|
response.infoLog += `☑File is already in ${inputs.container} & hevc. \n`
|
||||||
|
|
@ -110,6 +115,7 @@ function plugin(file, librarySettings, inputs) {
|
||||||
response.processFile = true;
|
response.processFile = true;
|
||||||
return response
|
return response
|
||||||
}
|
}
|
||||||
|
videoIdx++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue