Skip to content

🎥 Make videos programmatically with React

local build

Jonny Burger3d4e93b71bd8
diff --git a/packages/example/package.json b/packages/example/package.json
index 1e8ea997a9..2144802480 100644
--- a/packages/example/package.json
+++ b/packages/example/package.json
@@ -17,7 +17,7 @@
"comps": "remotion compositions",
"lint": "eslint src --ext ts,tsx,js,jsx",
"test": "vitest --run",
- "build": "tsc -d",
+ "build": "tsc -d && remotion bundle",
"render": "remotion render react-svg",
"render-js": "remotion render src/entry.jsx framer",
"render-gif": "remotion render framer out/video.gif --codec=gif --every-nth-frame=2",
diff --git a/packages/lambda/src/test/integration/renders/gif.test.ts b/packages/lambda/src/test/integration/renders/gif.test.ts
index 3e1a51a194..20a04ae30e 100644
--- a/packages/lambda/src/test/integration/renders/gif.test.ts
+++ b/packages/lambda/src/test/integration/renders/gif.test.ts
@@ -17,12 +17,24 @@ afterAll(async () => {
test('Should make a distributed GIF', async () => {
process.env.AWS_LAMBDA_FUNCTION_MEMORY_SIZE = '2048';
+ const exampleBuild = path.join(process.cwd(), '..', 'example', 'build');
+
+ const {port, close} = await RenderInternals.serveStatic(exampleBuild, {
+ binariesDirectory: null,
+ concurrency: 1,
+ downloadMap: RenderInternals.makeDownloadMap(),
+ indent: false,
+ logLevel: 'error',
+ offthreadVideoCacheSizeInBytes: null,
+ port: null,
+ remotionRoot: path.dirname(exampleBuild),
+ });
+
const res = await callLambda({
type: LambdaRoutines.start,
payload: await makeLambdaRenderMediaPayload(
renderMediaOnLambdaOptionalToRequired({
- serveUrl:
- 'https://64d3734a6bb69052c34d3616--spiffy-kelpie-71657b.netlify.app/',
+ serveUrl: `http://localhost:${port}`,
codec: 'gif',
composition: 'framer',
// 61 frames, which is uneven, to challenge the frame planner
@@ -81,4 +93,6 @@ test('Should make a distributed GIF', async () => {
});
unlinkSync(out);
expect(probe.stderr).toMatch(/Video: gif, bgra, 1080x1080/);
+
+ await close();
}, 90000);