mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-04 16:42:27 +00:00
fix(render): cap final mux to video duration
This commit is contained in:
@@ -79,6 +79,8 @@ export interface MuxVideoWithAudioOptions extends Partial<
|
||||
audioCodec?: "aac";
|
||||
/** Preserve a priming edit list known to have been created by AAC re-encoding. */
|
||||
preserveAudioPrimingEditList?: boolean;
|
||||
/** Hard cap copied audio to the already-encoded video's exact duration. */
|
||||
durationSeconds?: number;
|
||||
}
|
||||
|
||||
async function shouldCopyAacSidecar(
|
||||
@@ -706,6 +708,9 @@ export async function muxVideoWithAudio(
|
||||
// output container metadata. `-c:v copy` is retained; no re-encode.
|
||||
args.push("-r", fpsToFfmpegArg(fps));
|
||||
}
|
||||
if (config?.durationSeconds !== undefined) {
|
||||
args.push("-t", String(config.durationSeconds));
|
||||
}
|
||||
args.push("-y", outputPath);
|
||||
|
||||
const processTimeout = config?.ffmpegProcessTimeout ?? DEFAULT_CONFIG.ffmpegProcessTimeout;
|
||||
|
||||
Reference in New Issue
Block a user