Skip to main content

@remotion/lambda

Also available as a 11min video
将 Remotion Lambda 集成到你的应用中

AWS Lambda 上渲染 Remotion 视频。这是渲染 Remotion 视频最快且最可扩展的方式。 你只在渲染时支付费用,使其非常具有成本效益。

🌐 Render Remotion videos on AWS Lambda. This is the fastest and most scalable way to render Remotion videos.
You only pay while you are rendering, making it very cost-effective.

我什么时候应该使用它?

🌐 When should I use it?

如果这些限制中的任何一项对你来说是致命的,可以采用普通的服务器端渲染或考虑使用Cloud Run。 另请参阅:服务器端渲染选项比较

🌐 If one of those constraints is a dealbreaker for you, resort to normal server-side rendering or consider using Cloud Run.
See also: Comparison of server-side rendering options

它是如何运作的

🌐 How it works

  • 在 AWS 上创建了一个 Lambda 函数和一个 S3 存储桶。
  • 一个 Remotion 项目被部署到 S3 存储桶作为网站。
  • Lambda 函数被调用并打开 Remotion 项目。
  • 许多 Lambda 函数被并行创建,每个函数渲染视频的一小部分
  • 初始的 Lambda 函数下载视频并将它们拼接在一起。
  • 最终视频被上传到 S3 并可以下载。

详细了解:Remotion Lambda 的工作原理

🌐 See in more detail: How Remotion Lambda works

架构

🌐 Architecture

  • Lambda 函数:需要一个包含 Chromium 的层,目前由 Remotion 托管。只需要一个 Lambda 函数,但它可以执行不同的操作。
  • S3 存储桶:存储项目、渲染结果以及渲染元数据。
  • CLI:允许从命令行控制整体架构。通过将 @remotion/lambda 添加到项目中来安装。
  • Node.JS API:具有与 CLI 相同的功能,但在编程上更易于使用

设置 / 安装

🌐 Setup / Installation

请看这里

地区选择

🌐 Region selection

以下区域可用于 Remotion Lambda:

🌐 The following regions are available for Remotion Lambda:

  • eu-central-1
  • eu-central-2
  • eu-west-1
  • eu-west-2
  • eu-west-3
  • eu-south-1
  • eu-north-1
  • us-east-1
  • us-east-2
  • us-west-1
  • us-west-2
  • af-south-1
  • ap-south-1
  • ap-east-1
  • ap-southeast-1
  • ap-southeast-2
  • ap-northeast-1
  • ap-northeast-2
  • ap-northeast-3
  • ap-southeast-4
  • ap-southeast-5
  • ca-central-1
  • me-south-1
  • sa-east-1

在此查看配置和注意事项。

限制

🌐 Limitations

成本

🌐 Cost

我们的大多数用户只需花费几分钱就能渲染几分钟的视频。具体成本取决于地区、分配的内存、视频类型、并行化以及其他参数。对于每次渲染,我们会估算成本并显示给你。你可能还需要一个 Remotion 许可证(见下文)。

🌐 Most of our users render multiple minutes of video for just a few pennies. The exact cost is dependent on the region, assigned memory, type of video, parallelization and other parameters. For each render, we estimate a cost and display it to you. You might also need a Remotion license (see below).

AWS 权限

🌐 AWS permissions

Remotion Lambda 需要你创建一个 AWS 账户并创建一个附带某些权限的用户。我们仅需要操作 Remotion Lambda 所需的最少权限。

🌐 Remotion Lambda requires you to create an AWS account and create a user with some permissions attached to it. We require only the minimal amount of permissions required for operating Remotion Lambda.

阅读更多关于权限的信息

命令行接口

🌐 CLI

你可以使用 npx remotion lambda 命令来控制 Remotion Lambda。

🌐 You can control Remotion Lambda using the npx remotion lambda command.

阅读有关 CLI 的更多信息

Node.JS API

你可以使用 Node.JS API 控制所有可以使用 CLI 完成的操作。参考资料请点击这里

🌐 Everything you can do using the CLI, you can also control using Node.JS APIs. See the reference here.

许可证

🌐 License

适用标准 Remotion 许可: https://github.com/remotion-dev/remotion/blob/main/LICENSE.md

🌐 The standard Remotion license applies: https://github.com/remotion-dev/remotion/blob/main/LICENSE.md

需要许可证并使用云渲染的公司必须使用云渲染单元进行设置。请访问: https://remotion.pro/license

🌐 Companies needing a license and using cloud rendering must set it up with Cloud Rendering Units. Please visit: https://remotion.pro/license

卸载

🌐 Uninstalling

我们让你轻松地从 AWS 账户中删除所有 Remotion 资源,而不会留下任何痕迹或产生额外费用。

🌐 We make it easy to remove all Remotion resources from your AWS account without leaving any traces or causing further costs.

如何卸载 Remotion Lambda