explainer-videos is how I make long-form films about mathematics, physics, machine learning, and markets: 24 so far, 16.4 hours in English plus 5.6 hours of Chinese versions. Thirteen of them are on my YouTube channel, from the Navier–Stokes equations to how large language models work.

There’s no video editor in the process. Every frame, equation, simulation, narration line, and subtitle is generated from Python with Manim Community and local neural text-to-speech, and no video files are kept in git. A film is source code, and making one is a build.

A film is a package

compute.py NumPy · SciPy · mpmath → .npz sNN_*.py + style.py VoiceoverScene · 222 C.* colors tts.py + narration_zh.json Kokoro · Qwen3-TTS · 513 IPA rules manim render (parallel scene workers, longest scene first) isolated TeX dir per worker · 400-SVG LRU cache · up to 2,000 cached segments per scene .mp4 + .wav + .narration.json + .srt tools/build.py soundtrack check · ALAC pad · 2-pass EBU R128 loudnorm · chapters dead_air.py · contact_sheet.py 320×180 pixel scan vs #0E1117
Each video lives in videos/<series>/<name>/ and compiles from numerical checkpoints, scene scripts, and cached neural speech into a chaptered master.

Each film is a folder: a compute.py that runs the numerical simulations ahead of time, one Python file per scene, and the narration. Rendering a sixty-minute film in parallel ran into two limits in stock Manim. Scene processes running at once raced on shared LaTeX files, and frame-by-frame numeric readouts grew Manim’s internal SVG dictionary past 6 GB of memory. tools/build.py gives every scene worker its own TeX directory, starts the longest scenes first so a short one never ends up waiting at the back of the queue, and replaces that dictionary with a cache capped at 400 entries.

Twenty-four films, frame by frame

All 24 completed films in the repository (16.4 hours in English, plus 5.6 hours of Chinese masters for Analysis, Built). Every horizontal ribbon is the film's vertical color profile over time; click or dragtap or drag across any ribbon to inspect its rendered frames, subtitle track, and active-pixel density.

Each strip above squeezes a whole film into 300 thin slices of color, so you can see its structure before pressing play. Look for the Kármán vortex street in Navier–Stokes, where blue velocity gives way to orange vorticity; the rainbow phase portrait of ζ(s) in The Riemann Hypothesis; or the orange attention matrices and purple MLP blocks in How LLMs Work.

The voice is the clock

Contraction (videos/analysis/analysis4/s05_contraction.py) rendered in English (144.8 s) and Chinese (151.3 s) from the same scene class. The 57 self.play() segments run for the exact same 58.6 s in both languages; the 25 vo.wait_until() holds stretch or contract around each language's word timestamps.

Scenes never hard-code a pause. Instead, the narration carries inline <bookmark mark='...'/> tags. VoiceoverScene strips them out before synthesizing the speech and records the moment the next word starts:

with self.voiceover(
    "<bookmark mark='a'/> To solve cosine of x equals x, just iterate ... "
    "<bookmark mark='b'/> On the graph, bounce between the curve and the diagonal ..."
) as vo:
    self.play(FadeIn(head[0]), Create(ax), Create(dg), FadeIn(dl))
    vo.wait_until("a")
    self.play(Create(cg), FadeIn(cl))
    vo.wait_until("b")
    self.play(Create(web), run_time=4.0, rate_func=linear)

Animations (self.play()) always take the same time. The waits (vo.wait_until()) absorb the difference in how fast each language speaks. That’s why translating a film takes no editing at all: the Chinese version is the same scene code with a different voice. Compare the English cobweb with the Chinese render: the drawing is identical and only the gaps between animations change.

One color per concept, one rule per word

The 222 semantic color tokens in explainer/style.py (referenced 11,085 times across 705 scene files) and the 513 regex-to-IPA pronunciation rules in explainer/tts.py (firing 2,808 times across the narration corpus).

No scene uses a raw hex color. Every one imports a named role from explainer/style.py, so a concept keeps one color across a whole series: tolerance bands in gold (C.EPS) and holes in coral (C.HOLE) throughout Analysis, Built, or queries, keys, values, and attention throughout the machine learning films.

Pronunciation works the same way. A lexicon of 513 rules feeds phonetic spellings to the Kokoro voice so that Poisson is never read as “poison”, the differential dy never becomes “die”, and F = m a stays two letters instead of “Emma”.

Hunting dead air

tools/dead_air.py downscales every frame to 320×180 and flags runs lasting at least 1.5 s where fewer than 0.30% of pixels differ from #0E1117—catching scenes where a vo.wait_until() hold sat before the drawing call instead of after it.

Checking twenty-two hours of 4K footage by watching it doesn’t scale. tools/dead_air.py streams each render through ffmpeg at 320×180 and measures how much of every frame differs from the dark background. Any stretch of 1.5 seconds or more where under 0.30% of the pixels are lit (a lone title, bare axes) gets flagged.

The usual cause was one line in the wrong place: a vo.wait_until() placed before the self.play() it was meant to follow, so the drawing waited for a bookmark several sentences later while the screen sat nearly empty. The scanner found 12.4 seconds of bare title before a router-load replay, 14.5 seconds before a scaling card, and 8.0 seconds before a chain-of-thought schematic. Across the eleven films in the two series, Analysis, Built and AI, Built, fixing what it found cut sparse stretches by 91%.

Each tool here replaces something I’d otherwise do by watching. The voice sets the timing, so there’s no timeline to adjust. Colors and pronunciations are code, so each is decided once. And the scanner watches every frame, so I only have to watch the ones it flags.