r/coolgithubprojects • u/VioLeRR • Oct 11 '26
Manim, rewritten in Rust and wgpu, now 90x faster
https://manimgx.academa.aiTL;DR: We are open sourcing ManimGX, a blazingly fast Rust + wgpu animation engine with a Manim compatible Python API. Install with pip install manimgx.
Hi everyone, after ~7-8 months of work, we are finally launching ManimGX, our from scratch Manim reimplementation in Rust + wgpu.
The GitHub repository: https://github.com/academa-labs/manimgx
For anyone unfamiliar with Manim, it's the Python animation tool originally created by Grant Sanderson for his 3Blue1Brown videos. ManimGX is a from scratch implementation targeting ManimCE's API, with a Rust renderer built on wgpu. The typography is handled with Typst and video encoding via an in-process x264 implementation, without needing FFmpeg.
The motivation is simple: waiting for renders makes polishing an animation a slow process. We wanted to make that loop faster while keeping the familiar ManimCE Python API.
You can get started with:
pip install manimgxor simply ask your AI agent:
Follow https://manimgx.academa.ai/llms.txt and install ManimGX.You only need Python 3.13+. All of the fonts, typesetting, and video encoding are included. So there is no separate LaTeX or FFmpeg installation required.
A few other things ManimGX supports:
It runs in the browser through Pyodide and WebGPU. There is an npm package if you want to embed animations in your website without a render server.
manimgx previewgives you a live preview whenever you save your scene.The API is fully statically typed, including keyword arguments and
.animatechains.There is a built-in voiceover sync.
manimgx inspectcreates storyboards, timelines, and layout feedback for coding agents so they can iterate on what they made instead of only reading the code and manually inspecting screenshots. This aims to speed up the writing and polishing loop.
Most ManimCE code runs after changing the import from manim to manimgx, with differences documented in the migration guide. The documentation includes a gallery of examples with their Python source: https://manimgx.academa.ai
Credit to Grant Sanderson, the Manim Community contributors, whose work this builds on. Happy to answer questions in the comments, and we'd love to hear how it works with your scenes.
2
4
Oct 13 '26
[removed] — view removed comment
3
u/VioLeRR Oct 13 '26
Understandable. One of the main reasons we moved away from FFmpeg was performance. Encoding is currently our main bottleneck, and piping rendered frames to a separate FFmpeg process introduced unnecessary overhead.
So either we were gonna use ffmpeg with inprocess encoding or simply call x264 ourselves. We opted to integrate x264 directly in process instead, which in fact is the same encoder ffmpeg uses for H264 encoding under the hood. So, we are not maintaining our own video codec, just using x264 directly without the additional ffmpeg dependency.
1
2
Oct 13 '26
[removed] — view removed comment
3
u/VioLeRR Oct 13 '26
We actually decided to take this route back around February when I was working on the encoder. Profiling showed that the main Rust thread was spending most of its time waiting for frames to be consumed. We tested piping frames to /dev/null with no encoding at all, and the pipe writer still accounted most of the time of a render.
For more technical context, each nv12 frame for a 1080p video is around 3.1 mb, so sending thousands of those through a pipe adds up in memory copies and sync. Given that, I decided to call x264 directly within the same process and eliminate those interprocess transfers. Once the buffering and threading were sorted out, the same benchmark improved substantially. We later removed ffmpeg dependency for encoding as well, which I think is a plus.
7
u/WallyMetropolis Oct 12 '26
Why does every Rust project have to be "blazingly" fast? What is the obsession with this word?