Skip to content

🎥 Make videos programmatically with React

Update render-media-on-lambda.ts

Jonny Burgera374e5aa3d05
diff --git a/packages/example/render-media-on-lambda.ts b/packages/example/render-media-on-lambda.ts
index dcc18a2644..7840f69dc8 100644
--- a/packages/example/render-media-on-lambda.ts
+++ b/packages/example/render-media-on-lambda.ts
@@ -1,12 +1,21 @@
/* eslint-disable no-undef */
+import {deployFunction} from '@remotion/lambda';
import {
getRenderProgress,
renderMediaOnLambda,
speculateFunctionName,
-} from '@remotion/lambda/client';
+} from '@remotion/lambda-client';
import dotenv from 'dotenv';
dotenv.config();
+await deployFunction({
+ memorySizeInMb: 2048,
+ diskSizeInMb: 2048,
+ region: 'eu-central-1',
+ timeoutInSeconds: 120,
+ createCloudWatchLogGroup: true,
+});
+
const functionName = speculateFunctionName({
diskSizeInMb: 2048,
memorySizeInMb: 2048,
@@ -24,15 +33,13 @@ const {bucketName, renderId, cloudWatchMainLogs} = await renderMediaOnLambda({
bucketName: 'remotion-test-bucket',
key: 'out.mp4',
s3OutputProvider: {
- // TODO: Use the endpoint from your Supabase Storage settings
- endpoint: 'https://kudbuxgvpedqabsivqjz.supabase.co/storage/v1/s3',
- // TODO: Use the Access Key from your Supabase Storage settings
- accessKeyId: process.env.SUPABASE_ACCESS_KEY_ID ?? '',
- // TODO: Use the Secret Access Key from your Supabase Storage settings
- secretAccessKey: process.env.SUPABASE_SECRET_ACCESS_KEY ?? '',
- // TODO: Use the region from your Supabase Storage settings
- region: 'eu-central-1',
- forcePathStyle: true,
+ // FIXME: Use the endpoint from your Cloudflare Storage settings
+ endpoint:
+ 'https://2fe488b3b0f4deee223aef7464784c46.r2.cloudflarestorage.com',
+ // FIXME: Use the Access Key from your Cloudflare settings
+ accessKeyId: process.env.R2_ACCESS_KEY_ID ?? '',
+ // FIXME: Use the Secret Access Key from your Cloudflare settings
+ secretAccessKey: process.env.R2_SECRET_ACCESS_KEY ?? '',
},
},
});