Skip to main content

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). Import real_time_manim — not manim — or class identity splits.


Highlights

  • Real-time window. MLWindow renders at 1920×1080 @ 60 fps with no export step between code and picture.
  • Fast recording. fast_record_scene(...) reads back frames straight into ffmpeg — 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. MathTex strings inside a convertible subset are compiled by an in-process Typst backend (RTM_TYPST=0 disables 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 = self plus win.close() are required.
  • There is no manim CLI — 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.


LaTeX / Typst cache

Compiled 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)

Documentation


License

MIT

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.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for real-time-manim 2.0.5
File Size Uploaded Provenance Actions
real_time_manim-2.0.5.tar.gz 1.3 MB Without provenance Details for real_time_manim-2.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for real-time-manim 2.0.5
File Interpreter ABI Platform Actions
real_time_manim-2.0.5-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for real_time_manim-2.0.5-py3-none-win_amd64.whl

Total release size: 2.4 MB

Release files / real_time_manim-2.0.5.tar.gz

Download URL real_time_manim-2.0.5.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
1d164163e70cfb09d947f557cd5b618d459c81fb571298f9b01685ceb7db4eb2
BLAKE2b-256 checksum
How to use checksums
4114da4610ba435dac2ae280cb689b82e6213de7d6bdff5ca22746ac428c7d42
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.5-py3-none-win_amd64.whl

Download URL real_time_manim-2.0.5-py3-none-win_amd64.whl
Size 1.2 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
b7eaeb688e6f47562fd0fc348b6c3029409a9bb589d3f1e793607d4b841b9266
BLAKE2b-256 checksum
How to use checksums
b4a1fcd942aa9f90159aadc4f27ee26ff9da5e6871dfa2016d7156bfa08fb744
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.5

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page