🎥 Make videos programmatically with React
almost done
Jonny Burger8bc2c0002c07
diff --git a/packages/docs/docs/lambda/runtime.mdx b/packages/docs/docs/lambda/runtime.mdxindex 45eb1ad9a6..8fa53a912a 100644--- a/packages/docs/docs/lambda/runtime.mdx+++ b/packages/docs/docs/lambda/runtime.mdx@@ -3,31 +3,28 @@ image: /generated/articles-docs-lambda-runtime.pngid: runtimetitle: Runtimeslug: /lambda/runtime-crumb: "Lambda"+crumb: '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 uses a NodeJS version from the `18.x` release line.+_from v4.0.245_++The Lambda function uses a NodeJS version from the `20.x` release line.The Lambda runtime will get locked to```-arn:aws:lambda:${region}::runtime:b97ad873eb5228db2e7d5727cd116734cc24c92ff1381739c4400c095404a2d3+arn:aws:lambda:${region}::runtime:da57c20c4b965d5b75540f6865a35fc8030358e33ec44ecfed33e90901a27a72```if your user policy includes `lambda:PutRuntimeManagementConfig`, which is recommended.Otherwise, 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>.-</details>-## Memory sizeThe default is <DefaultMemorySize/> MB. You can configure it by passing an argument to [`deployFunction()`](/docs/lambda/deployfunction) or by passing a `--memory` flag to the CLI when deploying a function.@@ -61,35 +58,17 @@ 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 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--Since Remotion 4.0, the function already includes an FFMPEG 6.0 binary that was compiled to support all [codecs](/docs/encoding) that Remotion supports.--<details>-<summary>-Before v4.0.0-</summary>-Version built from source: <code>N-104627-g40cf317d09</code> (corresponds to v4.4)-Configuration:+| Remotion version | Chrome version |+| ---------------- | -------------- |+| From 4.0.0245 | 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 |-<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-</pre>+## FFmpeg-</details>+The FFmpeg which is built into `@remotion/renderer` is being used on Lambda.## Fonts@@ -126,17 +105,6 @@ 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 [`npx remotion lambda functions deploy`](/docs/lambda/cli/functions#deploy) command.-## See also- [Customize Lambda layers](/docs/lambda/custom-layers)diff --git a/packages/lambda/src/admin/make-layer-public.ts b/packages/lambda/src/admin/make-layer-public.tsindex cc6af86cfb..ffbd688978 100644--- a/packages/lambda/src/admin/make-layer-public.ts+++ b/packages/lambda/src/admin/make-layer-public.ts@@ -6,6 +6,7 @@ import {import {VERSION} from 'remotion/version';import {getRegions} from '../api/get-regions';import {quit} from '../cli/helpers/quit';+import type {AwsRegion} from '../regions';import {getLambdaClient} from '../shared/aws-clients';import type {HostedLayers} from '../shared/hosted-layers';@@ -36,6 +37,10 @@ const layerInfo: HostedLayers = {'eu-central-2': [],};+const getBucketName = (region: AwsRegion) => {+ return `remotionlambda-binaries-${region}`;+};+const makeLayerPublic = async () => {const runtimes: Runtime[] = ['nodejs20.x'];@@ -52,7 +57,7 @@ const makeLayerPublic = async () => {const {Version, LayerArn} = await getLambdaClient(region).send(new PublishLayerVersionCommand({Content: {- S3Bucket: 'remotionlambda-binaries-' + region,+ S3Bucket: getBucketName(region),S3Key:layer === 'emoji-apple'? 'remotion-layer-emoji-v1-arm64.zip'diff --git a/packages/lambda/src/shared/get-layers.ts b/packages/lambda/src/shared/get-layers.tsindex 5ea2adfb5c..cb1d980093 100644--- a/packages/lambda/src/shared/get-layers.ts+++ b/packages/lambda/src/shared/get-layers.ts@@ -1,6 +1,6 @@import type {AwsRegion} from '../regions';import type {AwsLayer} from './hosted-layers';-import {v5HostedLayers} from './hosted-layers';+import {hostedLayers} from './hosted-layers';const runtimePreferenceOptions = ['default', 'apple-emojis', 'cjk'] as const;@@ -27,7 +27,7 @@ export const getLayers = ({option: RuntimePreference;region: AwsRegion;}): AwsLayer[] => {- const layers = v5HostedLayers[region];+ const layers = hostedLayers[region];return layers.filter((layer) => {if (layer.layerArn.includes('emoji-apple')) {return option === 'apple-emojis';