board-video-generator:基于 Node.js 和 FFmpeg 的白板视频生成工具

可将简单的板书课程脚本渲染为白板风格 MP4 视频。通过 Markdown 指令块定义文字、公式、箭头、方框等元素的位置和动画时长,本地 CLI 工具,操作便捷。【此简介由AI生成】

Branch1Tags0
FilesLast commitLast update
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago

Board Video Generator

Local CLI for rendering simple board lesson scripts into whiteboard-style MP4 videos.

Requirements

  • Node.js 22 or newer
  • FFmpeg on PATH

The current package may run on Node 20 for tests, but the documented target remains Node.js 22+.

Install

npm install

Render Demo

npm run render -- examples/demo.board.md

Output:

dist/demo.mp4

Script Format

Board scripts are Markdown files with directive blocks:

::write duration=1.2 x=120 y=120
Newton's Second Law
::

::formula duration=1.0 x=160 y=260
F = ma
::

::arrow duration=0.8 from=260,300 to=500,300
::

::box duration=0.8 x=140 y=230 width=460 height=130
::

Supported directives:

  • write
  • formula
  • arrow
  • box
  • clear reserved for later

Troubleshooting

Check FFmpeg:

ffmpeg -version

For Puppeteer or Chromium issues, reinstall dependencies:

npm install

Introduction

可将简单的板书课程脚本渲染为白板风格 MP4 视频。通过 Markdown 指令块定义文字、公式、箭头、方框等元素的位置和动画时长,本地 CLI 工具,操作便捷。【此简介由AI生成】

Customize your domain