@remotion/cloudrun
Cloud Run 处于 Alpha 状态,且尚未积极开发。
在 GCP Cloud Run 上渲染 Remotion 视频。
🌐 Render Remotion videos on GCP Cloud Run.
我什么时候应该使用它?
🌐 When should I use it?
- 你可以在 支持的区域 使用 Google Cloud Platform。
如果其中一个限制对你来说是无法接受的,那就使用普通的 服务器端渲染。
🌐 If one of those constraints is a dealbreaker for you, resort to normal server-side rendering.
它是如何运作的
🌐 How it works
部署
🌐 Deployment
- 每当 Remotion 团队发布新版本时,一个新的镜像将被上传到 GCP 中可公开读取的制品注册表。
- 当你将一个新的 Cloud Run 服务部署到你的 GCP 项目时,它默认会从仓库下载最新的镜像。如果你需要特定的版本,可以在命令中指定。
渲染
🌐 Rendering
- 在 GCP 中创建了一个 Cloud Run 服务和一个 Cloud Storage 存储桶。
- 一个 Remotion 项目被部署到云存储桶作为网站。
- Cloud Run 服务被调用并打开 Remotion 项目。
- Cloud Run 服务呈现视频或静态图片,最终文件会上传到 Cloud Storage 并可供下载。
架构
🌐 Architecture
- Cloud Run 服务:包含渲染 Remotion 项目所需的库和二进制文件,并可通过 URL 调用。
- 云存储桶:存储项目、渲染文件以及渲染元数据。
- CLI:允许从命令行控制整体架构。通过将
@remotion/cloudrun添加到项目中来安装。 - Node.JS API:具有与 CLI 相同的功能,但在编程使用上更容易。
设置 / 安装
🌐 Setup / Installation
地区选择
🌐 Region selection
以下地区可用于 Remotion Cloud Run:
🌐 The following regions are available for Remotion Cloud Run:
asia-east1asia-east2asia-northeast1asia-northeast2asia-northeast3asia-south1asia-south2asia-southeast1asia-southeast2australia-southeast1australia-southeast2europe-central2europe-north1europe-southwest1europe-west1europe-west2europe-west3europe-west4europe-west6europe-west8europe-west9me-west1northamerica-northeast1northamerica-northeast2southamerica-east1southamerica-west1us-central1us-east1us-east4us-east5us-south1us-west1us-west2us-west3us-west4
配额和限制
🌐 Quotas and Limits
有关所有最新数值,请查阅官方 Cloud Run 文档。
🌐 For all up-to-date values, check the official Cloud Run docs.
- 最大内存容量为32GB。
- vCPU 的最大数量是 8。
- 受实例内存限制,最大可写入的内存文件系统为32GB。
- 最大超时时间为60分钟。
成本
🌐 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 and other parameters. You might also need a Remotion license (see below).
GCP 权限
🌐 GCP permissions
Remotion Cloud Run 要求你创建一个 GCP 项目并创建一个附带某些权限的服务账户。我们只需要操作 Remotion Cloud Run 所需的最少权限。服务账户权限列表及原因。
🌐 Remotion Cloud Run requires you to create a GCP project and create a Service Account with some permissions attached to it. We require only the minimal amount of permissions required for operating Remotion Cloud Run. Service Account permission list and reasons.
命令行接口
🌐 CLI
你可以使用 npx remotion cloudrun 命令来控制 Remotion Cloud Run。
🌐 You can control Remotion Cloud Run using the npx remotion cloudrun command.
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
我们使你可以轻松地从 GCP 项目中删除所有 Remotion 资源,而不会留下任何痕迹或产生额外费用。
🌐 We make it easy to remove all Remotion resources from your GCP project without leaving any traces or causing further costs.