A Rust-based renderer for Remotion projects.
🚧 WARNING: This is exploratory work only, use at your own risk.
Remotion allows you to easily write videos using React.
It exposes some functions from a React app to change the layout based on a specified composition
and frame
. The Remotion Renderer then serves this app on a URL and uses Puppeteer to loop over it and screenshot each frame. These are then stitched into a video file using FFmpeg.
I wanted to avoid a Node.js or server-based setup for one of my projects and have tried emulating the Remotion renderer using what I had on hand — this repo is the result of it working just enough.
- We start with your Bundle. You can create one using either the Remotion CLI (set log-level to
verbose
) or the @remotion/bundler tool. - The
headless-chrome-rust
project is used to get composition details and screenshot frames.
- See
src/main.rs
for how to use the renderer. - Most of the renderer's code is in
src/lib.rs
. - Relevant findings from my tinkering with the Remotion bundle are in
reference.js
. - Running
cargo run
should hopefully give you a video inout.mp4
if all goes well.
Thanks for checking out this project! I made this hack (again) over a sleepless night or two. It is not intended for production nor can I offer any support for it. Just leaving it here as a POC for the Remotion team and others to hopefully spark some new ideas.
Happy to answer questions/queries over on Twitter or the Remotion Discord. See you there! 👋
PS: this is a new approach. You might like to check out my first attempt at this using Wry in the wry
branch. Refer to the readme
there for more info.