Code-Driven
Video Studio

A skill for coding agents. Give it a reference video or an idea. It measures the shots, writes deterministic code, renders an MP4 frame by frame and scores it against the reference.

Get the skill on GitHubRead SKILL.md

Pick the right engine

p5-2d
Math art, kinetic type, particles, infographics, UI motion.
p5-webgl
Stylised 3D: low-poly, toon, orbiting cameras. Runs in the p5 editor.
three-hybrid
PBR metal and glass, bloom, fog, glTF, 10k+ instances, p5 HUD layer.
67.js · Blender bpy
Realistic 3D: rigs, HDRI light, soft shadows, path tracing. Code only.

How it recreates a video

  1. Analyse: cuts, per-shot camera, palette, motion curve and object tracks become keyframes.
  2. Recover 3D: camera path (COLMAP), human pose (MediaPipe → BVH), depth for layout.
  3. Build: one function per shot, every value from a KF timeline, real CC/own assets.
  4. Render: headless frame stepping to closed-GOP MP4, chunk re-render per shot.
  5. Score and fix: compare.py rates each shot, the worst one gets fixed first.

Examples

Math art Short
coming soon
Stylised 3D
coming soon
PBR spin
coming soon
Realistic 3D
coming soon

Quick start

pip install numpy pillow opencv-python-headless
npm i playwright && npx playwright install --with-deps chromium
python3 tools/analyze.py ref.mp4 --out ana
node tools/render.mjs templates/p5-2d --out test.mp4
bash templates/blender/render_blender.sh templates/blender/scene.py test3d.mp4 draft

Honest ceiling

CategoryHow close
2D motion graphics, math art, type, UINear 1:1
Low-poly / toon 3D, PBR product spinsNear 1:1
Realistic 3D scenes with assets + rig + HDRIAbout 70–90%
Identical character copies, live actionNot from code