更新
This commit is contained in:
@@ -26,6 +26,7 @@ interface RenderOptions {
|
||||
enableSubtitles?: boolean;
|
||||
width?: number;
|
||||
height?: number;
|
||||
concurrency?: number;
|
||||
}
|
||||
|
||||
async function parseArgs(): Promise<RenderOptions> {
|
||||
@@ -87,6 +88,9 @@ async function parseArgs(): Promise<RenderOptions> {
|
||||
console.warn('Invalid secondaryTitleStyle JSON');
|
||||
}
|
||||
break;
|
||||
case 'concurrency':
|
||||
options.concurrency = parseInt(value, 10);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,13 +198,15 @@ async function main() {
|
||||
composition.height = videoHeight;
|
||||
|
||||
// Render the video
|
||||
console.log('Rendering video...');
|
||||
const concurrency = options.concurrency || 16;
|
||||
console.log(`Rendering video (concurrency=${concurrency})...`);
|
||||
await renderMedia({
|
||||
composition,
|
||||
serveUrl: bundleLocation,
|
||||
codec: 'h264',
|
||||
outputLocation: options.outputPath,
|
||||
inputProps,
|
||||
concurrency,
|
||||
onProgress: ({ progress }) => {
|
||||
const percent = Math.round(progress * 100);
|
||||
process.stdout.write(`\rRendering: ${percent}%`);
|
||||
|
||||
Reference in New Issue
Block a user