🎥 Make videos programmatically with React
last minute cleanups
Jonny Burgera7976b8eb5e3
diff --git a/packages/docs/_redirects b/packages/docs/_redirectsindex fb281c738f..a9678a1d98 100644--- a/packages/docs/_redirects+++ b/packages/docs/_redirects@@ -1 +1 @@-https://remotion-lambda-alpha.netlify.app/* https://v3.remotion.dev/:splat 301!+https://remotion-lambda-alpha.netlify.app/* https://remotion.dev/:splat 301!diff --git a/packages/docs/components/LambdaSplash/Easy.tsx b/packages/docs/components/LambdaSplash/Easy.tsxindex c6ed52780a..2008c487b8 100644--- a/packages/docs/components/LambdaSplash/Easy.tsx+++ b/packages/docs/components/LambdaSplash/Easy.tsx@@ -26,7 +26,7 @@ export const LambdaEasy: React.FC = () => {</h2><p>We{"'"}ve figured out hard problems such as cloud architecture,- scheduling and progress reporting and provide you with a solution that+ scheduling and progress reporting to provide you with a solution thatyou can deploy to your own account by following a series ofwell-defined steps.</p>diff --git a/packages/docs/docs/lambda/changelog.md b/packages/docs/docs/lambda/changelog.mdindex 6edcf7fe10..780c6f3dbb 100644--- a/packages/docs/docs/lambda/changelog.md+++ b/packages/docs/docs/lambda/changelog.md@@ -237,7 +237,7 @@ Lambda version: '2022-01-10'- New option to allow the filename of the output: `outName` in `renderMedia` / `renderStill` and `--out-name` in CLI flags- Reenable WebGL support- Update to Chromium 97-- New algorithm for determining default concurrency: https://v3.remotion.dev/docs/lambda/concurrency+- New algorithm for determining default concurrency: https://remotion.dev/docs/lambda/concurrency- Better error message if concurrency is too high- Remove `colors` module- Fixes an error where payload limit would be reached because `defaultProps` had a big sizediff --git a/packages/docs/docs/lambda/checklist.md b/packages/docs/docs/lambda/checklist.mdindex 173eb790ad..5c7b8e6666 100644--- a/packages/docs/docs/lambda/checklist.md+++ b/packages/docs/docs/lambda/checklist.md@@ -10,10 +10,6 @@ import {DefaultTimeout} from '../../components/lambda/default-timeout';You have implemented your solution with Remotion Lambda are are ready to launch your project into the world. Congrats!Before you go live, go through this checklist to make sure Lambda is running stable.-:::warning-We think Lambda is stable enough to ship to production, but remember that Lambda is still in beta and that APIs may change.-:::-### Optimizing for memoryAdding too much memory to your Lambda functions can make rendering more costly. Reducing the memory of your function by 25% will also decrease your cost by 25%! Redeploy your function multiple times and lower the memory size as much as possible until you feel you hit the sweet spot between low costs and confidence that your video will render reliably.diff --git a/packages/docs/docs/lambda/concurrency.md b/packages/docs/docs/lambda/concurrency.mdindex 610fac256f..d13b143db6 100644--- a/packages/docs/docs/lambda/concurrency.md+++ b/packages/docs/docs/lambda/concurrency.md@@ -52,7 +52,3 @@ Ensure that you only set parameter within these limits to ensure the renders don- Maximum concurrency: 200The Remotion Lambda defaults will never go outside these bounds.--:::note-Also note the maximum video length of 18000 frames.-:::diff --git a/packages/docs/docs/lambda/faq.md b/packages/docs/docs/lambda/faq.mdindex e6bcf07b32..2bf8779b43 100644--- a/packages/docs/docs/lambda/faq.md+++ b/packages/docs/docs/lambda/faq.md@@ -30,7 +30,7 @@ You can deploy one site and use it for as many renders as you need. If you have### What if I want to render longer videos?-You don't need to worry about the timeout of a Lambda function because Remotion splits the video in many parts and renders them in parallel. However, you need to be aware of the storages limit that may not be exceeded. See: [Disk size](/docs/lambda/disk-size)+You don't need to worry about the timeout of a Lambda function because Remotion splits the video in many parts and renders them in parallel. However, you need to be aware of the storage limits that may not be exceeded. See: [Disk size](/docs/lambda/disk-size)### Why are you not using Amazon EFS?diff --git a/packages/docs/docs/lambda/getrenderprogress.md b/packages/docs/docs/lambda/getrenderprogress.mdindex ea39f611d0..f7c490388e 100644--- a/packages/docs/docs/lambda/getrenderprogress.md+++ b/packages/docs/docs/lambda/getrenderprogress.md@@ -75,13 +75,13 @@ Contains the following information about the render:- `startedDate`: Timestamp of when the rendering process started.- `totalChunks`: Into how many pieces the rendering is divided.- `estimatedTotalLambdaInvokations`: The estimated amount of total Lambda function calls in total, excluding calls to `getRenderProgress()`.-- `estimatedRenderLambdaInvokations`: The estimated amount of Lambdas that will render chunks of the video.`.+- `estimatedRenderLambdaInvokations`: The estimated amount of Lambdas that will render chunks of the video.- `compositionId`: The ID of the composition that is being rendered.- `codec`: The selected codec into which the video gets encoded.### `bucket`-Which bucket the render and other artifacts get saved.+In which bucket the render and other artifacts get saved.### `outputFile`diff --git a/packages/docs/docs/lambda/setup.md b/packages/docs/docs/lambda/setup.mdindex 7f7631c943..cbe86cd6cc 100644--- a/packages/docs/docs/lambda/setup.md+++ b/packages/docs/docs/lambda/setup.md@@ -24,15 +24,15 @@ Make sure no package version number has a `^` character in front of it as it wilYour package.json should look like the following:```json- "@remotion/bundler": "3.0.0-lambda.[versionhash]",- "@remotion/cli": "3.0.0-lambda.[versionhash]",- "@remotion/lambda": "3.0.0-lambda.[versionhash]",+ "@remotion/bundler": "3.0.0",+ "@remotion/cli": "3.0.0",+ "@remotion/lambda": "3.0.0",// ...- "remotion": "3.0.0-lambda.[versionhash]",+ "remotion": "3.0.0",```:::tip-You can install `@remotion/lambda` in any project, not just a Remotion one, but remember to install `react` and `react-dom` peer dependencies+You can install `@remotion/lambda` in any project, not just a Remotion one, but remember to also install `react` and `react-dom` as they are peer dependencies.:::## 2. Create role policydiff --git a/packages/lambda/README.md b/packages/lambda/README.mdindex 8cdcb1377b..0f9efc74ff 100644--- a/packages/lambda/README.md+++ b/packages/lambda/README.md@@ -1,3 +1,3 @@# @remotion/lambda-This package provides Node.JS APIs and a CLI for rendering Remotion videos on AWS Lambda. See https://v3.remotion.dev/docs/lambda for documentation.+This package provides Node.JS APIs and a CLI for rendering Remotion videos on AWS Lambda. See https://remotion.dev/docs/lambda for documentation.diff --git a/packages/lambda/package.json b/packages/lambda/package.jsonindex 716edadda3..e664412ca5 100644--- a/packages/lambda/package.json+++ b/packages/lambda/package.json@@ -1,7 +1,7 @@{"name": "@remotion/lambda","version": "2.6.16",- "description": "Utility functions for audio and video",+ "description": "Distributed renderer for Remotion based on AWS Lambda","main": "dist/index.js","sideEffects": false,"bin": {diff --git a/packages/lambda/src/api/delete-function.ts b/packages/lambda/src/api/delete-function.tsindex 2a23d58425..63ccf894e8 100644--- a/packages/lambda/src/api/delete-function.ts+++ b/packages/lambda/src/api/delete-function.ts@@ -9,7 +9,7 @@ export type DeleteFunctionInput = {/*** @description Deletes a function from AWS Lambda.- * @link https://v3.remotion.dev/docs/lambda/deletefunction+ * @link https://remotion.dev/docs/lambda/deletefunction* @param options.region The region the function was deployed to.* @param options.functionName The name of the function.* @returns {Promise<void>} Nothing. Throws if the function failed to delete.diff --git a/packages/lambda/src/api/delete-site.ts b/packages/lambda/src/api/delete-site.tsindex e79741a0bc..7cf362b7fe 100644--- a/packages/lambda/src/api/delete-site.ts+++ b/packages/lambda/src/api/delete-site.ts@@ -18,7 +18,7 @@ export type DeleteSiteOutput = {/**** @description Deletes a deployed site from your S3 bucket. The opposite of deploySite().- * @link https://v3.remotion.dev/docs/lambda/deletesite+ * @link https://remotion.dev/docs/lambda/deletesite* @param options.bucketName The S3 bucket name where the site resides in.* @param options.siteName The ID of the site that you want to delete.* @param {AwsRegion} options.region The region in where the S3 bucket resides in.diff --git a/packages/lambda/src/api/deploy-function.ts b/packages/lambda/src/api/deploy-function.tsindex 41a38bc0cd..88a4ebc0e8 100644--- a/packages/lambda/src/api/deploy-function.ts+++ b/packages/lambda/src/api/deploy-function.ts@@ -36,7 +36,7 @@ export type DeployFunctionOutput = {/*** @description Creates an AWS Lambda function in your account that will be able to render a video in the cloud.- * @link https://v3.remotion.dev/docs/lambda/deployfunction+ * @link https://remotion.dev/docs/lambda/deployfunction* @param options.createCloudWatchLogGroup Whether you'd like to create a CloudWatch Log Group to store the logs for this function.* @param options.cloudWatchLogRetentionPeriodInDays (optional) The number of days to retain the CloudWatch logs for this function. Default is 14 days.* @param options.region The region you want to deploy your function to.diff --git a/packages/lambda/src/api/deploy-site.ts b/packages/lambda/src/api/deploy-site.tsindex 3d9da8adf0..371e437036 100644--- a/packages/lambda/src/api/deploy-site.ts+++ b/packages/lambda/src/api/deploy-site.ts@@ -33,7 +33,7 @@ export type DeploySiteOutput = Promise<{/*** @description Deploys a Remotion project to an S3 bucket to prepare it for rendering on AWS Lambda.- * @link https://v3.remotion.dev/docs/lambda/deploysite+ * @link https://remotion.dev/docs/lambda/deploysite* @param {AwsRegion} params.region The region in which the S3 bucket resides in.* @param {string} params.entryPoint An absolute path to the entry file of your Remotion project.* @param {string} params.bucketName The name of the bucket to deploy your project into.diff --git a/packages/lambda/src/api/estimate-price.ts b/packages/lambda/src/api/estimate-price.tsindex 2eafa0f630..a5bf25f4e1 100644--- a/packages/lambda/src/api/estimate-price.ts+++ b/packages/lambda/src/api/estimate-price.ts@@ -20,7 +20,7 @@ export type EstimatePriceInput = {/**** @description Calculates the AWS costs incurred for AWS Lambda given the region, execution duration and memory size.- * @link https://v3.remotion.dev/docs/lambda/estimateprice+ * @link https://remotion.dev/docs/lambda/estimateprice* @returns {number} Price in USD*/export const estimatePrice = ({diff --git a/packages/lambda/src/api/get-aws-client.ts b/packages/lambda/src/api/get-aws-client.tsindex 9bb75778b0..172164b9f0 100644--- a/packages/lambda/src/api/get-aws-client.ts+++ b/packages/lambda/src/api/get-aws-client.ts@@ -26,7 +26,7 @@ export type GetAwsClientOutput<T extends keyof ServiceMapping> = {/*** @description Gets the full AWS SDK and an instantiated client for an AWS service- * @link https://v3.remotion.dev/docs/lambda/getawsclient+ * @link https://remotion.dev/docs/lambda/getawsclient* @param {AwsRegion} params.region The region in which the S3 bucket resides in.* @param {string} params.service One of `iam`, `s3`, `cloudwatch`, `iam` or `servicequotas`* @returns {GetAwsClientOutput<T>} Returns `client` and `sdk` of a AWS servicediff --git a/packages/lambda/src/api/get-function-info.ts b/packages/lambda/src/api/get-function-info.tsindex f8ed57bb9f..ac483c67bf 100644--- a/packages/lambda/src/api/get-function-info.ts+++ b/packages/lambda/src/api/get-function-info.ts@@ -23,7 +23,7 @@ export type GetFunctionInfoInput = {/*** @description Given a region and function name, returns information about the function such as version, memory size and timeout.- * @link https://v3.remotion.dev/docs/lambda/getfunctioninfo+ * @link https://remotion.dev/docs/lambda/getfunctioninfo* @param {AwsRegion} options.region The region in which the function resides in.* @param {string} options.functionName The name of the function* @return {Promise<FunctionInfo>} Promise resolving to information about the function.diff --git a/packages/lambda/src/api/get-functions.ts b/packages/lambda/src/api/get-functions.tsindex 1f3d4b9147..b3b1d0d42a 100644--- a/packages/lambda/src/api/get-functions.ts+++ b/packages/lambda/src/api/get-functions.ts@@ -55,7 +55,7 @@ const getAllFunctions = async ({*** @description Lists Remotion Lambda render functions deployed to AWS Lambda.- * @link https://v3.remotion.dev/docs/lambda/getfunctions+ * @link https://remotion.dev/docs/lambda/getfunctions* @param options.region The region of which the functions should be listed.* @param options.compatibleOnly Whether only functions compatible with the installed version of Remotion Lambda should be returned.* @returns {Promise<FunctionInfo[]>} An array with the objects containing information about the deployed functions.diff --git a/packages/lambda/src/api/get-or-create-bucket.ts b/packages/lambda/src/api/get-or-create-bucket.tsindex 89fe53a3d2..f510be693a 100644--- a/packages/lambda/src/api/get-or-create-bucket.ts+++ b/packages/lambda/src/api/get-or-create-bucket.ts@@ -15,7 +15,7 @@ export type GetOrCreateBucketOutput = {};/*** @description Creates a bucket for Remotion Lambda in your S3 account. If one already exists, it will get returned instead.- * @link https://v3.remotion.dev/docs/lambda/getorcreatebucket+ * @link https://remotion.dev/docs/lambda/getorcreatebucket* @param options.region The region in which you want your S3 bucket to reside in.* @returns {Promise<GetOrCreateBucketOutput>} An object containing the `bucketName`.*/diff --git a/packages/lambda/src/api/get-regions.ts b/packages/lambda/src/api/get-regions.tsindex 7550c0ee81..c8c3f480dc 100644--- a/packages/lambda/src/api/get-regions.ts+++ b/packages/lambda/src/api/get-regions.ts@@ -3,7 +3,7 @@ import {AWS_REGIONS} from '../regions';/*** @description Gets an array of all supported AWS regions of this release of Remotion Lambda.- * @link https://v3.remotion.dev/docs/lambda/getregions+ * @link https://remotion.dev/docs/lambda/getregions* @returns {AwsRegion[]} A list of AWS regions.*/export const getRegions = (): readonly AwsRegion[] => {diff --git a/packages/lambda/src/api/get-render-progress.ts b/packages/lambda/src/api/get-render-progress.tsindex cfa737c670..984eca375b 100644--- a/packages/lambda/src/api/get-render-progress.ts+++ b/packages/lambda/src/api/get-render-progress.ts@@ -11,7 +11,7 @@ export type GetRenderInput = {/*** @description Gets the current status of a render originally triggered via renderMediaOnLambda().- * @link https://v3.remotion.dev/docs/lambda/getrenderprogress+ * @link https://remotion.dev/docs/lambda/getrenderprogress* @param {string} params.functionName The name of the function used to trigger the render.* @param {string} params.bucketName The name of the bucket that was used in the render.* @param {string} params.renderId The ID of the render that was returned by `renderMediaOnLambda()`.diff --git a/packages/lambda/src/api/get-sites.ts b/packages/lambda/src/api/get-sites.tsindex f2f9cc5d77..f21a4024fa 100644--- a/packages/lambda/src/api/get-sites.ts+++ b/packages/lambda/src/api/get-sites.ts@@ -25,7 +25,7 @@ export type GetSitesOutput = {/**** @description Gets all the deployed sites for a certain AWS region.- * @link https://v3.remotion.dev/docs/lambda/getsites+ * @link https://remotion.dev/docs/lambda/getsites* @param {AwsRegion} params.region The AWS region that you want to query for.* @returns {Promise<GetSitesOutput>} A Promise containing an object with `sites` and `bucket` keys. Consult documentation for details.*/diff --git a/packages/lambda/src/api/iam-validation/simulate.ts b/packages/lambda/src/api/iam-validation/simulate.tsindex 2e968c425d..e5e985af39 100644--- a/packages/lambda/src/api/iam-validation/simulate.ts+++ b/packages/lambda/src/api/iam-validation/simulate.ts@@ -28,7 +28,7 @@ export type SimulatePermissionsOutput = {/*** @description Simulates calls using the AWS Simulator to validate the correct permissions.- * @link http://v3.remotion.dev/docs/lambda/simulatepermissions+ * @link http://remotion.dev/docs/lambda/simulatepermissions* @param {AwsRegion} options.region The region which you would like to validate* @param {(result: SimulationResult) => void} options.onSimulation The region which you would like to validate* @returns {Promise<SimulatePermissionsOutput>} See documentation for detailed response structure.diff --git a/packages/lambda/src/api/iam-validation/suggested-policy.ts b/packages/lambda/src/api/iam-validation/suggested-policy.tsindex 452809a7a9..435b188a1f 100644--- a/packages/lambda/src/api/iam-validation/suggested-policy.ts+++ b/packages/lambda/src/api/iam-validation/suggested-policy.ts@@ -31,7 +31,7 @@ const suggestedRolePolicy = {/*** @description Returns an inline JSON policy to be assigned to the AWS user whose credentials are being used for excuting CLI commands or calling Node.JS functions.- * @link https://v3.remotion.dev/docs/lambda/getuserpolicy+ * @link https://remotion.dev/docs/lambda/getuserpolicy*/export const getUserPolicy = () => JSON.stringify(suggestedPolicy, null, 2);@@ -40,6 +40,6 @@ export const ROLE_NAME = 'remotion-lambda-role';/*** @description Returns an inline JSON policy to be assigned to the 'remotion-lambda-role' role that needs to be created in your AWS account.- * @link https://v3.remotion.dev/docs/lambda/getrolepolicy+ * @link https://remotion.dev/docs/lambda/getrolepolicy*/export const getRolePolicy = () => JSON.stringify(suggestedRolePolicy, null, 2);diff --git a/packages/lambda/src/api/presign-url.ts b/packages/lambda/src/api/presign-url.tsindex faeba8d47d..cbed9f7622 100644--- a/packages/lambda/src/api/presign-url.ts+++ b/packages/lambda/src/api/presign-url.ts@@ -15,7 +15,7 @@ export type PresignURLInput = {/*** @description Returns a public url of an object stored in Remotion's S3 bucket.- * @link https://v3.remotion.dev/docs/lambda/presignurl+ * @link https://remotion.dev/docs/lambda/presignurl* @param {AwsRegion} params.region The region in which the S3 bucket resides in.* @param {string} params.bucketName The name of the bucket to fetch the object from.* @param {string} params.objectKey Key of the S3 object to get.diff --git a/packages/lambda/src/api/render-media-on-lambda.ts b/packages/lambda/src/api/render-media-on-lambda.tsindex 719d902492..a39d337de4 100644--- a/packages/lambda/src/api/render-media-on-lambda.ts+++ b/packages/lambda/src/api/render-media-on-lambda.ts@@ -45,7 +45,7 @@ export type RenderMediaOnLambdaOutput = {/*** @description Triggers a render on a lambda given a composition and a lambda function.- * @link https://v3.remotion.dev/docs/lambda/rendermediaonlambda+ * @link https://remotion.dev/docs/lambda/rendermediaonlambda* @param params.functionName The name of the Lambda function that should be used* @param params.serveUrl The URL of the deployed project* @param params.composition The ID of the composition which should be rendered.diff --git a/packages/lambda/src/api/render-still-on-lambda.ts b/packages/lambda/src/api/render-still-on-lambda.tsindex 07459de0f8..03de100a24 100644--- a/packages/lambda/src/api/render-still-on-lambda.ts+++ b/packages/lambda/src/api/render-still-on-lambda.ts@@ -38,7 +38,7 @@ export type RenderStillOnLambdaOutput = {/*** @description Renders a still frame on Lambda- * @link https://v3.remotion.dev/docs/lambda/renderstillonlambda+ * @link https://remotion.dev/docs/lambda/renderstillonlambda* @param params.functionName The name of the Lambda function that should be used* @param params.serveUrl The URL of the deployed project* @param params.composition The ID of the composition which should be rendered.diff --git a/packages/lambda/src/cli/commands/render/render.ts b/packages/lambda/src/cli/commands/render/render.tsindex fa6df20db8..8d4f83791b 100644--- a/packages/lambda/src/cli/commands/render/render.ts+++ b/packages/lambda/src/cli/commands/render/render.ts@@ -141,7 +141,8 @@ export const renderCommand = async (args: string[]) => {}));- for (let i = 0; i < 3000; i++) {+ // eslint-disable-next-line no-constant-condition+ while (true) {await sleep(1000);const newStatus = await getRenderProgress({functionName,@@ -159,7 +160,6 @@ export const renderCommand = async (args: string[]) => {}));- // Log.info(newStatus);if (newStatus.done) {progressBar.update(makeProgressString({diff --git a/packages/lambda/src/shared/aws-clients.ts b/packages/lambda/src/shared/aws-clients.tsindex 6c27761b6e..1d0155c0d1 100644--- a/packages/lambda/src/shared/aws-clients.ts+++ b/packages/lambda/src/shared/aws-clients.ts@@ -12,7 +12,14 @@ const _clients: Partial<AwsRegion,Record<string,- Record<string, CloudWatchLogsClient | LambdaClient | S3Client | IAMClient>+ Record<+ string,+ | CloudWatchLogsClient+ | LambdaClient+ | S3Client+ | IAMClient+ | ServiceQuotasClient+ >>>> = {};diff --git a/packages/lambda/src/shared/constants.ts b/packages/lambda/src/shared/constants.tsindex 56244527f3..e902c9308c 100644--- a/packages/lambda/src/shared/constants.ts+++ b/packages/lambda/src/shared/constants.ts@@ -13,9 +13,6 @@ import {EnhancedErrorInfo} from '../functions/helpers/write-lambda-error';import {AwsRegion} from '../pricing/aws-regions';import {LambdaArchitecture} from './validate-architecture';-// 10 minutes at 30fps-export const MAX_VIDEO_LENGTH = 18000;-export const MIN_MEMORY = 512;export const MAX_MEMORY = 10240;export const DEFAULT_MEMORY_SIZE = 2048;diff --git a/packages/lambda/src/shared/docs-url.ts b/packages/lambda/src/shared/docs-url.tsindex 9674412bdd..fb978efe57 100644--- a/packages/lambda/src/shared/docs-url.ts+++ b/packages/lambda/src/shared/docs-url.ts@@ -1 +1 @@-export const DOCS_URL = 'https://v3.remotion.dev';+export const DOCS_URL = 'https://remotion.dev';