🎥 Make videos programmatically with React
docs for contributing rust code
Jonny Burger18e69bce6065
diff --git a/packages/docs/docs/contributing/rust.md b/packages/docs/docs/contributing/rust.mdnew file mode 100644index 0000000000..ac0efad56e--- /dev/null+++ b/packages/docs/docs/contributing/rust.md@@ -0,0 +1,60 @@+---+image: /generated/articles-docs-contributing-rust.png+title: Contributing Rust code+sidebar_label: Rust code+crumb: Contributing+---++# Rust development++To participate in the development of the Rust parts of Remotion, you need to do additional steps.+These are entirely optional if you only touch the TypeScript parts.++## Setup++First, install Cargo, if you don't have it, or upgrade to a version that supports `edition-2021`:++```sh+curl https://sh.rustup.rs -sSf | sh+```++## Building++To build the Rust parts for your operating system, run:++```sh+node build.mjs+```++while you are in the `packages/renderer` directory.++## Building for all platforms++These instructions currently are for macOS. Contributions for other platforms are appreciated.++To build the Rust binaries for all supported platforms, you need to install their toolchains:++```sh+node install-toolchains.mjs+```++You can then build all binaries with:++```+pnpm build-all+```++in the `packages/renderer` package. The resulting artifacts should be checked into Git.++## Architecture++### Development workflow++- Remotion has platform specific packages like `compositor-darwin-arm64` and a user will only install packages that are specific to their operating system.+- The Rust code will be compiled into your native `compositor` package by default, unless you compile for all platforms.+- Resulting binaries are committed to Git so that people who don't setup Rust can develop too.++### FFmpeg bindings++- Both the Rust binary as well as the FFmpeg binaries use the shared libraries located in the `ffmpeg/remotion/lib` folder of each compositor package.+- Those shared libraries and FFmpeg binaries come from the [`rust-ffmpeg-splitter`](https://github.com/remotion-dev/rust-ffmpeg-splitter) repository. They are built in CircleCI as well as on a M1 Macbook and pasted into the [`rust-ffmpeg-sys`](https://github.com/remotion-dev/rust-ffmpeg-sys) project. The `rust-ffmpeg-sys` project is a dependency of [`rust-ffmpeg`](https://github.com/remotion-dev/rust-ffmpeg) which is a dependency of the main Remotion project. Refer to those repositories to learn how to build them.diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.jsindex 806c1da973..04f3f6d450 100644--- a/packages/docs/sidebars.js+++ b/packages/docs/sidebars.js@@ -567,6 +567,7 @@ module.exports = {"contributing/option","contributing/docs","contributing/bounty",+ "contributing/rust",],},"license",diff --git a/packages/docs/src/data/articles.ts b/packages/docs/src/data/articles.tsindex ce85709ee2..028aa75b0d 100644--- a/packages/docs/src/data/articles.ts+++ b/packages/docs/src/data/articles.ts@@ -265,6 +265,13 @@ export const articles = [compId: "articles-docs-contributing-option",crumb: "Contributing",},+ {+ id: "contributing/rust",+ title: "Contributing Rust code",+ relativePath: "docs/contributing/rust.md",+ compId: "articles-docs-contributing-rust",+ crumb: "Contributing",+ },{id: "data-fetching",title: "Data fetching",diff --git a/packages/docs/static/generated/articles-docs-contributing-rust.png b/packages/docs/static/generated/articles-docs-contributing-rust.pngnew file mode 100644index 0000000000..9a7b29370cBinary files /dev/null and b/packages/docs/static/generated/articles-docs-contributing-rust.png differdiff --git a/packages/renderer/README.md b/packages/renderer/README.mdindex bf51929b42..47d42cbf1d 100644--- a/packages/renderer/README.md+++ b/packages/renderer/README.md@@ -1,41 +1,9 @@-# Rust development+# Renderer-To participate in the development of the Rust parts of Remotion, you need to do additional steps. If you don't want to change the Rust code, you don't have to set anything up.+Contains TypeScript + Rust code for rendering a Remotion video.-## Setup+See the public APIs here: https://remotion.dev/docs/renderer-These are instructions for macOS. Contributions for other platforms are appreciated.+## Development-First, install Cargo, if you don't have it, or upgrade to a version that supports `edition-2021`:--```-curl https://sh.rustup.rs -sSf | sh-```--> This will take a few minutes.--## Building--To build the Rust parts for your operating system, run:--```-node build.mjs-```--## Building for all platforms--These instructions currently are for macOS. Contributions for other platforms are appreciated.--To build the Rust binaries for all supported platforms, you need to install some dependencies:--```sh-node install-toolchains.mjs-```--You can then build all binaries with:--```-pnpm build-all-```--The resulting artifacts should be checked into Git.+For developing the Rust parts, see https://remotion.devdocs/contributing/rust.