Skip to main content

slidecast

Turn a list of HTML slides and recorded clips, plus narration, into a narrated MP4.

You bring the slide design — any HTML you like — and the words. slidecast screenshots each slide with a headless browser, narrates it with a pluggable text-to-speech provider, and stitches the frames into one MP4 with ffmpeg. It has no opinion about how your slides look and no hard dependency on a specific voice or browser: every piece is swappable.

Install

pip install slidecast              # core (requests only)
pip install slidecast[playwright]  # default renderer (headless Chromium)
pip install slidecast[gtts]        # Google Translate TTS
pip install slidecast[ffmpeg]      # bundled ffmpeg binary (no system install)

After installing the Playwright extra, fetch the browser once:

playwright install chromium

You also need ffmpeg — on PATH, via $SLIDECAST_FFMPEG, or the [ffmpeg] extra's bundled binary.

Library

from slidecast import Reel, KokoroTTS

reel = Reel(width=1280, height=720, tts=KokoroTTS(voice="af_heart"))
reel.add("<!doctype html><h1>Hello</h1>", "Hello, and welcome.")
reel.add("<!doctype html><h1>Goodbye</h1>", "Thanks for watching.", tail_pad=0.8)
reel.render("out.mp4", make_poster=True)

A slide with empty narration becomes a silent hold (min_duration seconds). When the TTS provider reports a clip duration, the segment is padded to fit the speech exactly; when it can't (e.g. MP3), the audio drives the length.

Recorded clips

Mix screen recordings in with the slides. A clip plays through; if its narration runs longer, the last frame holds until the voice finishes. It's letterboxed to the reel's size, never stretched, and its own audio is replaced by the narration.

reel.add("<!doctype html><h1>The demo</h1>", "Here's how it works.")
reel.add_clip("scan.webm", "Click Scan, and every question gets a cited draft.")
reel.add_clip("fill.webm", "Then fill the form.", tail_pad=0.6)

Record the clips any way you like: Playwright's record_video_dir, a screenshot sequence encoded with ffmpeg, or a screen recorder.

CLI

slidecast render reel.yaml -o out.mp4 --poster
width: 1280
height: 720
fps: 25
tts:
  provider: kokoro        # kokoro | gtts | say | silent
  url: http://127.0.0.1:8021/v1/audio/speech
  voice: af_heart
  response_format: wav
slides:
  - video: demo.mp4       # a recorded clip, relative to the spec
    narration: "Watch it run."
  - html_file: intro.html
    narration: "Before any of this, here's why it matters."
    tail_pad: 0.8
  - html: "<!doctype html><h1>Step one</h1>"
    narration: ""          # silent slide
    min_duration: 3

The swappable pieces

Text-to-speech — anything with synthesize(text, path) -> seconds | None:

  • KokoroTTS — any OpenAI-compatible /v1/audio/speech endpoint (Kokoro, OpenAI, LocalAI, …). Defaults to WAV so the clip length is measurable.
  • GTTSTTS — Google Translate TTS (gtts).
  • MacSayTTS — macOS's built-in say: offline, no dependencies, WAV. Premium voices (e.g. "Ava (Premium)") are a free download under System Settings › Accessibility › Spoken Content.
  • SilentTTS — a silent track of a fixed length. No dependencies; the default, so a reel renders end to end with nothing configured.

Pass phonetic={r"\bSOC\b": "sock"} to rewrite how tricky tokens are spoken without changing the on-screen text.

Renderer — a context manager exposing screenshot(html, path, *, width, height):

  • PlaywrightRenderer — headless Chromium, launched once per reel (default).
  • ChromeBinaryRenderer — drive an existing Chrome/Chromium binary by path.

ffmpeg steps are exposed directly (build_segment, build_clip_segment, concat, master, poster) and take an injectable runner, so you can compose your own pipeline or test command construction without invoking ffmpeg.

License

MIT

Metadata

Release files for slidecast 0.3.0

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

Source distribution (sdist)

Source distribution for slidecast 0.3.0
File Size Uploaded Provenance Actions
slidecast-0.3.0.tar.gz 22.7 kB With provenance Details for slidecast-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for slidecast 0.3.0
File Interpreter ABI Platform Actions
slidecast-0.3.0-py3-none-any.whl Python 3 none any Details for slidecast-0.3.0-py3-none-any.whl

Total release size: 42.9 kB

Release files / slidecast-0.3.0.tar.gz

Download URL slidecast-0.3.0.tar.gz
Size 22.7 kB
Tags Source
SHA-256 checksum
How to use checksums
527eab799ce83a25be4fcc84187d1a66909861ed98a2ae7b4c10d0eab66a689d
BLAKE2b-256 checksum
How to use checksums
32e9d0fadbf420695bc413ff8d010dd7810d8eba28d578d424657722dc60534e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

Release files / slidecast-0.3.0-py3-none-any.whl

Download URL slidecast-0.3.0-py3-none-any.whl
Size 20.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ff8d48ac9755d10546ad6b42c516e91b188eec163753ab88a177a49fd0f600b
BLAKE2b-256 checksum
How to use checksums
856e52a20372f23c5bad4dd03c69c8599e90f71e7d5876ccad099acd58744511
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

Security for slidecast 0.3.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for slidecast-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

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