Communitygithub.com

Remotion 數學解說影片產生器

建立同步、沉浸式的單面板 Remotion 數學解說影片(微積分、線性代數、微分方程、機率、證明),採用純 Log2Base2 單一階段格式,具備聚焦的單行方程式 spotlight、全螢幕 3Blue1Brown x Log2Base2 動畫幾何/資料動畫圖形、WordBoundary 卡拉 OK 字幕,以及快速 1080p MP4 渲染。

Remotion 數學解說影片產生器 是什麼?

此技能可將任何數學推導、定理、證明或投影片,轉換為完全同步、沉浸式的 1920×1080 30fps MP4 Remotion 解說影片。它採用統一的「單面板舞台」設計,讓觀眾的注意力集中在單一視覺敘事上,避免分屏或並排面板的干擾。影片結構包含一個頂部標題列、一個全寬度的 SVG 畫布(用於即時動畫幾何圖形和資料點),以及底部卡拉 OK 風格的字幕列,字幕會根據 TTS 的 WordBoundary 時間戳逐字高亮。它支援所有主要數學領域,並依賴 `remotion-best-practices` 技能進行動畫規則,使用 `uv` 執行 `edge-tts` 合成神經語音。使用者可以透過 CLI 命令編排整個工作流程:設計節拍 JSON 檔案、建構專案、合成語音,最後以 8 個 worker 的並行渲染方式輸出最終 MP4。此技能會強制執行速率限制以避免 API 過載,並提供常見錯誤的準則,例如避免多面板佈局或一次性顯示整個證明。

相容平台✓Claude Code~Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/uzowurumauritius-rgb/remotion-stage/tree/main/skills/remotion-math-explainer

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Remotion 數學解說影片產生器 (remotion-math-explainer)

概述

將任何數學推導、定理、證明或投影片,轉換為沉浸式、影格同步的 1920×1080 30fps MP4 Remotion 解說影片,採用單面板 Log2Base2 Studio 格式。

絕不將畫面分割成相互競爭的並排面板或堆疊的文字卡片牆。每部影片均使用一個統一的視覺舞台 (<SinglePaneStage>),讓觀眾的注意力完全鎖定在視覺敘事上:

  1. 極簡頂部列(內建於 SinglePaneStage 中的 44px):
    • 左側顯示主題標題 + 目前活躍章節膠囊;右側顯示細微的步驟計數器 + 細長的進度條。
  2. 一個統一的 Log2Base2 舞台(SinglePaneStage — 100% 寬度):
    • 聚焦的單行 Spotlight 標題: 僅顯示目前步驟標題和單一活躍方程式行(使用 borderBottom: "2px solid #FACC15" 原地高亮顯示正在朗讀的術語,從不添加水平內距),外加一個在 triggerFrame 彈入的緊湊活躍術語標註膠囊(符號 → 白話文意思)。
    • 全寬度沉浸式 SVG 畫布(viewBox="0 0 1600 680"): 寬敞的連續動畫圖形——包含彩色資料點且會伸縮的即時座標網格、從矩陣中物理滑出到次要區塊的數字、掃掠的雷射劃線、帶符號的量值條,以及解開回歸單位矩陣的 3D 單位立方體——直接整合在同一開放的畫布上。
  3. 極簡底部字幕列(VoiceoverCaptionBar — 68px):
    • 乾淨的置中卡拉 OK 逐字高亮字幕,由精確的 TTS WordBoundary 毫秒時間戳驅動。

相依性

  • remotion-best-practices (~/.gemini/skills/remotion/SKILL.md): 必須遵循所有 Remotion 動畫規則(useCurrentFrame()、interpolate()、spring()、<Sequence premountFor>、<Audio>、@remotion/google-fonts 以及零 CSS 過渡效果)。
  • uv (~/.gemini/config/plugins/science/skills/uv/SKILL.md): 需要執行 uv run --with edge-tts 以進行神經語音合成。

快速開始

# 1. 建立 Remotion 數學解說影片專案
uv run python3 \
  ~/.gemini/config/skills/remotion-math-explainer/scripts/explainer_cli.py \
  scaffold \
  --project-dir "/path/to/project" \
  --output "/path/to/project/scaffold-status.json"

# 2. 合成自然神經語音 + 精確的 WordBoundary 與術語時間戳
uv run --with edge-tts python3 \
  ~/.gemini/config/skills/remotion-math-explainer/scripts/explainer_cli.py \
  synthesize-voiceover \
  --project-dir "/path/to/project" \
  --beats-json "/path/to/project/beats.json" \
  --voice "en-US-AndrewNeural" \
  --rate "+2%" \
  --pause-sec 0.40 \
  --output "/path/to/project/public/voiceover/manifest.json"

# 3. 透過快速 8-worker 關鍵影格去重複渲染器輸出最終 1080p 30fps MP4
uv run python3 \
  ~/.gemini/config/skills/remotion-math-explainer/scripts/explainer_cli.py \
  render-mp4 \
  --project-dir "/path/to/project" \
  --composition-id "MathExplainer" \
  --out-name "MathExplainer.mp4" \
  --concurrency 8 \
  --output "/path/to/project/render-report.json"

沉浸式敘事與工作流程

  1. 設計充滿活力的節拍(beats.json):
    • 撰寫口語化、以鉤子開場的旁白(避免乾燥的教科書措辭),讓即使缺乏動機的學生也能保持參與。
    • 保持 snippet 在 2–4 行精簡內容,其中每個 token 逐字出現在一行中,並與 text 中一個乾淨的單一小寫 triggerWord 匹配。
    • 在具有連續曲線、向量、網格或飛行動畫的節拍上設定 "motionStepFrames": 2。
  2. 建構專案與合成語音:
    • 透過 scripts/explainer_cli.py 執行 scaffold(複製 SinglePaneStage.tsx、VoiceoverCaptionBar.tsx 和 render_full_mp4.mjs)和 synthesize-voiceover。
  3. 創作全畫布動畫圖形(viewBox="0 0 1600 680"):
    • 將您的沉浸式 SVG 舞台作為 children 傳遞給 <SinglePaneStage>。
    • 展示,而非告訴: 用物理運動取代靜態的項目符號/文字卡片——粒子/點在座標扭曲上移動、元素在位置之間飛翔、掃掠的雷射線、即時儀表,以及在同一開放畫布內的並排即時圖表。
    • 始終將扭曲/延伸的網格線包裹在 <clipPath> 內,使動畫永不溢出到標籤或膠囊上。
  4. 驗證靜止幀並渲染最終 MP4:
    • 執行 npm run lint,並在執行 render-mp4 之前,使用 read_file 檢查代表性的靜止幀(npx remotion still)。
    • 將最終的 .mp4 複製到 out/、專案根目錄和工作區根目錄。

速率限制與常見錯誤

  • scripts/explainer_cli.py 強制執行 /tmp/remotion_edge_tts.lock(0.35s 間隔,3 次重試,分別以 1s/2s/4s 回退)。
  • 切勿使用多面板分屏佈局或堆疊有邊框的子卡片——請使用 <SinglePaneStage>,以確保畫面上嚴格只有一個主要面板。
  • 切勿一次性在畫面上傾倒完整的多步驟證明;一次只 spotlight 一個活躍方程式行和一個活躍標註膠囊。
  • 切勿為高亮的內聯術語添加水平 padding(僅使用 borderBottom: "2px solid #FACC15" 和 backgroundColor)。

Individual skills in this repo

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

remotion-code-explainer

Creates synchronized, immersive single-pane Remotion visual explainer videos for source code (Mobile/Web UI, Backend, AI/ML, Algorithms) in a pure Log2Base2 single-stage format—with a focused single-line code spotlight, full-screen animated memory boxes, pointer arrows, data packets, and live execution state on one canvas, WordBoundary karaoke captions, and fast 1080p MP4 rendering. Use whenever the user asks to explain code with /remotion, build a code walkthrough video, or turn a voiceover script into an MP4 explainer.

remotion-electronic-explainer

Creates synchronized, immersive single-pane Remotion visual explainer videos for Electronic Engineering (Semiconductors, PN Junctions, Diodes, BJTs, MOSFETs, CMOS Logic, Op-Amp IC Stages, ADC/DAC, PCB Signal Integrity) in a pure Log2Base2 single-stage format—with a focused single-line device equation spotlight, full-screen animated carrier/channel diagrams and live I-V curves on one canvas, WordBoundary karaoke captions, and fast 1080p MP4 rendering. Use whenever the user asks to explain electronic engineering, semiconductors, transistors, or analog/digital ICs with /remotion.

remotion-physics-explainer

Creates synchronized, immersive single-pane Remotion visual explainer videos for Physics (Mechanics, Electromagnetism, Thermodynamics, Optics/Waves, Quantum Mechanics, Relativity) in a pure Log2Base2 single-stage format—with a focused single-line governing law spotlight, full-screen animated free-body/field/wave simulations and live telemetry on one canvas, millisecond-accurate WordBoundary karaoke captions, and fast 1080p MP4 rendering. Use whenever the user asks to explain physics with /remotion or animate a physical law/system.

remotion-software-explainer

Creates synchronized, immersive single-pane Remotion visual explainer videos for Software Engineering (System Design, Distributed Systems, Microservices, Kubernetes/Docker, Design Patterns, Database Internals, CI/CD, Networking) in a pure Log2Base2 single-stage format—with a focused single-line contract/YAML spotlight, full-screen animated architecture flows with traveling request packets and live trace timelines on one canvas, WordBoundary karaoke captions, and fast 1080p MP4 rendering. Use whenever the user asks to explain software engineering, system design, or architecture with /remotion.

相關技能