Skip to main content

运行时

本页面描述了 Lambda 函数运行的环境。

🌐 This page describes the environment that the Lambda function is running in.

Node.JS 版本

🌐 Node.JS Version

Remotion 版本Node.js 发行线路锁定的运行时 ARN
从 v4.0.41524.xarn:aws:lambda:{region}::runtime:58a37e8413ed69058c4ac3b1df642118591f17d40def93d6101f867c72cd03c2
从 v4.0.37920.xarn:aws:lambda:{region}::runtime:da57c20c4b965d5b75540f6865a35fc8030358e33ec44ecfed33e90901a27a72
从 v4.0.37622.xarn:aws:lambda:{region}::runtime:bbff6dbb70f7ec465eee20d07035db8b2d55506273cd6188d5bf1123c218e508
从 4.0.24620.xarn:aws:lambda:{region}::runtime:da57c20c4b965d5b75540f6865a35fc8030358e33ec44ecfed33e90901a27a72
在 v4.0.245 之前18.x-

目前,Remotion Lambda 仍然使用 20.x 运行时,因为在更高版本中经历了不稳定性。

🌐 Currently Remotion Lambda continues to use the 20.x runtime since instability was experienced with higher versions.

如果你的 用户政策 包含 lambda:PutRuntimeManagementConfig(如果你在 2023 年 11 月之后设置 Remotion Lambda,则默认包含),Lambda 运行时将锁定为显示的你的 Remotion 版本的 ARN(推荐)。

🌐 If your user policy includes lambda:PutRuntimeManagementConfig (included by default if you set up Remotion Lambda after November 2023), the Lambda runtime will be locked to the ARN shown for your Remotion version (recommended).

否则,AWS 对运行时的未来更新可能会导致函数失效。如果你的策略中没有此权限,将会打印警告。

🌐 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.

内存大小

🌐 Memory size

默认值是 2048 MB。你可以通过向deployFunction()传递参数,或者在部署函数时向CLI传递--memory标志来进行配置。

超时

🌐 Timeout

默认值是 120 秒。你可以在调用deployFunction()时配置它,或者在部署函数时通过向CLI传递--timeout标志来配置它。

请注意,你可能不需要增加它——由于视频是通过将其分成许多部分进行渲染,并且这些部分是并行渲染的,所以很少有情况下你需要超过 120 秒。

存储空间

🌐 Storage space

该功能总共可用的用于视频渲染的存储空间在512MB到10GB之间,具体取决于你的配置。请记住,将各种片段拼接成一个视频是在 Lambda 函数内进行的,因此空间必须足够容纳这些片段和输出视频。

🌐 The function has between 512MB and 10GB of storage space in total available for video rendering depending on your configuration. Keep in mind that the concatenations of various chunks into one video takes place within a Lambda function, so the space must suffice for both the chunks and the output video.

核心数 / 虚拟CPU

🌐 Core count / vCPUs

Lambda 内部的核心数量取决于你分配给它的内存量。根据 这项研究,这些是分级:

🌐 The amount of cores inside a Lambda is dependent on the amount of memory you give it. According to this research, these are the tiers:

内存vCPU数
128 - 3008 MB2
3009 - 5307 MB3
5308 - 7076 MB4
7077 - 8845 MB5
8846+ MB6

你可以通过使用 concurrencyPerLambda 选项在 Lambda 函数中一次渲染多个帧。

🌐 You can render multiple frames at once inside a Lambda function by using the concurrencyPerLambda option.

谷歌浏览器

🌐 Chrome

该功能已经包含了可运行的 Chrome 版本。浏览器在编译时包含了专有编解码器,因此你可以将 MP4 视频包含到你的项目中。

🌐 The 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 版本Chrome 版本
从 4.0.415144.0.7559.20
从 4.0.274133.0.6943.141
从 4.0.245123.0.6312.86
从 4.0.0114.0.5731.1
从 3.2.0104.0.5112.64
从 3.0.8101.0.4951.68
从 3.0.098.0.4758.139

FFmpeg

内置于 @remotion/renderer 的 FFmpeg 正在 Lambda 上使用。

🌐 The FFmpeg which is built into @remotion/renderer is being used on Lambda.

字体

🌐 Fonts

该功能包括以下字体:

🌐 The function includes the following fonts:

  • Noto 彩色表情符号
  • Noto Sans 黑体
  • Noto Sans 粗体
  • Noto Sans 常规
  • Noto Sans 半粗体
  • Noto Sans 极细
  • Noto Sans 阿拉伯语 常规
  • Noto Sans 德瓦纳加里 常规
  • Noto Sans 希伯来文 常规
  • Noto Sans 泰米尔语 常规
  • Noto Sans 泰文 常规

自2021年12月起,以下字体也仅在Remotion Lambda的arm64版本中可用:

🌐 Since December 2021 the following fonts are also available only on the arm64 version of Remotion Lambda:

  • 思源黑体简体中文 常规
  • 思源黑体简体中文 粗体
  • Noto Sans 繁体中文 常规
  • Noto Sans 繁体中文 粗体
  • Noto Sans 韩文 常规
  • Noto Sans 韩文 粗体
  • Noto Sans 日语 常规
  • Noto Sans 日语 粗体

如果你想使用不同的字体,我们建议使用网页字体。

🌐 If you'd like to use different fonts, we recommend using Webfonts.

虽然我们可以包含的默认字体集必须保持较小以节省空间,但如果你遇到无法呈现字符的情况,我们很乐意听取反馈。

🌐 While the set of default fonts that we can include must be kept small in order to save space, we are happy to hear feedback if you encounter a scenario where characters cannot be rendered.

自定义图层

🌐 Customize layers

参见:自定义 Lambda 层 以了解如何自定义此堆栈。

🌐 See: Customize Lambda layers to learn about how you can customize this stack.

另请参阅

🌐 See also