服务端渲染
Remotion 的渲染引擎是用 Node.JS 构建的,这使得在云端渲染视频变得容易。
🌐 Remotion's rendering engine is built with Node.JS, which makes it easy to render a video in the cloud.
查看SSR 选项比较以帮助你决定哪种选项最适合你。
🌐 See the Comparison of SSR options to help you decide which option is best for you.
在 AWS Lambda 上渲染视频
🌐 Render a video on AWS Lambda
在云端渲染视频最快的方法是使用 @remotion/lambda。
🌐 The fastest way to render videos in the cloud is to use @remotion/lambda.
使用 Vercel Sandbox 渲染
🌐 Render using Vercel Sandbox
最简单的方法,特别是对于 Vercel 的客户,是使用 Vercel Sandbox。
🌐 The easiest way, especially for Vercel customers is to use Vercel Sandbox.
使用 Node.js API 渲染视频
🌐 Render a video using Node.js APIs
我们提供一套使用 Node.js 和 Bun 渲染视频的 API。
更多信息请参见示例或API参考。
🌐 We provide a set of APIs to render videos using Node.js and Bun.
See an example or the API reference for more information.
使用 GitHub Actions 渲染
🌐 Render using GitHub Actions
你可以在 GitHub Actions 上渲染视频。以下工作流程假设作曲 ID 为 MyComp
🌐 You can render a video on GitHub actions. The following workflow assumes a composition ID of MyComp
name: Render video
on:
workflow_dispatch:
jobs:
render:
name: Render video
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- uses: actions/setup-node@main
- run: npm i
- run: npx remotion render MyComp out/video.mp4
- uses: actions/upload-artifact@v4
with:
name: out.mp4
path: out/video.mp4带输入属性
🌐 With input props
如果你有属性,你可以使用 GitHub Actions 的输入字段来请求它们。
这里我们假设形状为 {titleText: string; titleColor: string}。
🌐 If you have props, you can ask for them using the GitHub Actions input fields.
Here we assume a shape of {titleText: string; titleColor: string}.
name: Render video
on:
workflow_dispatch:
inputs:
titleText:
description: 'Which text should it say?'
required: true
default: 'Welcome to Remotion'
titleColor:
description: 'Which color should it be in?'
required: true
default: 'black'
jobs:
render:
name: Render video
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- uses: actions/setup-node@main
- run: npm i
- run: echo $WORKFLOW_INPUT > input-props.json
env:
WORKFLOW_INPUT: ${{ toJson(github.event.inputs) }}
- run: npx remotion render MyComp out/video.mp4 --props="./input-props.json"
- uses: actions/upload-artifact@v4
with:
name: out.mp4
path: out/video.mp4Actions 标签。Render video 工作流。Run workflow 按钮。点击它。Run workflow。Artifacts 下下载视频。请注意,运行工作流可能会产生费用。然而,工作流只有在你主动触发时才会运行。
🌐 Note that running the workflow may incur costs. However, the workflow will only run if you actively trigger it.
🌐 See also: Passing input props in GitHub Actions
使用 Docker 渲染视频
🌐 Render a video using Docker
🌐 See: Dockerizing a Remotion project
使用 GCP Cloud Run(Alpha)渲染视频
🌐 Render a video using GCP Cloud Run (Alpha)
查看实验性的 Cloud Run 包。 注意:它目前没有积极开发——我们的计划是将 Lambda 运行时移植到 Cloud Run,而不是维护一个单独的实现。
🌐 Check out the experimental Cloud Run package.
Note: It not actively being developed - our plan is to port the Lambda runtime to Cloud Run instead of maintaining a separate implementation.
API 参考
🌐 API reference