mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-09 07:29:04 -07:00
options to use original container
This commit is contained in:
parent
d6922ec703
commit
0abbfb9186
4 changed files with 82 additions and 6 deletions
|
|
@ -19,14 +19,17 @@ const details = () => ({
|
|||
inputUI: {
|
||||
type: 'text',
|
||||
},
|
||||
tooltip: `Specify output container of file
|
||||
tooltip: `Specify output container of file. Use 'original' wihout qoutes to keep original container.
|
||||
\\n Ensure that all stream types you may have are supported by your chosen container.
|
||||
\\n mkv is recommended.
|
||||
\\nExample:\\n
|
||||
mkv
|
||||
|
||||
\\nExample:\\n
|
||||
mp4`,
|
||||
mp4
|
||||
|
||||
\\nExample:\\n
|
||||
original`,
|
||||
},
|
||||
{
|
||||
name: 'bitrate_cutoff',
|
||||
|
|
@ -128,7 +131,14 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
|
|||
response.processFile = false;
|
||||
return response;
|
||||
}
|
||||
response.container = `.${inputs.container}`;
|
||||
|
||||
if (inputs.container === 'original') {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
inputs.container = `${file.container}`;
|
||||
response.container = `.${file.container}`;
|
||||
} else {
|
||||
response.container = `.${inputs.container}`;
|
||||
}
|
||||
|
||||
// Check if file is a video. If it isn't then exit plugin.
|
||||
if (file.fileMedium !== 'video') {
|
||||
|
|
|
|||
|
|
@ -18,14 +18,17 @@ const details = () => ({
|
|||
inputUI: {
|
||||
type: 'text',
|
||||
},
|
||||
tooltip: `Specify output container of file.
|
||||
tooltip: `Specify output container of file. Use 'original' wihout qoutes to keep original container.
|
||||
\\n Ensure that all stream types you may have are supported by your chosen container.
|
||||
\\n mkv is recommended.
|
||||
\\nExample:\\n
|
||||
mkv
|
||||
|
||||
\\nExample:\\n
|
||||
mp4`,
|
||||
mp4
|
||||
|
||||
\\nExample:\\n
|
||||
original`,
|
||||
},
|
||||
{
|
||||
name: 'bitrate_cutoff',
|
||||
|
|
@ -107,7 +110,14 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
|
|||
response.processFile = false;
|
||||
return response;
|
||||
}
|
||||
response.container = `.${inputs.container}`;
|
||||
|
||||
if (inputs.container === 'original') {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
inputs.container = `${file.container}`;
|
||||
response.container = `.${file.container}`;
|
||||
} else {
|
||||
response.container = `.${inputs.container}`;
|
||||
}
|
||||
|
||||
// Check if file is a video. If it isn't then exit plugin.
|
||||
if (file.fileMedium !== 'video') {
|
||||
|
|
|
|||
|
|
@ -120,6 +120,34 @@ const tests = [
|
|||
container: '.mp4',
|
||||
},
|
||||
},
|
||||
{
|
||||
input: {
|
||||
file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')),
|
||||
librarySettings: {},
|
||||
inputs: {
|
||||
container: 'original',
|
||||
enable_10bit: 'true',
|
||||
force_conform: 'true',
|
||||
bitrate_cutoff: '1000',
|
||||
},
|
||||
otherArguments: {},
|
||||
},
|
||||
output: {
|
||||
processFile: true,
|
||||
preset: '-c:v h264_cuvid, -map 0 -c:v hevc_nvenc -cq:v 19 -b:v 3933k -minrate 2753k -maxrate 5112k -bufsize 7866k -spatial_aq:v 1 -rc-lookahead:v 32 -c:a copy -c:s copy -max_muxing_queue_size 9999 -map -0:d -pix_fmt p010le ',
|
||||
handBrakeMode: false,
|
||||
FFmpegMode: true,
|
||||
reQueueAfter: true,
|
||||
infoLog: 'Container for output selected as mkv. \n'
|
||||
+ 'Current bitrate = 7866 \n'
|
||||
+ 'Bitrate settings: \n'
|
||||
+ 'Target = 3933 \n'
|
||||
+ 'Minimum = 2753 \n'
|
||||
+ 'Maximum = 5112 \n'
|
||||
+ 'File is not hevc or vp9. Transcoding. \n',
|
||||
container: '.mkv',
|
||||
},
|
||||
},
|
||||
{
|
||||
input: {
|
||||
file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')),
|
||||
|
|
|
|||
|
|
@ -120,6 +120,34 @@ const tests = [
|
|||
container: '.mp4',
|
||||
},
|
||||
},
|
||||
{
|
||||
input: {
|
||||
file: _.cloneDeep(require('../sampleData/media/sampleH264_2.json')),
|
||||
librarySettings: {},
|
||||
inputs: {
|
||||
container: 'original',
|
||||
enable_10bit: 'true',
|
||||
force_conform: 'true',
|
||||
bitrate_cutoff: '1000',
|
||||
},
|
||||
otherArguments: {},
|
||||
},
|
||||
output: {
|
||||
processFile: true,
|
||||
preset: ',-map 0 -c:v libx265 -b:v 3933k -minrate 2753k -maxrate 5112k -bufsize 7866k -c:a copy -c:s copy -max_muxing_queue_size 9999 -map -0:d -pix_fmt p010le ',
|
||||
handBrakeMode: false,
|
||||
FFmpegMode: true,
|
||||
reQueueAfter: true,
|
||||
infoLog: 'Container for output selected as mkv. \n'
|
||||
+ 'Current bitrate = 7866 \n'
|
||||
+ 'Bitrate settings: \n'
|
||||
+ 'Target = 3933 \n'
|
||||
+ 'Minimum = 2753 \n'
|
||||
+ 'Maximum = 5112 \n'
|
||||
+ 'File is not hevc or vp9. Transcoding. \n',
|
||||
container: '.mkv',
|
||||
},
|
||||
},
|
||||
{
|
||||
input: {
|
||||
file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue