code-video-explainerDocumentation
SETUP & TROUBLESHOOTING · V4 WORKFLOW

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.

Supports: Claude Code · OpenAI Codex · Antigravity · Cursor Need help? support@skillmp4.com

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 (or transformers + torch, ideally with GPU) for word-level alignment of real voice recordings; Tesseract OCR for screenshot text-box detection via tools/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:

python -c "import numpy, soundfile, librosa, playwright; print('ok')"

2. Three-Step Installation

Step 01

Download & Unzip

Download the free Foundation pack (and any unit packs you own from My library) as zip archives and extract them.

Step 02

Place in Skills Folder

Move the extracted folder into your agent's skills directory (see paths below) so your agent automatically discovers SKILL.md.

Step 03

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

python new_project.py ./my-demo --demo cd ./my-demo python serve.py 8765

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

Use code-video-explainer-v4 to create a video preview for this script. Follow SKILL.md and the step-by-step workflow docs, align the voiceover, run spec_check.py and shoot.py on each module, and deliver the local web preview first.

3. Production Workflow at a Glance

  1. Scaffold project: Run python new_project.py <project-folder> and set your title in config.js.
  2. Audio & word alignment: Run python -X utf8 tools/build_audio.py --tts (offline voice) or --narration recording.mp3 to generate timeline.json, align.json, and background music via tools/make_bgm.py.
  3. 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 in config.js.
  4. Automated QA: Run python -X utf8 tools/spec_check.py --only <module>, tools/shoot.py, tools/margin_check.py, and tools/font_check.py to clear layout, clipping, floating, or z-fighting issues.
  5. Review & Export: Review in the browser deck (playback speed, press M for timestamped notes, export review JSON for revisions via tools/read_review.py). When satisfied, click Export MP4 in the player and generate subtitles with tools/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?

Stuck on setup or a pack error? Email support@skillmp4.com with your OS, Python version (python --version), coding agent name, and the full terminal or browser console error. We are happy to help you get running.