Update plugin

This commit is contained in:
HaveAGitGat 2022-08-28 03:52:59 +01:00
parent 16afcf09bf
commit 3dc2d1a322
4 changed files with 342 additions and 114 deletions

View file

@ -1,58 +0,0 @@
/* eslint max-len: 0 */
const _ = require('lodash');
const run = require('../helpers/run');
const tests = [
{
input: {
file: require('../sampleData/media/sampleH264_1.json'),
librarySettings: {},
inputs: {},
otherArguments: {},
},
output: {
processFile: true,
infoLog: 'File will be processed.File is not 10 bit.',
},
},
{
input: {
file: (() => {
const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json'));
file.ffProbeData.streams[0].profile = 'Main 10';
return file;
})(),
librarySettings: {},
inputs: {
process10BitVideo: false,
},
otherArguments: {},
},
output: {
processFile: false,
infoLog: 'File video is 10 bit but 10 bit video processing is not allowed. Skipping plugins.',
},
},
{
input: {
file: (() => {
const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json'));
file.ffProbeData.streams[0].profile = 'Main 10';
return file;
})(),
librarySettings: {},
inputs: {
process10BitVideo: true,
},
otherArguments: {},
},
output: {
processFile: true,
infoLog: 'File video is 10 bit and 10 bit video processing is allowed. Continuing to plugins',
},
},
];
run(tests);

View file

@ -0,0 +1,242 @@
/* eslint max-len: 0 */
const _ = require('lodash');
const run = require('../helpers/run');
const tests = [
{
input: {
file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')),
librarySettings: {},
inputs: {},
otherArguments: {},
},
output: {
processFile: true, infoLog: 'File video is 8 bit. 8 bit is allowed, will process.',
},
},
{
input: {
file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')),
librarySettings: {},
inputs: {
process8BitVideo: false,
process10BitVideo: false,
process12BitVideo: false,
},
otherArguments: {},
},
output: {
processFile: false,
infoLog: 'File video is 8 bit. 8 bit is not allowed, will not process.',
},
},
{
input: {
file: (() => {
const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json'));
file.ffProbeData.streams[0].profile = '';
file.ffProbeData.streams[0].bits_per_raw_sample = '8';
return file;
})(),
librarySettings: {},
inputs: {
process8BitVideo: false,
process10BitVideo: false,
process12BitVideo: false,
},
otherArguments: {},
},
output: {
processFile: false,
infoLog: 'File video is 8 bit. 8 bit is not allowed, will not process.',
},
},
{
input: {
file: (() => {
const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json'));
file.ffProbeData.streams[0].profile = '';
file.ffProbeData.streams[0].bits_per_raw_sample = '8';
return file;
})(),
librarySettings: {},
inputs: {
process8BitVideo: true,
process10BitVideo: false,
process12BitVideo: false,
},
otherArguments: {},
},
output: {
processFile: true,
infoLog: 'File video is 8 bit. 8 bit is allowed, will process.',
},
},
{
input: {
file: (() => {
const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json'));
file.ffProbeData.streams[0].profile = 'Main 10';
return file;
})(),
librarySettings: {},
inputs: {
process8BitVideo: false,
process10BitVideo: false,
process12BitVideo: false,
},
otherArguments: {},
},
output: {
processFile: false,
infoLog: 'File video is 10 bit. 10 bit is not allowed, will not process.',
},
},
{
input: {
file: (() => {
const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json'));
file.ffProbeData.streams[0].profile = 'Main 10';
return file;
})(),
librarySettings: {},
inputs: {
process8BitVideo: false,
process10BitVideo: true,
process12BitVideo: false,
},
otherArguments: {},
},
output: {
processFile: true,
infoLog: 'File video is 10 bit. 10 bit is allowed, will process.',
},
},
{
input: {
file: (() => {
const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json'));
file.ffProbeData.streams[0].profile = '';
file.ffProbeData.streams[0].bits_per_raw_sample = '10';
return file;
})(),
librarySettings: {},
inputs: {
process8BitVideo: false,
process10BitVideo: false,
process12BitVideo: false,
},
otherArguments: {},
},
output: {
processFile: false,
infoLog: 'File video is 10 bit. 10 bit is not allowed, will not process.',
},
},
{
input: {
file: (() => {
const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json'));
file.ffProbeData.streams[0].profile = '';
file.ffProbeData.streams[0].bits_per_raw_sample = '10';
return file;
})(),
librarySettings: {},
inputs: {
process8BitVideo: false,
process10BitVideo: true,
process12BitVideo: false,
},
otherArguments: {},
},
output: {
processFile: true,
infoLog: 'File video is 10 bit. 10 bit is allowed, will process.',
},
},
//
{
input: {
file: (() => {
const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json'));
file.ffProbeData.streams[0].profile = 'Main 12';
return file;
})(),
librarySettings: {},
inputs: {
process8BitVideo: false,
process10BitVideo: false,
process12BitVideo: false,
},
otherArguments: {},
},
output: {
processFile: false,
infoLog: 'File video is 12 bit. 12 bit is not allowed, will not process.',
},
},
{
input: {
file: (() => {
const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json'));
file.ffProbeData.streams[0].profile = 'Main 12';
return file;
})(),
librarySettings: {},
inputs: {
process8BitVideo: false,
process10BitVideo: false,
process12BitVideo: true,
},
otherArguments: {},
},
output: {
processFile: true,
infoLog: 'File video is 12 bit. 12 bit is allowed, will process.',
},
},
{
input: {
file: (() => {
const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json'));
file.ffProbeData.streams[0].profile = '';
file.ffProbeData.streams[0].bits_per_raw_sample = '12';
return file;
})(),
librarySettings: {},
inputs: {
process8BitVideo: false,
process10BitVideo: false,
process12BitVideo: false,
},
otherArguments: {},
},
output: {
processFile: false,
infoLog: 'File video is 12 bit. 12 bit is not allowed, will not process.',
},
},
{
input: {
file: (() => {
const file = _.cloneDeep(require('../sampleData/media/sampleH265_1.json'));
file.ffProbeData.streams[0].profile = '';
file.ffProbeData.streams[0].bits_per_raw_sample = '12';
return file;
})(),
librarySettings: {},
inputs: {
process8BitVideo: false,
process10BitVideo: false,
process12BitVideo: true,
},
otherArguments: {},
},
output: {
processFile: true,
infoLog: 'File video is 12 bit. 12 bit is allowed, will process.',
},
},
];
run(tests);