linting
This commit is contained in:
parent
807e50388a
commit
832189a346
10 changed files with 518 additions and 299 deletions
|
@ -1,13 +1,13 @@
|
|||
import readline from 'readline';
|
||||
import readline from "readline";
|
||||
import { generateTestVideo, EncodingType } from "./ffmpeg";
|
||||
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout
|
||||
input: process.stdin,
|
||||
output: process.stdout,
|
||||
});
|
||||
|
||||
const questionAsync = (query: string) => {
|
||||
return new Promise<string>(resolve => {
|
||||
return new Promise<string>((resolve) => {
|
||||
rl.question(query, resolve);
|
||||
});
|
||||
};
|
||||
|
@ -16,27 +16,31 @@ const main = async () => {
|
|||
console.log("Testing software encoder: ");
|
||||
await generateTestVideo(EncodingType.CPU).catch(console.error);
|
||||
|
||||
const answer = await questionAsync('Would you like to test other hardware encoders? (yes/no): ');
|
||||
const answer = await questionAsync(
|
||||
"Would you like to test other hardware encoders? (yes/no): ",
|
||||
);
|
||||
|
||||
if (answer.toLowerCase() === 'yes') {
|
||||
const encoder = await questionAsync('Which hardware encoder would you like to test? (INTEL/NVIDIA/AMD/APPLE): ');
|
||||
if (answer.toLowerCase() === "yes") {
|
||||
const encoder = await questionAsync(
|
||||
"Which hardware encoder would you like to test? (INTEL/NVIDIA/AMD/APPLE): ",
|
||||
);
|
||||
let selectedEncoder: EncodingType;
|
||||
|
||||
switch (encoder.toUpperCase()) {
|
||||
case 'INTEL':
|
||||
case "INTEL":
|
||||
selectedEncoder = EncodingType.INTEL;
|
||||
break;
|
||||
case 'NVIDIA':
|
||||
case "NVIDIA":
|
||||
selectedEncoder = EncodingType.NVIDIA;
|
||||
break;
|
||||
case 'AMD':
|
||||
case "AMD":
|
||||
selectedEncoder = EncodingType.AMD;
|
||||
break;
|
||||
case 'APPLE':
|
||||
case "APPLE":
|
||||
selectedEncoder = EncodingType.APPLE;
|
||||
break;
|
||||
default:
|
||||
console.log('Invalid choice. Exiting.');
|
||||
console.log("Invalid choice. Exiting.");
|
||||
rl.close();
|
||||
return;
|
||||
}
|
||||
|
@ -46,11 +50,11 @@ const main = async () => {
|
|||
} else {
|
||||
console.log("Exiting.");
|
||||
}
|
||||
|
||||
|
||||
rl.close();
|
||||
};
|
||||
|
||||
main().catch(err => {
|
||||
main().catch((err) => {
|
||||
console.error("An error occurred:", err);
|
||||
rl.close();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue