Communitygithub.com

kaiti-lecture-film-skill

楷体大字讲义电影全流水线 —— 用 Manim CE 把数学讲义/定理/证明做成 3Blue1Brown 风格的 16:9 楷体大字讲解视频,源码重建时间轴、分段 TTS 配音逐句对齐、自动复检验收,并支持扩展到 30-60 分钟长篇课程视频。Use when 用户要把讲义内容/数学定理做成讲解视频、复刻《实数完备性大电影》的楷体大字风格、要求 Manim 动画配解说且音画同步、制作一小时左右的系列课程视频,或抱怨配音与画面对不上。

kaiti-lecture-film-skill 是什么?

kaiti-lecture-film-skill is a Claude Code agent skill that 楷体大字讲义电影全流水线 —— 用 Manim CE 把数学讲义/定理/证明做成 3Blue1Brown 风格的 16:9 楷体大字讲解视频,源码重建时间轴、分段 TTS 配音逐句对齐、自动复检验收,并支持扩展到 30-60 分钟长篇课程视频。Use when 用户要把讲义内容/数学定理做成讲解视频、复刻《实数完备性大电影》的楷体大字风格、要求 Manim 动画配解说且音画同步、制作一小时左右的系列课程视频,或抱怨配音与画面对不上。.

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/FTZ-OPUS/manim-real-number-completeness/tree/HEAD

在你喜欢的 AI 中提问

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

文档

Kaiti Lecture Film Skill (楷体大字讲义电影)

Transform a set of notes / theorem(s) / a topic into a "Kaiti large-font · dark premium · frame-accurate audio sync" explainer video. Sample output: examples/real-number-completeness-film/out/实数完备性大电影_配音版_1080P60.mp4 (144 seconds / 1080P60 / 26 dubbed segments / 3D opening temple + historical section + 6 theorem proofs + 3D finale).

Pipeline at a glance:

Lecture content → ① Scene scripts (Python/Manim) → ② One-click render + stitch (build_film)
        → ③ Source-code timeline reconstruction → ④ Segment table + dubbing script (dub_config)
        → ⑤ TTS / self-recorded audio + cascade scheduling (dub_pipeline) → ⑥ Verification & acceptance (verify_film) → Delivery

1. Environment Requirements (Cross-platform)

DependencyPurposeInstallation
Python ≥ 3.10Run Manim & scriptspython.org / system package manager
Manim CE ≥ 0.18Render animationspip install manim (verify: manim --version)
FFmpeg + FFprobeStitching, dubbing mux, verificationmacOS brew install ffmpeg; Windows winget install ffmpeg; Linux apt install ffmpeg
LaTeX (including dvisvgm)MathTex formula renderingmacOS MacTeX; Windows MiKTeX; Linux TeX Live
edge-ttsFree Chinese TTSpip install edge-tts (not needed if using own recordings)
Kaiti-style Chinese fontFilm aestheticmacOS built-in Kaiti SC; Windows built-in KaiTi (楷体); Linux sudo apt install fonts-arphic-ukai or open-source LXGW WenKai. Details in assets/fonts/字体说明.md

Network: TTS & image sourcing need internet; rendering / stitching / verification run fully offline.

2. Directory Structure (Standard Skill Skeleton)

PartPathPurpose
Facade + BrainSKILL.md (this file)When to use, how, rule index
Practical GuideAGENT-实操指南.md (root)For the executing Agent: how to adapt any user content (not just sample theme) into this style
Knowledge Basereferences/Style spec · Dubbing methodology · Long video guide · Web image sourcing · Troubleshooting (read on demand, one topic per file)
Handsscripts/build_film.py render+stitch · dub_pipeline.py dubbing synthesis · verify_film.py verification
Sampleexamples/real-number-completeness-film/Complete runnable project: 3 scene source files + portrait assets + dubbing script + config + final video
Assetsassets/Font instructions · LaTeX template · scenes.json template
Manual Docs使用说明.pdf · 成本估算.pdfFor the client: environment setup / operation manual & token cost estimate

3. Standard Workflow (8 Steps)

  1. Project Init: Create a new project folder (suggest _proj-<topic>/), copy assets/portraits/ structure and any one scene source from the sample as skeleton.
  2. Scene Scripting: Write scene classes per references/style-guide.md. Each scene one construct, 30–90 seconds, self-contained (copy constants + base class into file, no cross-file import of scenes). MathTex must NOT contain Chinese characters.
  3. Single Scene Smoke Test: manim -ql your_file.py SceneClass → quick 480p render, check layout (zero overlap / no clipping).
  4. Render & Stitch: Write build/scenes.json (template at assets/templates/scenes.template.json), then python scripts/build_film.py build/scenes.json (incremental: --only SceneName; smoke test: --quality ql).
  5. Timeline Reconstruction: Follow references/timeline-dubbing.md to accumulate durations from source code, hard self-check: accumulated value = ffprobe measured (error ≤0.5s). If needed, use probes to pinpoint drift. Never build segment table by eye-balling.
  6. Segment Table + Script: Write work/dub_config.json (26-segment example in sample). Word budget ≈ (segment_length − 0.7s) × 4.6 words (real speech rate). Keep engaging but strictly matching the visuals.
  7. Dubbing Synthesis: python scripts/dub_pipeline.py work/dub_config.json Automates: segment TTS (with retry + silent trimming + hash caching) → cascade scheduling → ffmpeg mux → final video. Instructions for using own recordings in same document.
  8. Verification & Acceptance: python scripts/verify_film.py --master master.mp4 --dubbed final.mp4 --probes 5.5,11.2,143 Hard criteria: final duration = source ±0.5s; loudness -20 to -30dB with no dead segments; probe frames audio-video aligned.
  9. Delivery: out/ final video + out/段落表.txt + dubbing script .md. Run verify before delivery to get all green.

4. Quick Rules (Top 8, full list in references/troubleshooting.md)

  1. MathTex must NOT contain Chinese characters (LaTeX without ctex will crash) — use Text(zh_font=...) for Chinese, combined with VGroup(zh(...), mt(...)).arrange(RIGHT) for mixed content.
  2. ImageMobject is not a VMobject — put multiple objects in Group; using VGroup will crash.
  3. Surface types (Cylinder/Sphere) with fill_color will not work (default cyan checkerboard) — must use checkerboard_colors=[light, dark]; for solid color use checkerboard_colors=False.
  4. self.play(...) without run_time defaults to 1.0s; mixed animations take max; timeline accumulation must check each segment.
  5. Top-half text (build_deduction_block, y>0) and bottom-half graphics (shift(DOWN*1.9~2.0)) are strictly separated; all objects fit(width≤13.6) to avoid clipping.
  6. No hardcoded user paths in scripts — always use BASE_DIR = os.path.dirname(os.path.abspath(__file__)).
  7. TTS disconnections / long segments are common — pipeline includes retry and hash caching; change script only re-renders affected segments, not entire batch.
  8. Timeline mismatch ≠ restart: use "boundary +0.4s probe frames" to locate the few segments with drift, fix only those.

5. Long Videos (30–60 minutes) — Conclusion: No Problem

Architecture naturally supports: one scene per file, one chapter per manifest, chapter-by-chapter dubbing, lossless stitching, hash-cached incremental re-dub. 1 hour ≈ 45–60 scenes; render time ≈ 8–20× final duration (chapter-based unattended overnight runs); TTS free and per-segment cached.

Operational details, project structure, and resume-from-breakpoint specs in references/long-film-playbook.md.

6. References Index

When tasked with "turn these notes / article into a video in this style", first read root AGENT-实操指南.md (content transformation algorithm: any content → scene list → visual metaphor mapping), then browse below as needed.

FileWhen to read
style-guide.mdBefore writing any scene code (layout / font / color / component contracts / 3D specs)
timeline-dubbing.mdWhen entering dubbing phase (timeline reconstruction / probes / word budget / self-recorded audio)
long-film-playbook.mdWhen project exceeds 10 scenes (chapterization / incremental / capacity estimation)
web-image-sourcing.mdWhen needing historical portraits, illustration assets (web search + copyright boundaries)
troubleshooting.mdWhen errors occur, check here first before fixing

相关技能