Skip to main content

为 Remotion 做贡献

各种问题和拉取请求都欢迎!

🌐 Issues and pull requests of all sorts are welcome!

对于较大的项目,请与 Jonny Burger (jonny@remotion.dev, Discord: @jonnyburger) 协调,以确保你的更改能够被合并。

请注意,由于当公司使用 Remotion 时我们会收取费用,因此这是一个商业项目。 通过发送拉取请求,你同意我们可以在商业环境中使用你的代码更改。

🌐 Please note that since we charge for Remotion when companies are using it, this is a commercial project.
By sending pull requests, you agree that we can use your code changes in a commercial context.

此外,请注意你不能重新分发这个项目。有关允许和不允许的内容,请参见 LICENSE.md

🌐 Furthermore, also note that you cannot redistribute this project. Please see LICENSE.md for what's allowed and what's not.

本项目已随附 贡献者行为准则 发布。通过参与本项目,你同意遵守其条款。

🌐 This project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

设置

🌐 Setup

Remotion 在此仓库的开发中使用 Bun v1.3.3 作为包管理器。版本必须至少为 1.3.3

curl -fsSL https://bun.com/install | bash -s "bun-v1.3.3"

克隆 Remotion 仓库:

git clone --depth=1 https://github.com/remotion-dev/remotion.git && cd remotion
note

Remotion 的完整 Git 历史很大。为了节省时间和磁盘空间,我们建议只添加 --depth=1 来克隆最近的 main 分支。

安装所有依赖:

bun i

最初构建项目:

bun run build

每当文件更改时重新构建:

bun run watch

你可以开始进行更改了!

来自 pnpm

🌐 Coming from pnpm

在使用 Bun 之前,我们使用 pnpm 作为包管理器。如果你是从 pnpm 转过来的,你需要在运行 bun i 之前先清除所有的 node_modules 文件夹。

🌐 Before using Bun, we used pnpm as the package manager. If you are coming from pnpm, you need to wipe all node_modules folders first before you run bun i.

bun run cleanall

测试你的更改

🌐 Testing your changes

你可以使用以下方式启动测试平台

🌐 You can start the Testbed using

cd packages/example
bun run dev

你可以使用以下方式渲染测试视频

🌐 You can render a test video using

cd packages/example
bunx remotion render

你可以使用……运行测试

🌐 You can run tests using

bun run test

可以在子包中运行该包的测试,也可以在根目录中运行所有测试。

🌐 in either a subpackage to run tests for that package or in the root to run all tests.

运行 @remotion/player 测试平台

🌐 Running the @remotion/player testbed

你可以通过启动 Player 测试环境来测试对 @remotion/player 的更改:

🌐 You can test changes to @remotion/player by starting the Player testbed:

cd packages/player-example
bun run dev

有关测试 Remotion 组件的信息,请查阅 测试 Remotion 组件 页面。各种问题和拉取请求都欢迎!

🌐 For information about testing Remotion components, please consult the Testing Remotion components page. Issues and pull requests of all sorts are welcome!

运行文档

🌐 Running documentation

你可以使用以下命令运行驱动我们文档的 Docusaurus 服务器:

🌐 You can run the Docusaurus server that powers our docs using:

cd packages/docs
bun run start

运行命令行接口

🌐 Running the CLI

你可以通过切换到 packages/example 目录并使用 bunx 来执行 CLI,从而测试对 CLI 的更改:

🌐 You can test changes to the CLI by moving to packages/example directory and using bunx to execute the CLI:

cd packages/example
# Example - Get available compositions
bunx remotion compositions
# Example - Render command
bunx remotion render ten-frame-tester --output ../../out/video.mp4

测试 Remotion Lambda

🌐 Testing Remotion Lambda

packages/example 中,有一个 runlambda.sh 脚本,它将重建 Lambda 函数的代码,移除任何已部署的 Lambda 函数,部署一个新的函数并渲染视频。 你需要将你的 AWS 凭证 放入 packages/example 目录下的 .env 文件中。

🌐 In packages/example, there is a runlambda.sh script that will rebuild the code for the Lambda function, remove any deployed Lambda functions, deploy a new one and render a video.
You need to put you AWS credentials in a .env file of the packages/example directory.

cd packages/example
sh ./runlambda.sh
note

这将删除你账户中的任何 Lambda 函数!

测试 Remotion 云运行

🌐 Testing Remotion Cloud Run

packages/example 中,有一个 runcloudrun.sh 脚本,它将重建 Cloud Run 功能的代码,移除任何已部署的 Cloud Run 服务,部署一个新的服务并渲染视频。 你需要将你的 GCP 凭证 放在 packages/example 目录下的 .env 文件中。

🌐 In packages/example, there is a runcloudrun.sh script that will rebuild the code for the Cloud Run function, remove any deployed Cloud Run services, deploy a new one and render a video.
You need to put you GCP credentials in a .env file of the packages/example directory.

cd packages/example
sh ./runcloudrun.sh
note

这将删除你账户中的任何 Cloud Run 服务!

故障排除

🌐 Troubleshooting

如果你的 bun run build 抛出错误,通常是由于缓存问题。你可以通过运行以下命令解决其中的许多错误

🌐 If your bun run build throws errors, oftentimes it is because of caching issues. You can resolve many of these errors by running

bun run clean

在根目录中。确保事先终止任何 bun run watch 命令,因为在清理文件时它们可能会重新生成文件!

🌐 in the root directory. Make sure to beforehand kill any bun run watch commands, as those might regenerate files as you clean them!

开发新的过渡演示文稿

🌐 Developing new transition presentations

要开发新的过渡演示,请参阅这里

🌐 To develop new transition presentations, see here.

开发 Rust 部分

🌐 Developing Rust parts

要开发 Remotion 的 Rust 部分,请参见 这里

🌐 To develop the Rust parts of Remotion, see here.

另请参阅

🌐 See also