Merge pull request #393 from HaveAGitGat/original_container

options to use original container
This commit is contained in:
HaveAGitGat 2023-03-17 09:55:52 +01:00 committed by GitHub
commit ae6968cb40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 82 additions and 6 deletions

View file

@ -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') {

View file

@ -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') {

View file

@ -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')),

View file

@ -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')),