Manim Video With Tts 标志

Manim Video With Tts

社区
dracohu2025-cloud
manim-video-with-tts

使用 Volcengine TTS 配音,端到端制作 Manim 数学科普视频。流程:规划 → TTS → 编码 → 渲染 → 拼接 → 交付。适用于用户需要以下内容时:Manim 动画 + 中文配音、配有同步旁白的数学概念视频、采用 TTS 配音的 3Blue1Brown 风格讲解视频,或任何需要精确音画同步的程序化动画。

Add to TypingMind

概览

发布者dracohu2025-cloud
代码仓库draco-skills-collection
技能名称manim-video-with-tts
星标数
228
复刻数
37
附带文件
4
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 4 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 dracohu2025-cloud 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Manim Video With Tts AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/dracohu2025-cloud/draco-skills-collection/tree/main/manim-video-with-tts
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dracohu2025-cloud/draco-skills-collection.git /tmp/draco-skills-collection
mkdir -p .claude/skills
cp -r /tmp/draco-skills-collection/manim-video-with-tts .claude/skills/manim-video-with-tts
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Manim Video With Tts,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Manim Video With Tts。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Manim Video With Tts 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Manim + Volcengine TTS Showcase Pipeline

Trigger Conditions

Use this skill when the user requests:

  • Manim animation with Chinese voiceover / narration
  • Math/tech explainer video where audio timing must match visuals
  • "用 Manim 做解释视频,并加上中文旁白"
  • "确保语音和画面节奏匹配"
  • 3Blue1Brown-style video with TTS integration

Pipeline Overview

PLAN → TTS → CODE → DRAFT → PRODUCTION → STITCH → MUX → DELIVER
StepToolOutput
1. PlanMarkdownplan.md — narrative arc, scene breakdown, voiceover script, color palette
2. TTSVolcengine TTSaudio/s01.mp3 ~ sNN.mp3 + duration manifest
3. CodeManim CEscript.py — one class per scene, run_times synced to audio
4. Draftmanim -ql480p15 preview clips for rhythm verification
5. Productionmanim -qh1080p60 final scene clips
6. Stitchffmpeg concatvideo_pro.mp4 — seamless scene assembly
7. Muxffmpegfinal.mp4 — video + narration mixed
8. Deliverlark-cli + webFeishu Drive link + HTTPS direct link

Prerequisites

  • Python 3.10+, Manim Community v0.20+
  • ffmpeg
  • Volcengine TTS credentials (VOLCENGINE_TTS_ACCESS_TOKEN, VOLCENGINE_TTS_APP_ID, VOLCENGINE_TTS_VOICE_TYPE_*)
  • lark-cli for Feishu upload
  • Web server directory /var/www/hermes.aigc.green/media/

Step 1: Plan

Write plan.md before any code. Include:

  1. Narrative Arc: Core question → Aha moment → Emotional curve
  2. Scene Breakdown: One table row per scene with timing, visuals, animation type
  3. Voiceover Script: Chinese text per scene, with estimated character count
  4. Color Palette: Background, target curve, approximation, text, accent, grid
  5. Typography: Monospace font only (FreeMono/DejaVu Sans Mono), minimum size 18

Rule: Scene count = audio segment count. Each scene gets exactly one TTS clip.

Step 2: Generate TTS & Measure Durations

Generate one MP3 per scene using Volcengine TTS:

bash
volc-tts --text '第N段旁白' --voice female --output ./audio/s0N.mp3

Then measure exact durations:

bash
for f in audio/*.mp3; do
  dur=$(ffprobe -v error -show_entries format=duration -of csv=p=0 "$f")
  echo "$f: ${dur}s"
done

Record these durations — they are the master clock for all Manim timing.

Step 3: Write Manim Code

Sync Strategy: Audio-Driven Timing

Since Manim does not natively support Volcengine TTS, use the manual sync approach:

python
# In each Scene.construct(), the sum of:
#   all run_time values + all self.wait() values
# must equal the corresponding audio clip duration.

Cross-Scene Continuity

To avoid rebuilding axes/curves every scene (wasting precious audio time):

python
class S3_NextScene(Scene):
    def construct(self):
        self.camera.background_color = BG
        axes = Axes(...)
        sin_curve = axes.plot(...)
        prev_curve = axes.plot(...)
        
        # Carry over from previous scene — instant, costs 0s
        self.add(axes, sin_curve, prev_curve)
        
        # Only animate NEW elements
        self.play(ReplacementTransform(prev_curve, next_curve), run_time=2.0)
        self.wait(...)
        # ...

Critical: The last frame of Scene N must match the first frame of Scene N+1 for seamless ffmpeg concatenation. If Scene N fades out an element, Scene N+1 must not self.add() it.

Duration Budgeting Template

For a scene with audio duration D:

D = Σ(run_times) + Σ(waits)

Recommended allocation:

  • Title/text appearance: 0.8–1.2s
  • Curve drawing/creation: 1.5–2.5s
  • Transform/morph: 1.5–2.0s
  • Formula writing: 0.8–1.0s
  • Indicator/effect: 0.5–0.8s
  • FadeOut cleanup: 0.3–0.5s
  • Breathing waits: distribute remainder

Color Constants (High-Contrast Showcase)

python
BG          = "#0A0A0F"      # deep void black
SIN_COLOR   = "#FF4D4D"      # coral red — target curve
APPROX_COLOR= "#00F5FF"      # electric cyan — approximation
TEXT_COLOR  = "#FFFFFF"      # pure white
ACCENT      = "#FFD93D"      # golden yellow
GRID_COLOR  = "#2A2A3A"      # dim purple-grey
MONO        = "FreeMono"     # or "DejaVu Sans Mono"

Step 4: Draft Render

bash
manim -ql script.py Scene1 Scene2 Scene3 ...

Verify each clip duration matches audio:

bash
ffprobe -v error -show_entries format=duration -of csv=p=0 media/videos/script/480p15/Scene1.mp4

If mismatch > 0.1s, adjust run_time or self.wait() in code and re-render.

Step 5: Production Render

bash
manim -qh script.py Scene1 Scene2 Scene3 ...

Step 6: Stitch & Mux

bash
# Video concat
cat > concat_video.txt << 'EOF'
file 'media/videos/script/1080p60/Scene1.mp4'
file 'media/videos/script/1080p60/Scene2.mp4'
...
EOF
ffmpeg -y -f concat -safe 0 -i concat_video.txt -c copy video_pro.mp4

# Audio concat
cat > concat_audio.txt << 'EOF'
file 'audio/s01.mp3'
file 'audio/s02.mp3'
...
EOF
ffmpeg -y -f concat -safe 0 -i concat_audio.txt -c copy audio_full.mp3

# Mux
ffmpeg -y -i video_pro.mp4 -i audio_full.mp3 -c:v copy -c:a aac -b:a 192k final.mp4

Step 7: Deliver

Web Server (Primary Link)

bash
cp final.mp4 /var/www/hermes.aigc.green/media/<filename>.mp4
# URL: https://hermes.aigc.green/media/<filename>.mp4

Feishu Drive (Backup)

bash
cd <project-dir>
lark-cli drive +upload --file ./final.mp4 --name "<Title>.mp4"
lark-cli drive metas batch_query --data '{"request_docs":[{"doc_token":"<TOKEN>","doc_type":"file"}],"with_url":true}'

Extract url from response for Feishu direct link.

Performance Targets

StageResolutionFPSTypical Speed
Draft (-ql)854×480155–15s/scene
Production (-qh)1920×10806030–120s/scene

Audience Adaptation: Two Dimensions

When adapting a technical explainer, distinguish two independent dimensions:

  1. Audience age: Adult → Kids (cognitive complexity)
  2. Locale: Global English → China-localized (language & cultural context)

These require separate rewrites. Do not try to make one version serve both purposes.

Dimension 1: Age Adaptation (Kids vs Adult)

When adapting for younger audiences (elementary/middle school), do not tweak—rewrite entirely. The kids version requires new plan, new script, new TTS, and new code.

AspectTechnical (Adult)Kids/Student
Narrative hook"泰勒展开" / "Taylor Expansion""计算器是怎么算出来的?"
Central metaphorMathematical approximationBuilding blocks (积木)
Character naming"目标曲线" / "逼近曲线"小红 & 小蓝 (give curves personalities)
PaceTight, efficient+20-30% duration, longer pauses between concepts
LanguageTechnical terms (derivative, order, convergence)Shape, slope, bend, "pretend", "looks like"
VoiceNeutralFemale voice (perceived as more approachable)
ColorsHigh-contrast electricSofter, friendlier palette

Kids-Optimized Color Palette:

python
BG          = "#0D1117"      # deep void (same)
SIN_COLOR   = "#FF6B6B"      # coral red — warmer, less aggressive
APPROX_COLOR= "#4ECDC4"      # mint cyan — softer than electric
TEXT_COLOR  = "#F0F6FC"      # off-white, easier on eyes
ACCENT      = "#FFE66D"      # golden yellow — magic/block highlights
GRID_COLOR  = "#30363D"      # dim grey
MONO        = "FreeMono"

Kids Script Guidelines:

  • "展开" / "expansion" → "搭积木" (building blocks)
  • "阶数" / "order" → "第几块积木" (which block)
  • "导数" / "derivative" → "斜率" (slope) or "弯的程度" (how much it bends)
  • "收敛" / "convergence" → "越来越像" (more and more alike)
  • "假装" (pretend) — the straight line is "pretending" to be the curve
  • "骗过眼睛" (fool the eye) — technical accuracy achieved through deception
  • "双胞胎" (twins) — when two curves become indistinguishable
  • "弯腰" (bend at the waist) — cubic term makes the line "bend"

Timing Adjustments for Kids:

python
# Adult version
self.wait(0.3)  # between phrases

# Kids version  
self.wait(0.5)  # longer breathing room

Add suspense pauses before reveals: self.wait(1.0) before "Here's the secret..."

Dimension 2: China Localization (中英双语注释)

When the audience is Chinese students, apply the Bilingual Annotation Principle:

Every English mathematical term must appear with its Chinese equivalent on first use.

This applies to both narration and on-screen text.

Bilingual Annotation Rules
RuleExampleBadGood
Narration: Chinese first, then English in parenthesessine"sine""正弦(sine)"
Narration: Read formulas in Chinese, not symbolsy=x"y equals x""y 等于 x(y=x)"
Narration: Describe operations in Chinesex³/6"x cubed over six""x 的立方除以六"
On-screen labels: 100% Chinesetitle"Math Magic""数学的魔法"
On-screen labels: Chinese with English sub-labelformula label"good fit!""很像!"
Math formulas: Keep standard notation on screeny=xRemove formulaKeep y=x on screen, but narration says "y 等于 x"

Critical: The mathematical notation (MathTex) on screen should never be removed or translated. The formula y = x, x - x³/6, etc. must remain in standard mathematical notation. Only the narration and text labels are localized.

China-Localized On-Screen Text Mapping
English Label中文标签Notes
Math Magic数学的魔法Title
How does a calculator know sine?计算器是怎么算出正弦的?Hook question
小红小红Character name (keep simple)
Let's pretend with a straight line!用直线来假装!Subtitle
Add a magic block!加一块魔法积木!Subtitle
good fit!很像!Region label
much better!更像了!Region label
Another block!再加一块!Subtitle
Here's the secret...秘密在这里...Subtitle
shape, slope, bend形状、斜率、弯曲度Concept text
Infinite simple blocks无限个简单积木Closing text
building something complex & beautiful搭出复杂又美丽的东西Closing text
Three-Version Iteration Pattern

In practice, producing a China-localized kids version requires three iterations:

VersionLanguageLabelsAudience
V1: Adult TechnicalEnglish terms, English labelsEnglishGlobal adult
V2: Generic KidsEnglish terms, mixed labelsEnglish/ChineseInternational kids
V3: China-localized KidsChinese + bilingual annotations100% ChineseChinese students

Workflow for V3:

bash
# 1. Create entirely new plan (do not reuse V1/V2 plan)
cat > plan-kids-cn.md << 'EOF'
## Audience: Chinese Elementary/Early Middle School
## Principle: Bilingual annotation (Chinese first, English in parens)
## Labels: 100% Chinese
## Voice: Female Chinese TTS
EOF

# 2. Write Chinese narration with bilingual annotations
# Example: "你有没有想过,计算器是怎么算出正弦(sine)的?"

# 3. Generate TTS with female voice
volc-tts --text '...' --voice female --output ./audio-kids-cn/s01.mp3

# 4. Create new script file with Chinese labels
# script-kids-cn.py — all Text() objects use Chinese strings

# 5. Render, stitch, deliver separately
Example: China-Localized Script Evolution
SceneV1 Adult (EN)V2 Kids (Mixed)V3 China Kids (CN+EN)
S1"sin x Maclaurin expansion""How does a calculator know sine?""你有没有想过,计算器是怎么算出**正弦(sine)**的?"
S3"First order gives tangent y=x""y=x fools the eye!""y 等于 x(y=x),居然在中心骗过了眼睛!"
S4"Introduce cubic correction -x³/6""Add a block: x³/6""数学家加了一块积木:减去 x 的立方除以六"
S6"Match derivatives at zero""Shape and slope match""形状、斜率、弯曲程度,都和小红一模一样!"
Pitfall: Symbol Reading in Chinese TTS

Chinese TTS cannot naturally read mathematical symbols. Never write:

  • ❌ volc-tts --text 'x³/6' — TTS will say random characters or fail
  • ❌ volc-tts --text 'y=x' — TTS may read as "y dengyu x" (awkward)

Always write the spoken Chinese description:

  • ✅ volc-tts --text '减去 x 的立方除以六' — natural Chinese
  • ✅ volc-tts --text 'y 等于 x' — natural Chinese

The screen still shows x - x³/6 and y=x via MathTex. The narration describes them in Chinese. This dual-channel approach (visual: standard notation, audio: Chinese description) is the core of bilingual annotation.

Workflow for Kids Version

bash
# 1. Save adult plan as baseline
cp plan.md plan-adult.md

# 2. Create entirely new plan
cat > plan-kids.md << 'EOF'
# Math Magic: How Calculators Know Sine
## Audience: Elementary/Early Middle School
## Metaphor: Building Blocks
## Characters: 小红 (target), 小蓝 (building)
EOF

# 3. Generate new TTS with female voice
volc-tts --text '...' --voice female --output ./audio-kids/s01.mp3

# 4. Create new script file (do not reuse adult script)
# script-kids.py with adjusted timings and softer colors

# 5. Render, stitch, deliver separately from adult version

Critical Pitfalls

  1. Font not found: Always use FreeMono or DejaVu Sans Mono. Menlo is macOS-only.
  2. SurroundingRectangle on point: SurroundingRectangle requires a Mobject, not a coordinate. Use Rectangle(...).move_to(point) instead.
  3. Frame quantization at 15fps: Draft (-ql) can have up to ~0.07s timing drift per animation. Production (-qh) at 60fps reduces this to ~0.017s.
  4. Audio shorter than video: If sum(video) > sum(audio), the final clip will have silent tail. Acceptable if < 0.5s. If larger, trim video with ffmpeg or adjust waits.
  5. Scene transition flash: If Scene N fades out elements that Scene N+1 self.add()s, ensure the last frame of N matches the first frame of N+1. Otherwise a "flash" occurs at the stitch point.
  6. Polynomial explosion: Taylor polynomials diverge outside the convergence radius. Set y_range wide enough to show the "shrinking" effect visually, or clip x_range to safe bounds.
  7. Kids version feels rushed: If adapting for kids, increase all waits by 50%. Children's processing speed is slower; they need time to connect the metaphor to the math.

Sync Quality Checklist

  • Each scene's run_time + wait sum matches audio duration within 0.1s
  • Production render durations verified with ffprobe
  • No visual flash at scene stitch points
  • Audio concat duration matches video concat duration within 0.5s
  • Final mux outputs without -shortest truncation
  • Both Feishu + Web links tested and accessible

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Manim Video With Tts AI 技能有什么作用?

使用 Volcengine TTS 配音,端到端制作 Manim 数学科普视频。流程:规划 → TTS → 编码 → 渲染 → 拼接 → 交付。适用于用户需要以下内容时:Manim 动画 + 中文配音、配有同步旁白的数学概念视频、采用 TTS 配音的 3Blue1Brown 风格讲解视频,或任何需要精确音画同步的程序化动画。

为什么在 TypingMind 中使用 Manim Video With Tts?

因为您只需安装一次,就能搭配任何模型使用。Manim Video With Tts 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Manim Video With Tts?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/dracohu2025-cloud/draco-skills-collection/tree/main/manim-video-with-tts。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Manim Video With Tts?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Manim Video With Tts 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Manim Video With Tts 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Manim Video With Tts AI 技能免费吗?

dracohu2025-cloud 已在 GitHub 上发布了该技能。请查看代码仓库了解许可条款。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇