Skip to main content

Turn a list of HTML slides + narration into a narrated MP4. Headless-browser screenshots, pluggable text-to-speech, ffmpeg stitching. Bring your own slide design and voice.

Project description

slidecast

Turn a list of HTML slides + 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.

CLI

slidecast render reel.yaml -o out.mp4 --poster
width: 1280
height: 720
fps: 25
tts:
  provider: kokoro        # kokoro | gtts | silent
  url: http://127.0.0.1:8021/v1/audio/speech
  voice: af_heart
  response_format: wav
slides:
  - 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).
  • 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, concat, poster) and take an injectable runner, so you can compose your own pipeline or test command construction without invoking ffmpeg.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slidecast-0.1.0.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

slidecast-0.1.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file slidecast-0.1.0.tar.gz.

File metadata

  • Download URL: slidecast-0.1.0.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for slidecast-0.1.0.tar.gz
Algorithm Hash digest
SHA256 92f1d3fbdaccae10c17510bbfccbe09c337cd70a2188bb57f80736b9e5ada363
MD5 bcc7207130b48b4c796230e095c3daaa
BLAKE2b-256 554287352ca2091fc571f63fa98d330653499c0f98ccfba55f026ee41934a0cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for slidecast-0.1.0.tar.gz:

Publisher: publish.yml on vinayvobbili/slidecast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file slidecast-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: slidecast-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for slidecast-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 56f19e40bd95c7e8c6f8fae19529c3a803cb9630f09faab82ba68cc5ec11d679
MD5 e220568cf7c14be733683eabb524aecd
BLAKE2b-256 39567931db90203646c0ebcf8d84ee1bb3992b391606d05b6f2314f7802e00f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for slidecast-0.1.0-py3-none-any.whl:

Publisher: publish.yml on vinayvobbili/slidecast

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page