Illustration of what PDoomVideo does: Code for an AI-generated music video, painted frame by frame in p5.js

JohnHeibel /

PDoomVideo

Code for an AI-generated music video, painted frame by frame in p5.js

  • 2.5k stars
  • 827 stars since 3 Oct
  • JavaScript
  • Updated 27 days ago
  • Some experience
  • Image, video & audio

This repo holds the code behind a music video set to the song "I'm Upping My P(doom)". Claude Opus 5.5 wrote everything in it, working in Claude Code. The only direction was to use the Clawd character design and give each lyric interesting visuals and transitions.

Each frame is painted in a web page (studio.html) using p5.js and p5.brush for brushstroke effects. The video is split into nine chapters, one file each, plus shared code for characters, props, lyrics and the timeline. A Node script, render.mjs, opens the page in headless Chrome, saves frames, then uses ffmpeg to join them with the song.

The repo also keeps the working documents: a storyboard Opus wrote, and an animation guide it wrote to brief parallel subagents. A first-generation version lives in legacy/. The README links to a separate, more general base for Claude animations by the same author.

What it does

  • Nine chapters, one file each

    Each section of the video lives in src/ch/. Shared code in src/ covers Clawd, guest characters, props, lyrics and the timeline.

  • Frame-by-frame rendering

    render.mjs paints frames in headless Chrome using p5.js and p5.brush. Rendering is resumable and can run several workers.

  • MP4 encoding with the song

    A second command joins the rendered frames and the included song (assets/pdoom.mp3) into an MP4 using ffmpeg.

  • The AI's planning documents

    STORYBOARD.md is Opus's shot-by-shot plan. ANIMATION_GUIDE.md is the guide it wrote for its subagents.

  • Two generations kept

    The first attempt, made with Opus 5.5 (Medium), is kept in legacy/ next to the second.

What you could build

  • Study how an AI model structured a long animation project into chapters, a timeline and shared characters.
  • Render the music video yourself from source with Node, Chrome and ffmpeg.
  • Read the storyboard and subagent guide to see how to brief an AI on a visual project.
  • Borrow the headless-Chrome frame renderer to turn a p5.js sketch into an MP4.
  • Adapt the chapter and timeline layout for your own lyric-driven animation.

Get started

Install Node.js, Google Chrome and ffmpeg, then run npm install. Render the frames, then encode them with the song into an MP4. On Windows or with a non-default Chrome, add --chrome=<path to chrome>.

npm install
node render.mjs --frames=0:156.6 --workers=4
node render.mjs --encode --out=out/pdoom.mp4

Commands are copied from the project's README. Read it on GitHub for the full setup.

More in Image, video & audio

    ↑↓ to move, Enter to open, Esc to close