feat(analyzer): enhance anime detection with accent normalization and flexible matching
Build / Lint & Test (push) Successful in 19s
Build / Lint & Test (push) Successful in 19s
This commit is contained in:
1 parent
c46e3dfdb3
commit
2ea83ae566
5 files changed
+143
-12
No files matched your search
@@ -215,7 +215,8 @@ const plugin = async (args) => {
|
||||
const inputBaseName = path.basename(inputFile, path.extname(inputFile));
|
||||
const baseName = variables.workDirSourceBaseName
|
||||
|| (variables.workDirCopyApplied === 'true' ? inputBaseName.replace(/_old$/, '') : inputBaseName);
|
||||
const outFile = path.join(workDir, `${baseName}.${container}`);
|
||||
const outFile = path.join(workDir, `${baseName}.${container}`).replace(/\\/g, '/');
|
||||
const displayFile = (variables.originalLibraryFile || inputFile).replace(/\\/g, '/');
|
||||
const statsFile = path.join(workDir, 'x265_2pass.log');
|
||||
// The CLI runs with workDir as its current directory. Keeping this relative
|
||||
// avoids the Windows drive colon being parsed as an x265-params separator.
|
||||
@@ -262,6 +263,14 @@ const plugin = async (args) => {
|
||||
}
|
||||
|
||||
jobLog('[transcode2PassX265] Copying compatible video and processing audio...\n');
|
||||
if (typeof updateWorker === 'function') {
|
||||
updateWorker({
|
||||
file: displayFile,
|
||||
CLIType: args.ffmpegPath,
|
||||
preset: 'copy',
|
||||
});
|
||||
}
|
||||
|
||||
const { CLI } = require('../../../../FlowHelpers/1.0.0/cliUtils');
|
||||
const copyCli = new CLI({
|
||||
cli: args.ffmpegPath,
|
||||
@@ -272,6 +281,7 @@ const plugin = async (args) => {
|
||||
...audioArgs,
|
||||
'-map_metadata', '-1',
|
||||
'-map_chapters', '-1',
|
||||
'-metadata', `title=${baseName}`,
|
||||
'-disposition:v:0', 'default',
|
||||
...videoArgs,
|
||||
'-sn',
|
||||
@@ -282,7 +292,7 @@ const plugin = async (args) => {
|
||||
jobLog,
|
||||
outputFilePath: outFile,
|
||||
inputFileObj,
|
||||
updateWorker,
|
||||
updateWorker: (data) => updateWorker && updateWorker({ file: displayFile, ...data }),
|
||||
logFullCliOutput: args.logFullCliOutput || false,
|
||||
args,
|
||||
});
|
||||
@@ -310,16 +320,28 @@ const plugin = async (args) => {
|
||||
const { CLI } = require('../../../../FlowHelpers/1.0.0/cliUtils');
|
||||
const { updateProgress } = args;
|
||||
|
||||
if (typeof updateWorker === 'function') {
|
||||
updateWorker({
|
||||
file: displayFile,
|
||||
CLIType: args.ffmpegPath,
|
||||
preset: `x265 2-pass (${vBitrate})`,
|
||||
});
|
||||
}
|
||||
|
||||
// Scale 2-pass progress so Pass 1 counts for 0-50% and Pass 2 counts for 50-100%
|
||||
const pass1UpdateWorker = (progressData) => {
|
||||
if (typeof updateWorker !== 'function') return;
|
||||
if (progressData && typeof progressData.percentage === 'number') {
|
||||
updateWorker({
|
||||
file: displayFile,
|
||||
...progressData,
|
||||
percentage: scalePassPercentage(1, progressData.percentage),
|
||||
});
|
||||
} else {
|
||||
updateWorker(progressData);
|
||||
updateWorker({
|
||||
file: displayFile,
|
||||
...progressData,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -339,11 +361,15 @@ const plugin = async (args) => {
|
||||
if (typeof updateWorker !== 'function') return;
|
||||
if (progressData && typeof progressData.percentage === 'number') {
|
||||
updateWorker({
|
||||
file: displayFile,
|
||||
...progressData,
|
||||
percentage: scalePassPercentage(2, progressData.percentage),
|
||||
});
|
||||
} else {
|
||||
updateWorker(progressData);
|
||||
updateWorker({
|
||||
file: displayFile,
|
||||
...progressData,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -413,6 +439,7 @@ const plugin = async (args) => {
|
||||
...audioArgs,
|
||||
'-map_metadata', '-1',
|
||||
'-map_chapters', '-1',
|
||||
'-metadata', `title=${baseName}`,
|
||||
'-disposition:v:0', 'default',
|
||||
...videoArgs,
|
||||
'-x265-params', `pass=2:${x265ParamsBase}`,
|
||||
|
||||
Reference in new issue
Block a user