Skip to content

🎥 Make videos programmatically with React

Load Mediabunny only when importing Canvas Captures

Jonny Burgerf2413411668b
diff --git a/packages/cli/src/import-canvas-capture.ts b/packages/cli/src/import-canvas-capture.ts
index 75f811c2cb..eb8eb733f0 100644
--- a/packages/cli/src/import-canvas-capture.ts
+++ b/packages/cli/src/import-canvas-capture.ts
@@ -18,7 +18,6 @@ import {
parseCanvasCaptureData,
type CanvasCaptureData,
} from '@remotion/studio-shared';
-import {ALL_FORMATS, FilePathSource, Input} from 'mediabunny';
import {addCommand} from './add';
// Internal and unstable. Keep the file import separate from the pure codemod.
@@ -82,6 +81,7 @@ export const importCanvasCapture = async ({
);
}
+ const {ALL_FORMATS, FilePathSource, Input} = await import('mediabunny');
const input = new Input({
formats: ALL_FORMATS,
source: new FilePathSource(videoSource),