feat: Tdarr Local Flow Plugin Suite v1.0
7 atomic plugins for automated x265 transcoding pipeline: - utility/mediaAnalyzerGOP : GOP calc, FPS detection, film/series/anime routing - utility/setAnimationFlag : manual animation flag override - utility/extractChaptersXml : mkvextract chapters to XML - audio/audioSelectorClamping : codec scoring, clamped Opus bitrates, 2 outputs - audio/backupSourceAudio : lossless DTS/TrueHD ITA backup (-c:a copy) - subtitles/extractSubtitlesAndOcr : SRT extract + SubtitleEdit OCR for PGS - video/transcode2PassX265 : 2-pass x265, Lanczos 1080p bound, Opus mux Test suite: 34 unit tests + 3 integration tests (FFmpeg real files) FlowHelpers mock for local testing included Docs: integration-guide.md with canvas wiring and deploy instructions
This commit is contained in:
commit
c2074be826
19 files changed
+2134
No files matched your search
@@ -0,0 +1,76 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* test3-ultrawide.js
|
||||
* Validates: transcode2PassX265 scale filter on 3840x1600 input.
|
||||
* Expected output: 1920x800 (no letterbox, even dimensions).
|
||||
*/
|
||||
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const { execSync } = require('child_process');
|
||||
const { buildMockArgs, cleanupWorkDir, assert, assertEqual } = require('../mock-tdarr-runtime');
|
||||
const { plugin: analyzerPlugin } = require('../../LocalFlowPlugins/utility/mediaAnalyzerGOP/1.0.0/index');
|
||||
const { plugin: audioPlugin } = require('../../LocalFlowPlugins/audio/audioSelectorClamping/1.0.0/index');
|
||||
const { plugin: transcodePlugin } = require('../../LocalFlowPlugins/video/transcode2PassX265/1.0.0/index');
|
||||
|
||||
const FILE = path.resolve('tests/samples/test3_ultrawide.mkv');
|
||||
const FFMPEG = process.env.FFMPEG_PATH || 'ffmpeg';
|
||||
const FFPROBE = process.env.FFPROBE_PATH || 'ffprobe';
|
||||
|
||||
async function run() {
|
||||
console.log('\n=== TEST 3: Ultrawide 3840x1600 Scale Filter ===\n');
|
||||
|
||||
// Analyzer
|
||||
const args1 = buildMockArgs({
|
||||
filePath: FILE,
|
||||
inputs: { moviePathPatterns: '/Radarr', animeSeries: '', filmBitrate: '3000',
|
||||
seriesBitrate: '3000', animeBitrateHd: '2000', animeBitrateSd: '1000' },
|
||||
});
|
||||
const out1 = await analyzerPlugin(args1);
|
||||
const vars = out1.variables;
|
||||
assertEqual(vars.videoHeight, '1600', 'Source videoHeight = 1600');
|
||||
|
||||
// Audio selector
|
||||
const args2 = buildMockArgs({
|
||||
filePath: FILE, variables: vars,
|
||||
inputs: { filmMultiChannelBitrate: '640', seriesMultiChannelThreshold: '384', stereoBitrateMax: '128' },
|
||||
});
|
||||
const out2 = await audioPlugin(args2);
|
||||
|
||||
// Transcode (Pass 1 + Pass 2)
|
||||
console.log('Running transcode2PassX265 (this may take a minute)...');
|
||||
const args3 = buildMockArgs({
|
||||
filePath: FILE,
|
||||
variables: out2.variables,
|
||||
inputs: { x265Preset: 'ultrafast', outputContainer: 'mkv' },
|
||||
ffmpegPath: FFMPEG,
|
||||
});
|
||||
|
||||
const out3 = await transcodePlugin(args3);
|
||||
const outFile = out3.outputFileObj._id;
|
||||
|
||||
assert(fs.existsSync(outFile), `Output file exists: ${outFile}`);
|
||||
|
||||
// Verify dimensions with ffprobe
|
||||
const probeOut = execSync(
|
||||
`${FFPROBE} -v quiet -print_format json -show_streams -select_streams v:0 "${outFile}"`,
|
||||
{ encoding: 'utf8' },
|
||||
);
|
||||
const { streams } = JSON.parse(probeOut);
|
||||
const w = streams[0].width;
|
||||
const h = streams[0].height;
|
||||
|
||||
console.log(` Output dimensions: ${w}x${h}`);
|
||||
assert(w === 1920, `Width = 1920 (got ${w})`);
|
||||
assert(h === 800, `Height = 800 (got ${h})`);
|
||||
assert(w % 2 === 0, 'Width is even');
|
||||
assert(h % 2 === 0, 'Height is even');
|
||||
|
||||
cleanupWorkDir(args1);
|
||||
cleanupWorkDir(args2);
|
||||
cleanupWorkDir(args3);
|
||||
console.log('\n=== TEST 3 PASSED ===\n');
|
||||
}
|
||||
|
||||
module.exports = run;
|
||||
Reference in new issue
Block a user