命令行参考
如何使用
您可以通过安装 @remotion/cli
并运行以下命令来运行 CLI:
- 在 npm 项目中运行
npx remotion
- 在 Yarn 项目中运行
yarn remotion
- 在 pnpm 项目中运行
pnpm exec remotion
- 在 Bun 项目中运行
bunx remotion
为简洁起见,在文档中我们总是使用 npx remotion
。
在 npm 脚本中,您不需要 npx
前缀:
package.jsonjson
{"scripts": {"render": "remotion render"}}
package.jsonjson
{"scripts": {"render": "remotion render"}}
使用 Bunv4.0.118
默认情况下,npx remotion
命令是使用 Node 执行的。
即使 bunx remotion
也是使用 Node,除非您添加 --bun
标志。
要使用 Bun,请将 remotion
替换为 remotionb
。
package.jsonjson
{"scripts": {"render": "remotionb render"}}
package.jsonjson
{"scripts": {"render": "remotionb render"}}
命令
以下命令可用 - 您可以始终使用 npx remotion
运行它们,甚至如果将命令放在 npm 脚本中,则无需 npx
前缀。
studio
Start the Remotion Studio
render
Render video or audio
still
Render a still image
compositions
List available compositions
lambda
Control Remotion Lambda
bundle
Create a Remotion Bundle
browser
Ensure Remotion has a browser to use
cloudrun
Control Remotion Cloud Run
benchmark
Measure and optimize render time
versions
List and validate Remotion package versions
upgrade
Upgrade to a newer version
gpu
Print information about Chrome's usage of the GPU
ffmpeg
Execute an
ffmpeg
commandffprobe
Execute an
ffprobe
commandhelp
Show CLI commands
示例命令
npx remotion render --codec=vp8 HelloWorld out/video.webm
npx remotion render --codec=vp8 HelloWorld out/video.webm
Fig.io 自动补全
安装 Fig(仅限 macOS)以将 Remotion 自动补全添加到您的终端。
键入 npx remotion
开始获取建议。