Skip to content

🎥 Make videos programmatically with React

140kb testcase

Jonny Burger582dff4d288c
diff --git a/packages/example/src/Root.tsx b/packages/example/src/Root.tsx
index 338b84fdc1..53d6c0312a 100644
--- a/packages/example/src/Root.tsx
+++ b/packages/example/src/Root.tsx
@@ -210,6 +210,33 @@ export const Index: React.FC = () => {
date: new Date('2020-01-01'),
}}
/>
+ <Composition
+ // Sending 140KB payload will not require the Lambda function to compress the props,
+ // but once spawning the renderer function, then the input props as well as the resolved
+ // combined together will take more than 256KB of space.
+ // In that case, we need to compress one of them.
+ id="140kb-payload"
+ component={HugePayload}
+ width={1080}
+ height={1080}
+ fps={30}
+ durationInFrames={2}
+ calculateMetadata={() => {
+ return {
+ props: {
+ str: 'a'.repeat(140 * 1000),
+ date: new Date('2020-01-01'),
+ file: staticFile('nested/mp4.png'),
+ },
+ };
+ }}
+ schema={hugePayloadSchema}
+ defaultProps={{
+ str: 'potato',
+ file: staticFile('giphy.gif'),
+ date: new Date('2020-01-01'),
+ }}
+ />
<Composition
id="sync-dynamic-length"
component={DynamicDuration}
diff --git a/packages/example/testlambda.mjs b/packages/example/testlambda.mjs
index a91605d401..9aa1ff3801 100644
--- a/packages/example/testlambda.mjs
+++ b/packages/example/testlambda.mjs
@@ -32,3 +32,15 @@ execSync(
stdio: 'inherit',
}
);
+execSync(
+ `pnpm exec remotion lambda still testbed-v6 140kb-payload --props="${JSON.stringify(
+ {
+ str: 'a'.repeat(140 * 1000),
+ date: 'remotion-date:' + new Date('2020-01-01').toISOString(),
+ file: 'nested/mp4.png',
+ }
+ )}" --log=verbose`,
+ {
+ stdio: 'inherit',
+ }
+);