Remotion + Excalidraw + TTS (Local)
Use this skill to turn an Excalidraw diagram + a voiceover script into a rendered MP4 using:
- - Remotion (render)
- Excalidraw (render the .excalidraw JSON directly)
- TTS via macOS
say (offline)
Quick start (one command)
Run:
CODEBLOCK0
Optional: drive camera/focus/subtitles via storyboard JSON:
CODEBLOCK1
What it does:
1) copies the Remotion template project from assets/template/remotion-project/ into a temp workdir
2) writes public/diagram.excalidraw
3) generates public/voiceover.mp3 via say + ffmpeg
4) sets composition duration to match the voiceover length
5) renders MP4 with INLINECODE6
Inputs
- -
--diagram: .excalidraw JSON file (from Excalidraw export) - INLINECODE9 : plain text file (Chinese supported)
Optional:
- -
--voiceover-mp3: if you already have audio, skip TTS - INLINECODE11 :
say (default) | openai | INLINECODE14 - INLINECODE15 : default INLINECODE16
TTS backends:
- - macOS say: INLINECODE17
- OpenAI:
--tts-backend openai --openai-model gpt-4o-mini-tts --openai-voice alloy (requires OPENAI_API_KEY) - ElevenLabs:
--tts-backend elevenlabs --elevenlabs-voice-id <voiceId> --elevenlabs-model eleven_multilingual_v2 (requires ELEVENLABS_API_KEY)
Customizing scenes (pan/zoom/highlights)
Option A: edit TypeScript storyboard
Template code lives in:
Edit scenes:
- -
cameraFrom/cameraTo (x/y/scale) - INLINECODE24 rectangle (x/y/width/height + label)
- INLINECODE25
Option B (recommended): provide storyboard.json
Pass --storyboard-json /abs/path/storyboard.json.
Schema reference:
Minimal example:
CODEBLOCK2
Requirements
- - macOS (for
say) - INLINECODE30 + INLINECODE31
- Node.js + npm (the script will run
npm i in the temp project)
Remotion + Excalidraw + TTS (本地)
使用此技能将 Excalidraw 图表 + 旁白脚本 转换为渲染后的 MP4 文件,基于以下工具:
- - Remotion(渲染)
- Excalidraw(直接渲染 .excalidraw JSON 文件)
- 通过 macOS say 实现的 TTS(离线)
快速开始(单条命令)
运行:
bash
python3 skills/remotion-excalidraw-tts/scripts/make_video.py \
--diagram /absolute/path/to/diagram.excalidraw \
--voiceover-text /absolute/path/to/voiceover.txt \
--out /absolute/path/to/out.mp4
可选:通过分镜 JSON 驱动摄像机/焦点/字幕:
bash
python3 skills/remotion-excalidraw-tts/scripts/make_video.py \
--diagram /absolute/path/to/diagram.excalidraw \
--voiceover-text /absolute/path/to/voiceover.txt \
--storyboard-json /absolute/path/to/storyboard.json \
--out /absolute/path/to/out.mp4
功能说明:
1) 将 assets/template/remotion-project/ 中的 Remotion 模板项目复制到临时工作目录
2) 写入 public/diagram.excalidraw
3) 通过 say + ffmpeg 生成 public/voiceover.mp3
4) 将合成时长设置为与旁白长度匹配
5) 使用 npx remotion render 渲染 MP4
输入参数
- - --diagram:.excalidraw JSON 文件(从 Excalidraw 导出)
- --voiceover-text:纯文本文件(支持中文)
可选参数:
- - --voiceover-mp3:如果已有音频,可跳过 TTS
- --tts-backend:say(默认)| openai | elevenlabs
- --fps:默认 30
TTS 后端:
- - macOS say:--tts-backend say --voice Tingting --rate 220
- OpenAI:--tts-backend openai --openai-model gpt-4o-mini-tts --openai-voice alloy(需要 OPENAIAPIKEY)
- ElevenLabs:--tts-backend elevenlabs --elevenlabs-voice-id --elevenlabs-model elevenmultilingualv2(需要 ELEVENLABSAPIKEY)
自定义场景(平移/缩放/高亮)
选项 A:编辑 TypeScript 分镜
模板代码位于:
- - assets/template/remotion-project/src/video/storyboard/storyboard.ts
编辑场景:
- - cameraFrom/cameraTo(x/y/缩放)
- focus 矩形(x/y/宽度/高度 + 标签)
- subtitle
选项 B(推荐):提供 storyboard.json
传递 --storyboard-json /abs/path/storyboard.json。
模式参考:
- - references/storyboard.schema.json
最小示例:
json
{
scenes: [
{
name: intro,
durationSec: 10,
subtitle: 很多智能体隔天就失忆。,
cameraFrom: {x: 0, y: 0, scale: 1},
cameraTo: {x: 0, y: 0, scale: 1},
focus: {x: 140, y: 120, width: 1640, height: 340, label: 问题}
}
]
}
系统要求
- - macOS(用于 say)
- ffmpeg + ffprobe
- Node.js + npm(脚本会在临时项目中运行 npm i)