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:
shcurl https://sh.rustup.rs -sSf | sh
shcurl https://sh.rustup.rs -sSf | sh
Building
To build the Rust parts for your operating system, run:
shnode build.mjs
shnode 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:
shnode install-toolchains.mjs
shnode install-toolchains.mjs
You can then build all binaries with:
pnpm build-all
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-arm64and a user will only install packages that are specific to their operating system. - The Rust code will be compiled into your native
compositorpackage 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 folder of each compositor package.
- Those shared libraries and FFmpeg binaries come from the
rust-ffmpeg-splitterrepository. They are built in CircleCI as well as on a M1 Macbook and pasted into therust-ffmpeg-sysproject. Therust-ffmpeg-sysproject is a dependency ofrust-ffmpegwhich is a dependency of the main Remotion project. Refer to those repositories to learn how to build them.