Communitygithub.com

assafkip/claude-video-editor

使用 Manim Community Edition 制作数学与技术动画的生产管线,可创作 3Blue1Brown 风格的解释视频、算法可视化、方程推导、架构图及数据故事。

claude-video-editor 是什么?

该技能提供了一套完整的视频制作管线,专为生成教育类动画而设计,特别适合数学、计算机科学和技术概念的演示。它基于 Manim Community Edition,支持多种内容模式,包括概念讲解、方程推导、算法可视化、数据故事和架构图等。技能强调“第一次渲染即高品质”,并包含详细的创意指导方针,如颜色调板、动画节奏、排版规范及每场景差异化设计。工作流程分为计划、编码、渲染、拼接、音频和审查六个阶段,并提供了丰富的参考文档。该技能的目标是生成视觉优雅、逻辑清晰的教育视频,避免“AI 生成幻灯片”式的平庸结果。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/assafkip/claude-video-editor/tree/HEAD/skills/video-use/skills/manim-video

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Manim 视频制作管线

创意标准

这是教育电影。每一帧都在教学。每一个动画都在揭示结构。

在写一行代码之前,先阐述叙事弧。这个视频纠正什么误解?什么是“顿悟时刻”?什么样的视觉故事能带领观众从困惑走向理解?用户的提示是起点——用教学上的雄心去诠释它。

**几何优先于代数。**先展示形状,再展示方程。视觉记忆的编码速度比符号记忆更快。当观众在看到公式之前先看到几何图案时,这个方程就会让人感觉是水到渠成的。

**首次渲染的高品质不容妥协。**输出必须视觉清晰、美学统一,无需修改轮次。如果某个部分显得杂乱、节奏不佳,或者像“AI 生成的幻灯片”,那就是错误的。

**透明度分层引导注意力。**永远不要将所有元素设置为全亮度。主要元素为 1.0,上下文元素为 0.4,结构元素(坐标轴、网格)为 0.15。大脑会分层处理视觉显著性。

**留出呼吸空间。**每个动画之后都需要 self.wait()。观众需要时间来吸收刚刚出现的内容。永远不要从一个动画匆忙切换到下一个。关键揭示后的 2 秒停顿绝非浪费。

**统一的视觉语言。**所有场景共享一个调色板、一致的排版字号、匹配的动画速度。一个技术上正确但每个场景使用随机不同颜色的视频,在美学上是失败的。

前置条件

运行 scripts/setup.sh 以验证所有依赖项。需要:Python 3.10+、Manim Community Edition v0.20+(pip install manim)、LaTeX(Linux 上为 texlive-full,macOS 上为 mactex)以及 ffmpeg。参考文档基于 Manim CE v0.20.1 进行测试。

模式

模式输入输出参考
概念讲解话题/概念带有几何直觉的动画解释references/scene-planning.md
方程推导数学表达式逐步动画证明references/equations.md
算法可视化算法描述使用数据结构的逐步执行references/graphs-and-data.md
数据故事数据/指标动画图表、对比、计数器references/graphs-and-data.md
架构图系统描述组件逐步构建与连接references/mobjects.md
论文讲解研究论文关键发现和方法的动画呈现references/scene-planning.md
3D 可视化3D 概念旋转曲面、参数曲线、空间几何references/camera-and-3d.md

技术栈

每个项目一个 Python 脚本。无需浏览器、无需 Node.js、无需 GPU。

层工具用途
核心Manim Community Edition场景渲染、动画引擎
数学LaTeX (texlive/MiKTeX)通过 MathTex 渲染方程
视频 I/Offmpeg场景拼接、格式转换、音频混合
TTSElevenLabs / Qwen3-TTS(可选)旁白配音

管线

规划 --> 编码 --> 渲染 --> 拼接 --> 音频(可选)--> 审查
  1. 规划 — 编写 plan.md,包含叙事弧、场景列表、视觉元素、调色板、旁白脚本
  2. 编码 — 编写 script.py,每个场景一个类,可独立渲染
  3. 渲染 — manim -ql script.py Scene1 Scene2 ... 用于草稿,-qh 用于生产
  4. 拼接 — 使用 ffmpeg 将场景片段拼接为 final.mp4
  5. 音频(可选)— 通过 ffmpeg 添加旁白和/或背景音乐。参见 references/rendering.md
  6. 审查 — 渲染预览静帧,对照计划验证,调整

项目结构

project-name/
  plan.md                # 叙事弧、场景分解
  script.py              # 所有场景在一个文件中
  concat.txt             # ffmpeg 场景列表
  final.mp4              # 拼接后的输出
  media/                 # Manim 自动生成
    videos/script/480p15/

创意指导

调色板

调色板背景色主色辅助色强调色使用场景
经典 3B1B#1C1C1C#58C4DD (蓝)#83C167 (绿)#FFFF00 (黄)通用数学/计算机科学
温暖学术#2D2B55#FF6B6B#FFD93D#6BCB77亲民风格
霓虹科技#0A0A0A#00F5FF#FF00FF#39FF14系统、架构
单色#1A1A2E#EAEAEA#888888#FFFFFF极简风格

动画速度

上下文run_time之后 self.wait()
标题/开场出现1.5s1.0s
关键方程揭示2.0s2.0s
变换/变形1.5s1.5s
辅助标签0.8s0.5s
FadeOut 清理0.5s0.3s
“顿悟时刻”揭示2.5s3.0s

排版层级

角色字号用法
标题48场景标题、开场文字
标题36场景内章节标题
正文30解释性文字
标签24注释、坐标轴标签
说明文字20字幕、小字

字体

**所有文本使用等宽字体。**Manim 的 Pango 渲染器对于比例字体在所有字号下都会产生错误的字距。完整建议请参见 references/visual-design.md。

MONO = "Menlo"  # 在文件顶部定义一次

Text("傅里叶级数", font_size=48, font=MONO, weight=BOLD)  # 标题
Text("n=1: sin(x)", font_size=20, font=MONO)              # 标签
MathTex(r"\nabla L")                                      # 数学(使用 LaTeX)

为了可读性,最小 font_size=18。

每场景差异化

永远不要对所有场景使用相同的配置。对于每个场景:

  • 使用调色板中的不同主色
  • 采用不同的布局 —— 不要总是将所有内容居中
  • 使用不同的动画入场方式 —— 在 Write、FadeIn、GrowFromCenter、Create 之间变换
  • 设置不同的视觉密度 —— 一些场景密集,另一些稀疏

工作流程

第一步:规划 (plan.md)

在任何代码之前,编写 plan.md。完整的模板请参见 references/scene-planning.md。

第二步:编码 (script.py)

每个场景一个类。每个场景可独立渲染。

from manim import *

BG = "#1C1C1C"
PRIMARY = "#58C4DD"
SECONDARY = "#83C167"
ACCENT = "#FFFF00"
MONO = "Menlo"

class Scene1_Introduction(Scene):
    def construct(self):
        self.camera.background_color = BG
        title = Text("为什么这会有效?", font_size=48, color=PRIMARY, weight=BOLD, font=MONO)
        self.add_subcaption("为什么这会有效?", duration=2)
        self.play(Write(title), run_time=1.5)
        self.wait(1.0)
        self.play(FadeOut(title), run_time=0.5)

关键模式:

  • 每个动画都添加字幕:self.add_subcaption("text", duration=N) 或在 self.play() 上使用 subcaption="text"
  • 在文件顶部定义共享颜色常量,以确保跨场景一致性
  • 在每个场景中设置 self.camera.background_color
  • 清晰的退出 —— 在场景结束时 FadeOut 所有 mobject:self.play(FadeOut(Group(*self.mobjects)))

第三步:渲染

manim -ql script.py Scene1_Introduction Scene2_CoreConcept  # 草稿
manim -qh script.py Scene1_Introduction Scene2_CoreConcept  # 生产

第四步:拼接

cat > concat.txt << 'EOF'
file 'media/videos/script/480p15/Scene1_Introduction.mp4'
file 'media/videos/script/480p15/Scene2_CoreConcept.mp4'
EOF
ffmpeg -y -f concat -safe 0 -i concat.txt -c copy final.mp4

第五步:审查

manim -ql --format=png -s script.py Scene2_CoreConcept  # 预览静帧

关键实现说明

LaTeX 原始字符串

# 错误:MathTex("\frac{1}{2}")
# 正确:
MathTex(r"\frac{1}{2}")

边缘文本的 buff >= 0.5

label.to_edge(DOWN, buff=0.5)  # 绝不要小于 0.5

替换文本前先 FadeOut

self.play(ReplacementTransform(note1, note2))  # 而不是在上面直接 Write(note2)

永远不要动画化未添加的 Mobject

self.play(Create(circle))  # 必须先添加
self.play(circle.animate.set_color(RED))  # 然后动画化

性能目标

质量分辨率FPS速度
-ql(草稿)854x480155-15秒/场景
-qm(中等)1280x7203015-60秒/场景
-qh(生产)1920x10806030-120秒/场景

始终在 -ql 下迭代。仅在最终输出时使用 -qh 渲染。

参考文献

文件内容
references/animations.md核心动画、速率函数、组合、.animate 语法、时序模式
references/mobjects.md文本、形状、VGroup/Group、定位、样式、自定义 mobject
references/visual-design.md12 条设计原则、透明度分层、布局模板、调色板
references/equations.mdManim 中的 LaTeX、TransformMatchingTex、推导模式
references/graphs-and-data.md坐标轴、绘图、BarChart、动画数据、算法可视化
references/camera-and-3d.mdMovingCameraScene、ThreeDScene、3D 曲面、相机控制
references/scene-planning.md叙事弧、布局模板、场景过渡、规划模板
references/rendering.mdCLI 参考、质量预设、ffmpeg、旁白工作流、GIF 导出
references/troubleshooting.mdLaTeX 错误、动画错误、常见错误、调试
references/animation-design-thinking.md何时动画 vs 显示静态、分解、节奏、旁白同步
references/updaters-and-trackers.mdValueTracker、add_updater、always_redraw、基于时间的更新器、模式
references/paper-explainer.md将研究论文转化为动画 —— 工作流、模板、领域模式
references/decorations.mdSurroundingRectangle、Brace、箭头、DashedLine、Angle、注释生命周期
references/production-quality.md编码前、渲染前、渲染后检查清单、空间布局、颜色、节奏

创意发散(仅在用户要求实验性/创意性/独特输出时使用)

如果用户要求创意性、实验性或非常规的解释方法,请在设计动画之前选择一种策略并进行推理。

  • SCAMPER —— 当用户希望以新颖的方式呈现标准解释时
  • 假设反转 —— 当用户希望挑战通常的教授方式时

SCAMPER 变换

对一个标准的数学/技术可视化进行变换:

  • 替代:替换标准的视觉隐喻(数轴 → 蜿蜒路径,矩阵 → 城市网格)
  • 组合:合并两种解释方法(代数 + 几何同时进行)
  • 逆向:反向推导 —— 从结果开始,解构到公理
  • 修改:夸大某个参数以展示其重要性(10 倍的学习率,1000 倍的样本量)
  • 消除:移除所有符号 —— 仅通过动画和空间关系进行解释

假设反转

  1. 列出该主题“标准”的可视化方式(从左到右、2D、离散步骤、形式化符号)
  2. 选择最根本的假设
  3. 反转它(从右到左推导、2D 概念的 3D 嵌入、连续变形而非离散步骤、零符号)
  4. 探索这种反转揭示了哪些标准方法所隐藏的东西

Individual skills in this repo

This repo contains 9 individual skills — each has its own dedicated page.

assafkip/claude-video-editor

Build videos from stills when there is nothing to cut — narration first (ElevenLabs v3 with audio tags), then still keyframes from ANY source (AI image tools, screenshots, photos, HyperFrames-rendered HTML), animated deterministically with the animate-stills recipe (HyperFrames camera moves + GSAP atmosphere). Use when the user wants an explainer, documentary-style video, or any video built from generated or collected visuals instead of recorded footage.

assafkip/claude-video-editor

GSAP animation reference for HyperFrames. Covers gsap.to(), from(), fromTo(), easing, stagger, defaults, timelines (gsap.timeline(), position parameter, labels, nesting, playback), and performance (transforms, will-change, quickTo). Use when writing GSAP animations in HyperFrames compositions.

assafkip/claude-video-editor

HyperFrames CLI tool — hyperframes init, lint, preview, render, transcribe, tts, doctor, browser, info, upgrade, compositions, docs, benchmark. Use when scaffolding a project, linting or validating compositions, previewing in the studio, rendering to video, transcribing audio, generating TTS, or troubleshooting the HyperFrames environment.

assafkip/claude-video-editor

Install and wire registry blocks and components into HyperFrames compositions. Use when running hyperframes add, installing a block or component, wiring an installed item into index.html, or working with hyperframes.json. Covers the add command, install locations, block sub-composition wiring, component snippet merging, and registry discovery.

assafkip/claude-video-editor

Create video compositions, animations, title cards, overlays, captions, voiceovers, audio-reactive visuals, and scene transitions in HyperFrames HTML. Use when asked to build any HTML-based video content, add captions or subtitles synced to audio, generate text-to-speech narration, create audio-reactive animation (beat sync, glow, pulse driven by music), add animated text highlighting (marker sweeps, hand-drawn circles, burst lines, scribble, sketchout), or add transitions between scenes (crossfades, wipes, reveals, shader transitions). Covers composition authoring, timing, media, and the full video production workflow. For CLI commands (init, lint, preview, render, transcribe, tts) see the hyperframes-cli skill.

assafkip/claude-video-editor

Beginner-friendly end-to-end video creator for HyperFrames. Use when the user says "make a video", "create a video", "new video", "build a video", "video from scratch", "I want to make a video", "help me create a video", or when someone who's never used HyperFrames before arrives with a concept, script, or rough idea and wants a finished MP4. Interviews the user in one pass, then builds the full video with mandatory preview and visual-verification gates.

assafkip/claude-video-editor

Build and iterate short-form vertical (9:16) videos in Hyperframes — TikTok/Reels/Shorts style. Use when Nate says "short-form video", "vertical video", "TikTok/Reels/Shorts", "make a short", "talking-head + motion graphics", or when the target is a 1080x1920 composition with face video + synced scene overlays + karaoke captions. Encodes the full May Shorts 19 playbook: face-mode choreography, audio-synced scene timing, karaoke captions, and the 10-rule quality checklist.

assafkip/claude-video-editor

Edit any video by conversation — the orchestrator for the bundled video pipeline. Use when the user wants to edit, cut, caption, grade, or add motion graphics to footage; drops a folder of clips and says "edit this"; or asks to make a promo/teaser/tutorial/short. Routes to video-use (the cut engine) and HyperFrames (motion-graphics overlays), with a motion-craft library for taste.

assafkip/claude-video-editor

Capture a website and create a HyperFrames video from it. Use when: (1) a user provides a URL and wants a video, (2) someone says "capture this site", "turn this into a video", "make a promo from my site", (3) the user wants a social ad, product tour, or any video based on an existing website, (4) the user shares a link and asks for any kind of video content. Even if the user just pastes a URL — this is the skill to use.

相关技能