From f9ff9671a0a1f6ab2270dda0869e7ce1d36cccd9 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Sun, 22 May 2022 17:25:36 +0100 Subject: [PATCH] Add Tdarr_Plugin_MC93_Migz1FFMPEG test --- Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js | 1 - .../Tdarr_Plugin_MC93_Migz1FFMPEG.js | 145 ++++++++++++++++++ 2 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js diff --git a/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js b/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js index 39fd212..11edf36 100644 --- a/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js +++ b/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js @@ -1,5 +1,4 @@ /* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */ -// tdarrSkipTest const details = () => ({ id: 'Tdarr_Plugin_MC93_Migz1FFMPEG', Stage: 'Pre-processing', diff --git a/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js b/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.js new file mode 100644 index 0000000..a329f18 --- /dev/null +++ b/tests/Community/Tdarr_Plugin_MC93_Migz1FFMPEG.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: '-c:v h264_cuvid, -map 0 -c:v hevc_nvenc -cq:v 19 -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -spatial_aq:v 1 -rc-lookahead:v 32 -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: '-c:v h264_cuvid, -map 0 -c:v hevc_nvenc -cq:v 19 -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -spatial_aq:v 1 -rc-lookahead:v 32 -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 cutoff of 10000. 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: '-c:v h264_cuvid, -map 0 -c:v hevc_nvenc -cq:v 19 -b:v 758k -minrate 530k -maxrate 985k -bufsize 1517k -spatial_aq:v 1 -rc-lookahead:v 32 -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);