pdoom-video README

The project's README from github.com/mexicat/pdoom-video. As one markdown file: README.md.

I'm Upping My P(doom) — music video

A generative, code-rendered music video with word-synced karaoke typography. Every frame is a deterministic function of song time, so the live preview in the browser and the offline 1080p60 (or 4K60) export are identical.

Watch it in 4K on YouTube: https://www.youtube.com/watch?v=5EoO5413dBY

The YouTube upload is an earlier render: it averages only 4 sub-frames per frame for motion blur, so fast motion shows stepped copies, and YouTube's compression smears the film grain. For the best version, render it locally (see Render the video): the current code picks up to 324 sub-frames per frame where the motion needs them.

The video was made with Claude (Opus 5.5) in Claude Code: the concept and treatment, the lyric alignment and audio analysis, the renderer, every scene and the renders were all worked out in conversation with Claude.

The song is not ours: see Credits for who wrote and made it.

The concept, style bible and plate-by-plate treatment are in docs/TREATMENT.md. The engine and scene API are documented in docs/ENGINE.md.

Layout

Requirements

bun, Google Chrome (the offline renderer drives it headless through playwright-core) and ffmpeg with libx264. The analysis tools need uv; the renderer doesn't.

Preview

cd app
bun install
bunx vite

Open http://localhost:5173 and use the keys below. ?t=23 starts at a given time.

Key Action
space play / pause
← / → seek ±1 s (±5 s with shift)
, / . step one frame
[ / ] previous / next scene
l loop the current scene
h hide the UI

The preview renders in real time on a recent Mac. The export is not real time and is heavier.

Render the video

cd app
bun scripts/render.ts video --samples auto --shutter 0.2 --out ../out/pdoom.mp4

4K

cd app
bun scripts/render.ts video --scale 2 --samples auto --shutter 0.2 --x264 aq-mode=3:rc-lookahead=30 --out ../out/pdoom-4k.mp4

Regenerate the timing data

The committed data/*.json files are all the renderer needs. Regenerating them needs the stems and intermediates, which are not in the repo:

cd analysis
uv run python align.py      # data/lyrics.json
uv run python analyze.py    # data/audio.json

The models download about 4 GB of weights into analysis/.cache/; delete that folder afterwards.

Credits

License

The code is released under the MIT License. The fonts in app/public/fonts/ keep their own licenses (see Credits), and the song and lyrics (audio/, lyrics/, data/lyrics.json) are not covered by it: they belong to their authors (see Credits).

pdoom-video (mexicat/pdoom-video)

Searching Database…

这是什么?这是一首为歌曲“I'm Upping My P(doom)”制作的生成式、由代码渲染的音乐视频,带有与歌词逐词同步的卡拉OK风格排版,每一帧都是歌曲时间的确定性函数。
这是成品视频文件,还是一个渲染器?它是一个 TypeScript + three.js 渲染器应用,而不是预渲染好的视频文件:同一套代码既驱动浏览器实时预览,也驱动离线的 1080p60 或 4K60 导出,因此两者看起来完全一致。
我自己怎么预览或渲染这个视频?运行 bun + Vite 应用即可获得实时的交互式浏览器预览,然后用 scripts/render.ts 进行离线导出——它通过 WebSocket 驱动无头 Chrome,再送入 ffmpeg。
需要先安装哪些东西?你需要 bun、Google Chrome(通过 playwright-core 以无头模式驱动)以及带 libx264 的 ffmpeg;如果要重新生成歌词/音频时间数据,还需要 uv 来运行 Python 分析工具。
导出也像预览一样实时运行吗?不是——实时预览在较新的 Mac 上可以实时运行,但离线导出的负担重得多:在 M5 Pro 上以 4K 渲染整首歌大约花了 2.5 小时。
这里的 MIT 许可证具体覆盖哪些内容?只有渲染器代码采用 MIT 许可;内置字体保留各自原有的许可,歌曲和歌词归原作者所有,不在 MIT 授权范围内。
4K 渲染对 GPU 的压力有多大?非常大——它是 GPU 受限的,每帧开销从静止画面的约 40ms 到高子帧数下光线步进房间场景的 10 秒以上不等,每个渲染管线大约占用 5GB(无头 Chrome)外加 4GB(ffmpeg)。
一帧获得多少运动模糊采样由什么决定?渲染器的 --samples 自动模式会根据画面运动速度,在每帧 12 到 324 个子帧之间自适应选择,一旦继续增加采样不会再超出设定容差地改变画面,就停止增加。
词级的歌词时间数据是如何生成的?通过 uv 运行的 Python 工具使用 Demucs 做音轨分离、CTC 强制对齐并与 Whisper 交叉验证,再加上节拍/起音分析,最终生成提交入库的 data/lyrics.json 和 data/audio.json 时间数据文件。
为什么 YouTube 上传版本与本地 4K 渲染看起来不一样?YouTube 版本每帧平均只使用 4 个子帧来生成运动模糊,而且会被重新压缩,因此快速运动看起来有阶梯感、胶片颗粒也被抹平;而本地渲染最多可用 324 个子帧,能保留完整细节。
Claude 在制作这个视频的过程中扮演了什么角色?Claude Code 中的 Claude(Opus 5.5)与作者对话协作,共同敲定了创意概念、歌词对齐、渲染器代码、每一个场景以及最终的渲染成品。
Creator
mexicat
Size
15.9 MB
Stars
2.8K
Updated
CommitOct 05
Age
23d
Commits · 90 Days