🎥 Make videos programmatically with React
new runtime docs
Jonny Burger6d67923bba51
diff --git a/packages/docs/docs/lambda/runtime.md b/packages/docs/docs/lambda/runtime.mdxsimilarity index 72%rename from packages/docs/docs/lambda/runtime.mdrename to packages/docs/docs/lambda/runtime.mdxindex fd946224b2..e771aafe9e 100644--- a/packages/docs/docs/lambda/runtime.md+++ b/packages/docs/docs/lambda/runtime.mdx@@ -6,14 +6,14 @@ slug: /lambda/runtimecrumb: "Lambda"----import {DefaultMemorySize} from '../../components/lambda/default-memory-size';-import {DefaultTimeout} from '../../components/lambda/default-timeout';+import { DefaultMemorySize } from "../../components/lambda/default-memory-size";+import { DefaultTimeout } from "../../components/lambda/default-timeout";This page describes the environment that the Lambda function is running in.## Node.JS Version-The lambda function will use a NodeJS version from the `18.x` release line.+The Lambda uses a NodeJS version from the `18.x` release line.The Lambda runtime will get locked to```@@ -24,10 +24,8 @@ if your user policy includes `lambda:PutRuntimeManagementConfig`, which is recomOtherwise, future updates to the runtime by AWS have the potential to break the function. If you don't have this permission in your policy, a warning will be printed.<details>-<summary>-Changelog-</summary>-Before Remotion v4.0.0, the Node.JS version was <code>14.x</code>.+ <summary>Changelog</summary>+ Before Remotion v4.0.0, the Node.JS version was <code>14.x</code>.</details>## Memory size@@ -63,12 +61,13 @@ You can render multiple frames at once inside a Lambda function by using the [`cThe function already includes a running version of Chrome.The browser was compiled including the proprietary codecs, so you can include MP4 videos into your project.-| Remotion version | Chrome version |-| ---------------- | -------------- |-| From 4.0.0 | 114.0.5731.1 |-| From 3.2.0 | 104.0.5112.64 |-| From 3.0.8 | 101.0.4951.68 |-| From 3.0.0 | 98.0.4758.139 |+| Remotion version | Chrome version |+| --------------------- | -------------- |+| From 5.0.0 (upcoming) | 123.0.6312.86 |+| From 4.0.0 | 114.0.5731.1 |+| From 3.2.0 | 104.0.5112.64 |+| From 3.0.8 | 101.0.4951.68 |+| From 3.0.0 | 98.0.4758.139 |## FFMPEG@@ -82,8 +81,14 @@ Version built from source: <code>N-104627-g40cf317d09</code> (corresponds to v4.Configuration:<pre>---prefix=/home/ec2-user/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/ec2-user/ffmpeg_build/include --extra-ldflags=-L/home/ec2-user/ffmpeg_build/lib --extra-libs=-lpthread --extra-libs=-lm --bindir=/home/ec2-user/bin --enable-gpl --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree+ --prefix=/home/ec2-user/ffmpeg_build --pkg-config-flags=--static+ --extra-cflags=-I/home/ec2-user/ffmpeg_build/include+ --extra-ldflags=-L/home/ec2-user/ffmpeg_build/lib --extra-libs=-lpthread+ --extra-libs=-lm --bindir=/home/ec2-user/bin --enable-gpl --enable-libfdk-aac+ --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvpx+ --enable-libx264 --enable-libx265 --enable-nonfree</pre>+</details>## Fonts@@ -121,6 +126,17 @@ While the set of default fonts that we can include must be kept small in order tSee: [Customize Lambda layers](/docs/lambda/custom-layers) to learn about how you can customize this stack.+## Runtime changes in Remotion 5.0++Remotion 5.0 will use the following runtime:++- Node.js 20.x instead of 18.x+- Chrome 123.0.6312.86 instead of 114.0.5731.1.+- AWS Lambda runtime locked to `arn:aws:lambda:${region}::runtime:b97ad873eb5228db2e7d5727cd116734cc24c92ff1381739c4400c095404a2d3`++Available from v4.0.148: You may opt to use the new runtime by setting `enableV5Runtime: true` in the [`deployFunction()`](/docs/lambda/deployfunction) function.+If you use the CLI, pass `enable-v5-runtime` to the CLI.+## See also- [Customize Lambda layers](/docs/lambda/custom-layers)diff --git a/packages/lambda/src/api/deploy-function.ts b/packages/lambda/src/api/deploy-function.tsindex 8f8caf4d40..c1bfe308a8 100644--- a/packages/lambda/src/api/deploy-function.ts+++ b/packages/lambda/src/api/deploy-function.ts@@ -1,5 +1,6 @@import type {LogLevel} from '@remotion/renderer';import {NoReactAPIs} from '@remotion/renderer/pure';+import {NoReactInternals} from 'remotion/no-react';import {VERSION} from 'remotion/version';import {getFunctions} from '../api/get-functions';import type {AwsRegion} from '../pricing/aws-regions';@@ -33,6 +34,7 @@ type OptionalParameters = {enableLambdaInsights: boolean;indent: boolean;logLevel: LogLevel;+ enableV5Runtime: boolean;};export type DeployFunctionInput = MandatoryParameters &@@ -43,7 +45,7 @@ export type DeployFunctionOutput = {alreadyExisted: boolean;};-const internalDeployFunction = async (+export const internalDeployFunction = async (params: MandatoryParameters & OptionalParameters,): Promise<DeployFunctionOutput> => {validateMemorySize(params.memorySizeInMb);@@ -89,6 +91,7 @@ const internalDeployFunction = async (ephemerealStorageInMb: params.diskSizeInMb,customRoleArn: params.customRoleArn as string,enableLambdaInsights: params.enableLambdaInsights ?? false,+ enableV5Runtime: params.enableV5Runtime,});if (!created.FunctionName) {@@ -127,6 +130,7 @@ export const deployFunction = ({enableLambdaInsights,indent,logLevel,+ enableV5Runtime,...options}: DeployFunctionInput) => {const diskSizeInMb = options.diskSizeInMb ?? DEFAULT_EPHEMERAL_STORAGE_IN_MB;@@ -142,5 +146,7 @@ export const deployFunction = ({region,timeoutInSeconds,cloudWatchLogRetentionPeriodInDays,+ enableV5Runtime:+ enableV5Runtime ?? NoReactInternals.ENABLE_V5_BREAKING_CHANGES,});};diff --git a/packages/lambda/src/cli/commands/functions/deploy.ts b/packages/lambda/src/cli/commands/functions/deploy.tsindex d46144fd0d..fefd67b78a 100644--- a/packages/lambda/src/cli/commands/functions/deploy.ts+++ b/packages/lambda/src/cli/commands/functions/deploy.ts@@ -1,7 +1,7 @@import {CliInternals} from '@remotion/cli';import type {LogLevel} from '@remotion/renderer';import {VERSION} from 'remotion/version';-import {deployFunction} from '../../../api/deploy-function';+import {internalDeployFunction} from '../../../api/deploy-function';import {DEFAULT_CLOUDWATCH_RETENTION_PERIOD,DEFAULT_EPHEMERAL_STORAGE_IN_MB,@@ -28,6 +28,7 @@ export const functionsDeploySubcommand = async (logLevel: LogLevel) => {parsedLambdaCli['enable-lambda-insights'] ?? false;const cloudWatchLogRetentionPeriodInDays =parsedLambdaCli['retention-period'] ?? DEFAULT_CLOUDWATCH_RETENTION_PERIOD;+ const enableV5Runtime = parsedLambdaCli['enable-v5-runtime'] ?? undefined;validateMemorySize(memorySizeInMb);validateTimeout(timeoutInSeconds);@@ -59,7 +60,7 @@ Lambda Insights Enabled = ${enableLambdaInsights}indent: false,});output.update('Deploying Lambda...', false);- const {functionName, alreadyExisted} = await deployFunction({+ const {functionName, alreadyExisted} = await internalDeployFunction({createCloudWatchLogGroup,region,timeoutInSeconds,@@ -68,6 +69,9 @@ Lambda Insights Enabled = ${enableLambdaInsights}diskSizeInMb,customRoleArn,enableLambdaInsights,+ enableV5Runtime,+ indent: false,+ logLevel,});if (CliInternals.quietFlagProvided()) {CliInternals.Log.info({indent: false, logLevel}, functionName);