This commit is contained in:
Kevin Wong
2026-02-27 16:11:34 +08:00
parent a1604979f0
commit 0e3502c6f0
113 changed files with 115723 additions and 490 deletions

View File

@@ -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}%`);