Real-Time-Manim (RTM)
A Vulkan-accelerated, real-time rendering backend for
ManimCE. RTM drives ManimCE's own Mobject /
Animation model through a native Vulkan pipeline, so the same scene can be
watched live in a window, seeked to any frame instantly, and recorded to MP4
several times faster than the default renderer.
About this page. This is the package overview, kept plain-text on purpose (PyPI renders neither images nor diagrams). The illustrated README, the manual and a source-level walkthrough live in the repository and its wiki.
Install
pip install real-time-manim
The Windows wheel bundles vulkan_core.dll and the macOS wheel bundles
vulkan_core.dylib (Apple Silicon), so there is no build step. You need a
Vulkan-capable GPU/driver, and ffmpeg on PATH to record video.
macOS needs MoltenVK at runtime — it provides the Vulkan layer on macOS:
brew install molten-vk
Intel Macs aren't covered by the bundled dylib: build it once and drop it next
to the installed real_time_manim package:
bash native/build_mac.sh # -> dist/release/vulkan_core.dylib
Quick start
from real_time_manim import Scene, Square, BLUE
from real_time_manim.vulkan_bind import MLWindow, Create, Wait
from real_time_manim.record import fast_record_scene
class Hello(Scene):
def construct(self):
win = MLWindow(960, 540) # a real-time window
win.scene = self # required
sq = Square(side_length=1.5, color=BLUE).set_fill(BLUE, 0.6)
win.play(Create(sq), run_time=1.0)
win.play(Wait(0.5))
win.close() # required
fast_record_scene(Hello) # -> ~/Downloads/output.mp4
MLWindow opens the live window; fast_record_scene / record_scene record to
MP4. Recording starts and stops around the scene automatically, and the
transient media/ folder is cleaned up afterwards.
No separate ManimCE install, and no
import manim. RTM bundles ManimCE 0.21.0 and re-exports its whole namespace (Scene, every mobject and animation, the colours, the rate functions). Importreal_time_manim— notmanim— or class identity splits.
Highlights
- Real-time window.
MLWindowrenders at 1920×1080 @ 60 fps with no export step between code and picture. - Fast recording.
fast_record_scene(...)reads back frames straight intoffmpeg— around 1.9–2.8× faster than ManimCE Cairo (a 15-second scene: 4.6–6.6 s versus 12.8–13.9 s), windowless and at full speed by default. - Parallel frames.
jobs="auto"splits a long scene across worker processes and concatenates their segments losslessly. - Frame-accurate seeking. Any frame of a prepared scene is produced in O(1), which is what makes both the frame preview and the parallel recorder possible.
- Full ManimCE. Existing scenes run unchanged, including code that still
writes
from manim import .... - Math without LaTeX.
MathTexstrings inside a convertible subset are compiled by an in-process Typst backend (RTM_TYPST=0disables it); both Typst and LaTeX results are content-hashed and cached. - Animations. Every animation family is available: transforms, drawing, fading, movement/scaling, text, rotation, effects and grouping/timing — see the manual for the full list.
Recording
fast_record_scene(MyScene) # offline readback -> ~/Downloads/output.mp4
fast_record_scene(MyScene, "out.mp4", jobs=4) # 4 worker processes
record_scene(MyScene, "live.mp4") # capture a visible window in real time
Both accept a Scene subclass, a Scene instance or a no-arg callable, and
return a dict {out_path, windows, files, with_audio}. With out_path omitted
the output lands at ~/Downloads/output.mp4. The native backend supports one
window per process; _partN suffixes are reserved for a future multi-window
backend.
Constraints
- Output is fixed at 1920×1080 @ 60 fps; any other value is corrected and
reported with a
[rtm] forcing ...line. - One window per process, and
win.scene = selfpluswin.close()are required. - There is no
manimCLI — RTM is a library:MLWindow, the recorders,FrameServer,FramePreview.
How it works
Manim Scene
| MLWindow.play(...)
v
type dispatch (_send per mobject)
| ctypes FFI
v
vulkan_core.dll -> Vulkan pipeline -> GPU
| optional framebuffer readback
v
ffmpeg -> MP4
A Scene builds mobjects and calls MLWindow.play(...); the Python layer walks
the mobject tree and dispatches each shape to a type-specific sender; those cross
a ctypes boundary into vulkan_core.dll, which emits vertices and submits them
to a Vulkan pipeline. Every frame is presented to the window, and can optionally
be read back and piped to ffmpeg as an MP4.
Caches
Three different things are cached, and each is cleared differently:
| what | where | what it saves | clear it with |
|---|---|---|---|
| LaTeX / Typst results | media/Tex (+ your tex_cache/) |
recompiling unchanged formulas | clear_tex_cache() |
| text → SVG (Pango) | media/texts/<hash>.svg |
re-running Pango layout (~2 ms per string) | clear_media(), or a recorder's cleanup=True |
| parsed SVG → Manim mobjects | process memory (SVG_HASH_TO_MOB_MAP) |
svgelements parsing + one VMobjectFromSVGPath per glyph (4–20 ms) |
process exit; Text(use_svg_cache=False) opts out |
Formulas are content-hashed, so unchanged math is never recompiled:
from real_time_manim import restore_tex_cache, save_tex_cache, clear_tex_cache
restore_tex_cache("tex_cache") # before: warm manim's SVG folder from a saved cache
# ... run your Tex / MathTex scenes ...
save_tex_cache("tex_cache") # after: stash newly compiled SVGs
clear_tex_cache() # wipe <media>/Tex and tex_cache/ (dry_run=True to preview)
Text is hashed by content and style — text, font, size, colour, t2c/t2f/
t2s/t2w, line spacing, ligatures — so a red and a blue copy are different
files. The in-memory layer is capped (256 entries, FIFO) and only starts caching
from the second build of a given string: repeated labels are ~2.5× cheaper to
construct, while one-off strings (each DecimalNumber value) never pay for a
copy they will not use. fast_record_scene(..., cleanup=True) deletes the whole
media/ folder after recording, so the on-disk text cache lasts one render
unless you pass cleanup=False:
from real_time_manim import clear_media
clear_media() # wipe the whole media/ tree, including media/texts
Documentation
- Repository — https://github.com/BEGINWITHF/real-time-manim
- Wiki (English) — a source-level walkthrough in eight chapters, from 01 Overview to 08 Native Layer
- Chinese manual — 144 pages, one section per API, each with a rendered sample clip: RTM-Wiki/zh_CN
- English manual — the same content in English, with the sample clips re-rendered so the on-screen labels are English too: RTM-Wiki/en_US
- Agent manual — the same material condensed for AI agents: RTM-Wiki/agent
License
Acknowledgments
- ManimCE — the mathematical animation engine
- stb_truetype — TrueType font rasterizer
- Vulkan — the graphics API
- Typst — the in-process math typesetting backend
Metadata
Release files for real-time-manim 2.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| real_time_manim-2.0.7.tar.gz | 1.3 MB | Without provenance | Details for real_time_manim-2.0.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| real_time_manim-2.0.7-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details for real_time_manim-2.0.7-py3-none-win_amd64.whl |
Total release size: 2.5 MB
Release files / real_time_manim-2.0.7.tar.gz
| Download URL | real_time_manim-2.0.7.tar.gz |
|---|---|
| Size | 1.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
50114279b93f91f05a94068a7aa8e119a0f17456e22696806d40ee876665ed30
|
|
BLAKE2b-256 checksum How to use checksums |
d6b4e5898071e2f4c6d6ace4290e0bf3ba3a96a8390e7147eb1c67934d85ec28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.4
|
Release files / real_time_manim-2.0.7-py3-none-win_amd64.whl
| Download URL | real_time_manim-2.0.7-py3-none-win_amd64.whl |
|---|---|
| Size | 1.2 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
917bbabfec0faef9062f255a69d84d9cbeaeb485bcc20de5aaa2ff1afd14058c
|
|
BLAKE2b-256 checksum How to use checksums |
de70315823da03052be7b3e98c87d3f1368a900a680b2a787ec5b7ab23be4dab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.4
|
Security for real-time-manim 2.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.