@adelie/lesson-video

中文文档
0.6.5发布于 2026/11/07Apache-2.0零依赖近 30 天下载 2872

Narrated vertical lesson videos (1080x1920) from a script: an HTML slide deck driven by time, edge-tts voice-over with word-level timing, Playwright frame capture, ffmpeg mux, cover art and publishing copy.

原始使用文档
文档目录5 节
  1. Why it exists
  2. What's inside
  3. Requirements
  4. Quick start
  5. License

lesson-video

Narrated vertical lesson videos (1080×1920, Douyin / Reels ready) from a written script — plus the cover art and the publishing copy that goes with them.

The whole thing rests on one idea: the picture is a pure function of time t. You write what is said, edge-tts speaks it and hands back word-level timings, and every frame is then computed from that timeline. Voice, subtitles and slides line up by construction, so there is nothing to edit afterwards.

script.json  ──tts.py──▶  narration.wav + lesson.json  ──render.mjs──▶  30fps JPEG frames  ──build.py──▶  mp4 + srt
covers.json  ──cover.mjs──▶  1080×1920 video cover + 1080×1440 profile cover

Why it exists

  • Safe areas for real phones. App buttons and status bars cover the edges of a portrait screen, so the layout keeps the sides and the top empty by design: content lives inside 745 × 1170 px, and the subtitle band starts at y = 1470.
  • A pre-render self-check. render.mjs --check fails before spending minutes on frames: content past the subtitle safe line, code lines clipped by the card, and titles left with a one-character orphan line.
  • No editing software, no GPU. Headless Chrome + imageio-ffmpeg; a three-minute episode renders in about five minutes on CPU, and re-rendering after a script fix is one command.
  • No baked-in branding. Watermark, brand mark, CTA and every caption come from the data files — the templates ship with nothing of anyone's hard-coded.

What's inside

PathWhat it is
skills/lesson-video/SKILL.mdThe skill: script schema, the three commands, the layout rules, the pitfalls
skills/lesson-video/kit/The toolkit — tts.py, render.mjs, build.py, deck.html, cover.mjs, cover.html; copy it into a project as lib/
skills/lesson-video/example/A skeleton script.json (four scene types) and covers.json

Requirements

NeedInstall
Python packagespip install edge-tts imageio-ffmpeg (the ffmpeg binary comes with the second one)
Playwright coreany usable playwright-core; point PLAYWRIGHT_MODULE at it
A browserany Chrome / Chromium; point CHROME_PATH at it

Quick start

cp -r <skill>/kit/* <project>/lib/
mkdir -p <project>/lessons/ep01

# 1. write <project>/lessons/ep01/script.json   (see the skill for the schema)

PYTHONUTF8=1 python lib/tts.py lessons/ep01
node lib/render.mjs --dir lessons/ep01 --check          # 10s: safe area, clipped code, orphan titles
PLAYWRIGHT_MODULE=… CHROME_PATH=… node lib/render.mjs --dir lessons/ep01
PYTHONUTF8=1 python lib/build.py lessons/ep01           # out/ep01.mp4 + out/ep01.srt

License

Apache-2.0

版本与发布记录

@adelie/lesson-video 共发布 19 个版本,首次发布于 2026/10/17;过去 12 个月发布了 19 个版本。

版本发布日期距今
0.6.5latest2026/11/07今天
0.6.42026/11/052 天前
0.6.32026/11/043 天前
0.6.22026/11/025 天前
0.6.12026/11/016 天前
0.6.02026/10/308 天前

关于 @adelie/lesson-video 的常见问题

@adelie/lesson-video 是什么?

Narrated vertical lesson videos (1080x1920) from a script: an HTML slide deck driven by time, edge-tts voice-over with word-level timing, Playwright frame capture, ffmpeg mux, cover art and publishing copy.

如何安装 @adelie/lesson-video?

在项目目录运行 npm install @adelie/lesson-video,或使用 pnpm add / yarn add / bun add。

@adelie/lesson-video 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/adelie__lesson-video 是否存在。

@adelie/lesson-video 可以商用吗?

@adelie/lesson-video 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@adelie/lesson-video 的下载量有多少?

根据 npm 官方下载统计,@adelie/lesson-video 在 2026/10/05 – 2026/11/03 这 30 天内被下载 2,872 次,日均约 96 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@adelie/lesson-video 还在维护吗?

最新版本 0.6.5 发布于 2026/11/07(今天);至今共发布 19 个版本,其中过去 12 个月发布了 19 个;首次发布于 2026/10/17。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。