From 90a337263aa7430e5a89c55df9b0ab45d39b233c Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 17:25:48 +0100 Subject: [PATCH] Add Tdarr_Plugin_MC93_Migz1FFMPEG_CPU test --- .../Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js | 1 - .../Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js | 145 ++++++++++++++++++ 2 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js diff --git a/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js b/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js index 0f6c746..a5abfcb 100644 --- a/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js +++ b/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js @@ -1,5 +1,4 @@ /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_MC93_Migz1FFMPEG_CPU', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js b/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js new file mode 100644 index 0000000..6e1afa3 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG_CPU.js @@ -0,0 +1,145 @@ +/* eslint max-len: 0 */ +const _ = require('lodash'); +const run = require('../helpers/run'); + +const tests = [ + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0 -c:v libx265 -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -c:a copy -c:s copy -max_muxing_queue_size 9999 ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Container for output selected as mkv. \n' + + 'Current bitrate = 1517 \n' + + 'Bitrate settings: \n' + + 'Target = 758 \n' + + 'Minimum = 530 \n' + + 'Maximum = 985 \n' + + 'File is not hevc or vp9. Transcoding. \n', + container: '.mkv', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: {}, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'File is already hevc or vp9 & in mkv. \n', + container: '.mkv', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + container: 'mp4', + enable_10bit: 'true', + force_conform: 'true', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0 -c:v libx265 -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -c:a copy -c:s copy -max_muxing_queue_size 9999 -pix_fmt p010le ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Container for output selected as mp4. \n' + + 'Current bitrate = 1517 \n' + + 'Bitrate settings: \n' + + 'Target = 758 \n' + + 'Minimum = 530 \n' + + 'Maximum = 985 \n' + + 'File is not hevc or vp9. Transcoding. \n', + container: '.mp4', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + container: 'mp4', + enable_10bit: 'true', + force_conform: 'true', + bitrate_cutoff: '10000', + }, + otherArguments: {}, + }, + output: { + processFile: false, + preset: '', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Current bitrate is below set bitrate cutoff of 10000. Nothing to do, cancelling plugin. \n', + container: '.mp4', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH264_1.json')), + librarySettings: {}, + inputs: { + container: 'mp4', + enable_10bit: 'true', + force_conform: 'true', + bitrate_cutoff: '1000', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ',-map 0 -c:v libx265 -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -c:a copy -c:s copy -max_muxing_queue_size 9999 -pix_fmt p010le ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'Container for output selected as mp4. \n' + + 'Current bitrate = 1517 \n' + + 'Bitrate settings: \n' + + 'Target = 758 \n' + + 'Minimum = 530 \n' + + 'Maximum = 985 \n' + + 'File is not hevc or vp9. Transcoding. \n', + container: '.mp4', + }, + }, + { + input: { + file: _.cloneDeep(require('../sampleData/media/sampleH265_1.json')), + librarySettings: {}, + inputs: { + container: 'mp4', + force_conform: 'false', + }, + otherArguments: {}, + }, + output: { + processFile: true, + preset: ', -map 0 -c copy ', + handBrakeMode: false, + FFmpegMode: true, + reQueueAfter: true, + infoLog: 'File is hevc or vp9 but is not in mp4 container. Remuxing. \n', + container: '.mp4', + }, + }, +]; + +run(tests);