versereel: Poem Videos With Original Ambient Music, as a CLI, MCP Server and Claude Skill

An open-source Python package I published to PyPI. It turns a poem or quote into a calm text-only vertical video (Shorts, Reels, TikTok) with an ambient music bed that is synthesised from scratch, so there is nothing to license. It handles Urdu Nastaliq and other right-to-left scripts, and ships as a CLI, a Python API, an MCP server and a Claude Code skill. It grew out of my own poetry Shorts channel, where the same code produced over a hundred videos.

Open sourcePython
Illustration of the versereel (PyPI) project
10
automated tests, CI on Python 3.10 and 3.12
5
MCP tools
0
GPUs or API keys needed
1
command to install: pip install versereel
Three vertical poem videos side by side: an Urdu couplet in Nastaliq, Emily Dickinson's Hope and Tagore's Gitanjali, text over a soft paper background
Frames from three videos rendered by versereel: Urdu, Dickinson and Tagore

The challenge

Poetry Shorts are cheap to make but awkward to publish: stock music raises licensing questions, and most video tools mishandle right-to-left scripts, so Urdu letters arrive disconnected or reversed.

I wanted one small tool that makes a finished, calm video from plain text, runs on a laptop or a free server, and can be driven by a person, a script or an AI assistant.

How I approached it

  1. 01

    Music built from sine waves

    A seeded generator layers slow detuned pad chords, sparse pentatonic bell notes and an FFT-convolved reverb, then low-passes the result. The same seed always gives the same piece, so a channel can have variety without any sample library.

  2. 02

    Right-to-left done properly

    Text is laid out word by word with Pillow and Raqm so Nastaliq shaping, joining and spacing come out right, and the font size shrinks until the longest line fits.

  3. 03

    Timing from the text

    Stanzas fade in one after another, grouped into pages of at most six lines, with hold times that scale with line count. The planner checks the result fits a 60 second Short before any rendering happens.

  4. 04

    Fast compositing

    Each text layer is cropped to its bounding box so ffmpeg composites small images instead of full frames. A typical render went from about a minute to about 30 seconds.

  5. 05

    One engine, four interfaces

    The CLI, the Python API, an MCP server (check_environment, plan_poem, render_poem, make_music_bed, fetch_poem) and a Claude Code skill all call the same functions.

  6. 06

    Honest about rights

    The Wikisource fetcher returns a licence credit line, the skill makes the assistant check public-domain status first, and the README puts responsibility for what gets published on the user.

Deliberate trade-offs

  • Fonts are looked up on the system, not bundled. Urdu needs Noto Nastaliq Urdu installed.
  • The music is deliberately simple background ambience, not a composition tool.
  • Output is a still-text video. There is no voice-over or per-word highlighting yet.
  • Public-domain status of a text is the user's job to confirm. The tool only helps with credit lines.

What I built

  • Extracted and rewrote the rendering and music code from scripts that had hard-coded paths, into a tested installable package.
  • Replaced the background image dependency with a procedural paper and watercolour generator.
  • Wrote a Wikisource fetcher that reads rendered HTML, because raw wikitext fails on transcluded pages, and fixed stanza and drop-cap handling after testing it on a real poem.
  • Added the CLI, the MCP server (compatible with both mcp 1.x and 2.x) and the skill, with 10 tests and CI.
  • Published to PyPI and verified a clean install in a fresh virtual environment.
MIT licensed. Install it with pip install versereel.

What this project demonstrates

  • Designing and publishing a Python package and MCP server end to end
  • Audio synthesis and ffmpeg pipeline work
  • Right-to-left and Urdu text rendering
  • Turning a working internal script into a documented, tested open-source tool

Related case studies

Have a project like this in mind?

Tell me what you're building. I'll reply by email with questions or a suggested approach.