Getting started with code-video-explainer
Install the local runtime and skill packs in minutes, preview frame-accurate animations in your browser, and export 1080p MP4 videos with synchronized SRT subtitles on demand.
1. Prerequisites
All rendering, voiceover alignment, and MP4 export run locally on your machine (Windows or macOS). Before installing a skill pack, verify these requirements:
- Python 3.10+ with required packages:
pip install numpy soundfile librosa playwright pillow playwright install chromium
- Node.js (18+ recommended) if you use JS linting or agent CLI tooling; the local web player itself runs standard ES modules directly in Chromium.
- ffmpeg installed and available on your system
PATH(used for audio mixing and 1080p MP4 export). - Optional dependencies:
faster-whisper(ortransformers+torch, ideally with GPU) for word-level alignment of real voice recordings; Tesseract OCR for screenshot text-box detection viatools/ocr_cap.py. - Supported AI coding agents: Claude Code (CLI / Desktop), OpenAI Codex, Antigravity, Cursor, or any coding agent using the included starter prompt.
Verify your Python environment in one command:
2. Three-Step Installation
Download & Unzip
Download the free Foundation pack (and any unit packs you own from My library) as zip archives and extract them.
Place in Skills Folder
Move the extracted folder into your agent's skills directory (see paths below) so your agent automatically discovers SKILL.md.
Scaffold & Prompt
Run new_project.py to verify the 94-second demo in your browser, then prompt your agent with your script or voiceover recording.
Agent skill directory paths
| Agent | Recommended Skill Folder |
|---|---|
| Claude Code / Claude Desktop | ~/.claude/skills/code-video-explainer-v4/ |
| OpenAI Codex | ~/.codex/skills/code-video-explainer-v4/ |
| Antigravity / Cursor / Other agents | Place in your workspace or agent skills folder and reference SKILL.md at the start of the session. |
Verify with the built-in 94-second demo
Open http://127.0.0.1:8765/index.html to play the demo. You can also inspect individual preset sheets via index.html?only=shotsheet, ?only=setsheet, ?only=charsheet, or mascot_sheet.html.
Example agent prompt
3. Production Workflow at a Glance
- Scaffold project: Run
python new_project.py <project-folder>and set your title inconfig.js. - Audio & word alignment: Run
python -X utf8 tools/build_audio.py --tts(offline voice) or--narration recording.mp3to generatetimeline.json,align.json, and background music viatools/make_bgm.py. - Storyboard & scenes: Generate word timestamps with
tools/words.py, map each spoken cue to presets (evidenceShot,photoShot,dataShot,stockShot,clipShot, 3D sets, 2D sticker scenes, or character skits), and register modules inconfig.js. - Automated QA: Run
python -X utf8 tools/spec_check.py --only <module>,tools/shoot.py,tools/margin_check.py, andtools/font_check.pyto clear layout, clipping, floating, or z-fighting issues. - Review & Export: Review in the browser deck (playback speed, press
Mfor timestamped notes, export review JSON for revisions viatools/read_review.py). When satisfied, click Export MP4 in the player and generate subtitles withtools/make_srt.py.
4. Troubleshooting
Timeline scrubbing does not work or embedded video clips drift out of sync
Always start the preview server with python serve.py 8765. Do not use python -m http.server, which does not support HTTP Range requests required for seeking audio and video clips.
A newly created project stays stuck on "Loading"
An empty scaffolded project has no audio or timeline.json yet. Run python -X utf8 tools/build_audio.py --tts (or pass --narration) to build the timeline, or create a demo project with --demo to preview immediately.
Playwright or Chromium fails when running shoot.py, spec_check.py, or capture.py
Ensure Chromium is installed via playwright install chromium. Also avoid running these scripts with Python's isolated flag (python -I), which can resolve a different environment without Playwright. Use python -X utf8 instead.
ffmpeg is not recognized during audio generation or MP4 export
Install ffmpeg and add its bin directory to your system PATH, then open a new terminal window and verify with ffmpeg -version.
Console shows CUE WARN and animations fire at the wrong timestamp
Every T.at(lineId, 'substring') call must match the aligned transcript verbatim. Check work/words.md or test a specific phrase using python -X utf8 tools/at.py N05 "your phrase". If a word repeats in the same line, append #2 for the second occurrence.
Console reports [R3-13] clipping, [R3-14] floating, or [R3-15] z-fighting flicker
For 3D scenes, place desk props with R.putOn instead of manual Y coordinates so objects rest cleanly on surfaces, leave at least 0.4 units between independent meshes, and offset custom floor planes from the default R.ground (y = 0) by at least 0.01.
3D model load failure (404 on models/*.glb)
Only models explicitly copied into your project's models/ folder are served. Run python -X utf8 tools/get_model.py <model_name> (or --list <keyword> to search) to copy the needed CC0 GLB asset into the project.
Browser preview freezes or misses sound effects when the tab is minimized
Browsers throttle requestAnimationFrame in hidden or background tabs. Keep the preview window visible during interactive playback, or use the headless screenshot tool (tools/shoot.py) for automated frame checks.
Text touches card edges or gets clipped inside panels
Keep text margins at least max(36px, 0.5 * fontSize) inside cards and boards. Run python -X utf8 tools/margin_check.py --only <module> to detect tight edges automatically.
5. Need Support?
python --version), coding agent name, and the full terminal or browser console error. We are happy to help you get running.