Skip to content

Commit

Permalink
add args with free MAX_PROCESS
Browse files Browse the repository at this point in the history
  • Loading branch information
yy-tromb committed Jan 2, 2024
1 parent 73a294f commit 2439608
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions yy-many-convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import { execFile } from "child_process";
import { promisify } from "util";
const run = promisify(execFile);

if (process.argv.length < 4) {
if (process.argv.length < 5) {
console.error(
`Arguments is not enough
Usage: path_to_Node.js path_to_yy-many-convert.js {source_folder} {output_folder}`
Usage: path_to_Node.js path_to_yy-many-convert.js {source_folder} {output_folder} {MAX_PROCESS (int)}`
);
}

const MAX_PROCESS = 15;
const MAX_PROCESS = Number(process.argv[4]);
const CONVERT_COMMAND = "ffmpeg";
const compile_args = (source_file, output_file) => {
return [
Expand All @@ -25,7 +25,7 @@ const compile_args = (source_file, output_file) => {
"18",
"-still-picture",
"1",
"-y",
"-n",
output_file,
];
};
Expand Down

0 comments on commit 2439608

Please sign in to comment.