icaoberg / py-tex2movie

Created Thu, 16 Apr 2026 00:00:00 +0000 Modified Thu, 16 Apr 2026 20:52:34 -0400

If you’ve ever spent hours recording yourself narrating a slide deck, you know how tedious the process can be. py-tex2movie automates that entire workflow — it takes your existing LaTeX Beamer presentation and turns it into a fully narrated MP4 video using AI-generated speech.

How It Works

The tool runs a four-step pipeline under the hood:

  1. Note extraction — parses \note{...} commands from your Beamer frames
  2. PDF compilation — converts the .tex file into individual slide images via LaTeX and PDF rendering
  3. Audio generation — synthesizes speech from your presenter notes using the ElevenLabs API
  4. Video assembly — combines slide images and audio into a single MP4 using moviepy

If a slide has no notes, it displays for a configurable number of seconds (default: 3) before advancing.

Installation

You’ll need a few system-level dependencies alongside the Python packages:

  • A LaTeX distribution (TeX Live, MacTeX, or MikTeX)
  • Poppler utilities for PDF-to-image conversion
  • FFmpeg with codec support (Linux users)
  • An ElevenLabs API key (a free tier is available)

Then install the Python dependencies:

pip install elevenlabs "moviepy<2" pdf2image pillow

Usage

The command-line interface is straightforward:

python tex2movie.py presentation.tex [options]

Key options:

Option Description
--voice VOICE_ID Select a voice from ElevenLabs’ library
--silent SECONDS Duration for slides without notes (default: 3s)
--output PATH Custom output file location
--author, --group Embed metadata into the video

Why This Matters

Creating video lectures or recorded presentations is increasingly common in academic and professional settings. py-tex2movie fits naturally into that workflow for anyone already writing Beamer slides — your presenter notes become the narration script, and you get a polished video without ever touching a microphone or video editor.

The project is written primarily in Python (75.9%) with LaTeX examples making up the rest of the codebase, and it is released under the GPLv3 license.


Repo: https://github.com/icaoberg/py-tex2movie)


This project is open source. Contributions, bug reports, and feature requests are welcome via GitHub Issues.