Skip to content

🎥 Make videos programmatically with React

fix test

Jonny Burger2ee6f4aca65a
diff --git a/packages/example/src/ReallyLongVideo.tsx b/packages/example/src/ReallyLongVideo.tsx
new file mode 100644
index 0000000000..84be7ff830
--- /dev/null
+++ b/packages/example/src/ReallyLongVideo.tsx
@@ -0,0 +1,16 @@
+import {interpolate, Loop, Video} from 'remotion';
+
+const InfinityVideo: React.FC = () => {
+ return (
+ <Loop durationInFrames={10 * 30 * 60}>
+ <Video
+ volume={(f) =>
+ interpolate(f, [0, 500], [1, 0], {extrapolateRight: 'clamp'})
+ }
+ src="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
+ />
+ </Loop>
+ );
+};
+
+export default InfinityVideo;
diff --git a/packages/example/src/Video.tsx b/packages/example/src/Video.tsx
index 445701e212..a6d407b128 100644
--- a/packages/example/src/Video.tsx
+++ b/packages/example/src/Video.tsx
@@ -8,6 +8,7 @@ import {Framer} from './Framer';
import {FreezeExample} from './Freeze/FreezeExample';
import {MissingImg} from './MissingImg';
import {OrbScene} from './Orb';
+import InfinityVideo from './ReallyLongVideo';
import RemoteVideo from './RemoteVideo';
import {Scripts} from './Scripts';
import {SkipZeroFrame} from './SkipZeroFrame';
@@ -253,6 +254,14 @@ export const Index: React.FC = () => {
fps={30}
durationInFrames={600}
/>
+ <Composition
+ id="2hrvideo"
+ component={InfinityVideo}
+ width={1920}
+ height={1080}
+ fps={30}
+ durationInFrames={2 * 60 * 60 * 30}
+ />
<Composition
id="three-basic"
component={ThreeBasic}
diff --git a/packages/lambda/remotionlambda.zip b/packages/lambda/remotionlambda.zip
index 7eed3a3371..c406e1b580 100644
Binary files a/packages/lambda/remotionlambda.zip and b/packages/lambda/remotionlambda.zip differ
diff --git a/packages/lambda/src/test/integration/cli.test.ts b/packages/lambda/src/test/integration/cli.test.ts
index 230ae11caa..8bb227222f 100644
--- a/packages/lambda/src/test/integration/cli.test.ts
+++ b/packages/lambda/src/test/integration/cli.test.ts
@@ -1,6 +1,7 @@
import {CliInternals} from '@remotion/cli';
import {
CURRENT_VERSION,
+ DEFAULT_EPHEMERAL_STORAGE_IN_MB,
DEFAULT_MEMORY_SIZE,
DEFAULT_TIMEOUT,
} from '../../defaults';
@@ -10,7 +11,7 @@ import {getProcessWriteOutput} from './console-hooks';
test('Deploy function', async () => {
await LambdaInternals.executeCommand(['functions', 'deploy']);
expect(getProcessWriteOutput()).toContain(
- `Deployed as remotion-render-${CURRENT_VERSION}-${DEFAULT_MEMORY_SIZE}mb-${DEFAULT_TIMEOUT}sec\n`
+ `Deployed as remotion-render-${CURRENT_VERSION}-mem${DEFAULT_MEMORY_SIZE}.mb-disk${DEFAULT_EPHEMERAL_STORAGE_IN_MB}mb-${DEFAULT_TIMEOUT}sec\n`
);
});
diff --git a/packages/lambda/src/test/integration/deploy-function.test.ts b/packages/lambda/src/test/integration/deploy-function.test.ts
index a250fd4ba5..f6ed51f09e 100644
--- a/packages/lambda/src/test/integration/deploy-function.test.ts
+++ b/packages/lambda/src/test/integration/deploy-function.test.ts
@@ -7,8 +7,8 @@ import {
} from '../../api/mock-functions';
import {CURRENT_VERSION} from '../../shared/constants';
-const expectedFunctionName = (memory: number, timeout: number) =>
- `remotion-render-${CURRENT_VERSION}-${memory}mb-${timeout}sec`;
+const expectedFunctionName = (memory: number, timeout: number, disk: number) =>
+ `remotion-render-${CURRENT_VERSION}-ram${memory}mb-disk${disk}-${timeout}sec`;
test('Should be able to deploy function', async () => {
const {functionName} = await deployFunction({
@@ -62,10 +62,10 @@ test('Should be able to delete the function', async () => {
createCloudWatchLogGroup: true,
architecture: 'arm64',
});
- expect(functionName).toBe(expectedFunctionName(2048, 120));
+ expect(functionName).toBe(expectedFunctionName(2048, 120, 512));
await deleteFunction({
region: 'us-east-1',
- functionName: expectedFunctionName(2048, 120),
+ functionName: expectedFunctionName(2048, 120, 512),
});
const fns = await getFunctions({
region: 'us-east-1',
diff --git a/packages/lambda/src/test/unit/best-frames-per-lambda-param.test.ts b/packages/lambda/src/test/unit/best-frames-per-lambda-param.test.ts
index ad26701923..5f28759027 100644
--- a/packages/lambda/src/test/unit/best-frames-per-lambda-param.test.ts
+++ b/packages/lambda/src/test/unit/best-frames-per-lambda-param.test.ts
@@ -10,4 +10,5 @@ test('Get reasonable framesPerLambda defaults', () => {
expect(bestFramesPerLambdaParam(10000)).toEqual(86);
expect(bestFramesPerLambdaParam(14000)).toEqual(105);
expect(bestFramesPerLambdaParam(18000)).toEqual(120);
+ expect(bestFramesPerLambdaParam(216000)).toEqual(1440);
});