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.2.0.tar.gz (18.1 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.2.0-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for slidecast-0.2.0.tar.gz
Algorithm Hash digest
SHA256 43eb944e53c3b09191ecf5cffeab8229bea298b7db095ecd25f3569a4def9649
MD5 8922b9ffa09a421b36757fa32f152700
BLAKE2b-256 0c69f3563eba7b5f2b6bfa9ca1256db7ea0f5bdcf7f2221fd8d8fed4f67c0a16

See more details on using hashes here.

Provenance

The following attestation bundles were made for slidecast-0.2.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: slidecast-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 17.5 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb3451a1f2d74702a4e289e7b1cd94a493e0370c84237a9517c302dd8a715fbc
MD5 be6d13fbdbd4ebe6e05ce426a07872f4
BLAKE2b-256 bbaf1112979710a64c94e0d83df31eb93374037538f9a0989493163492b3bb0b

See more details on using hashes here.

Provenance

The following attestation bundles were made for slidecast-0.2.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