Skip to content

🎥 Make videos programmatically with React

Update stitch-frames-to-video.ts

Jonny Burgerdd6e4da085ba
diff --git a/packages/renderer/src/stitch-frames-to-video.ts b/packages/renderer/src/stitch-frames-to-video.ts
index 0d446cc9b0..74fa3d24c6 100644
--- a/packages/renderer/src/stitch-frames-to-video.ts
+++ b/packages/renderer/src/stitch-frames-to-video.ts
@@ -275,12 +275,15 @@ const innerStitchFramesToVideo = async (
);
}
- cpSync(audio as string, outputLocation ?? (tempFile as string));
+ if (!audio) {
+ throw new TypeError(
+ 'exporting audio but has no audio file. Report this in the Remotion repo.',
+ );
+ }
+ cpSync(audio, outputLocation ?? (tempFile as string));
onProgress?.(expectedFrames);
- if (audio) {
- deleteDirectory(path.dirname(audio));
- }
+ deleteDirectory(path.dirname(audio));
const file = await new Promise<Buffer | null>((resolve, reject) => {
if (tempFile) {