Communitygithub.com

Any to Videos

Turn articles, products, data, and ideas into high-quality motion videos using code and AI — not PowerPoint-like slides. Supports product launches, UI animation reels, brand reels, voice-over explainers, science data animations, hand-drawn/painted/claymation/print-style films, 3D walkthroughs, music video beat syncs, and multi-style hybrids with generative video. Outputs single HTML (pure seek(t) function) → 60fps motion-blurred video with beat analysis, voiceover timeline, per-beat still review, semantic linting, skip-frame scanning, and independent final validation.

What is Any to Videos?

Any to Videos is a skill (SKILL.md) designed for AI agents like Claude Code, Cursor, or Codex to help developers and creators build cinematic, code-driven motion videos. The core principle is that every beat has a protagonist changing, with a cause, and the visuals do what sound cannot. The second principle: any pause reveals a well-framed design with clear subject, readable text, and minimal clutter. The skill supports multiple video types including product launches, UI animation reels, brand reels, voice-over explainers, science data animations, hand-drawn/painted/claymation/print style films, 3D walkthroughs, music video beat syncs, and multi-style hybrids that blend code with generative video. It also supports deconstructing and adapting reference videos. The workflow enforces discipline through gates (pauses for user review): brief, visual direction with prohibitions, clock (beat/voiceover timeline), structure & beat table, key still frames, production using a pure-function draw(t) in a single HTML file (film.html), self-inspection with semantic linting (render.mjs --lint), per-beat contact sheets (review.py sheet), skip-frame scanning (review.py scan), and independent final review by a fresh sub-agent. Rendering produces 60fps with 4 sub-frames for motion blur. Scripts include beat analysis (beats.py), voiceover generation and timeline export (voice.py), image generation via Codex (imagegen.py), and audio mixing (voice.py mix). Engineering conventions enforce fully deterministic pure functions (window.seek(t)), no CSS transitions/timers, fixed seed randomness, spring physics with closed-form step response, logarithmic zoom, stateful library adoption via pre-simulation tables, and full-frame encoded video blobs. Output is H.264 yuv420p with BT.709 color metadata. The skill explicitly demarcates boundaries: code handles precise text, numbers, interfaces, graphics, routes, data, order, camera moves, and beat alignment; real photo textures, real environment shots, real sound effects and music are left to assets; generative video models handle continuous character performance and natural motion; true 3D/claymation uses Three.js or Blender. The skill is accompanied by reference documents for quality principles, motion & camera techniques, style routing, prompt library, voice-over explainer workflow, sound & beat sync, and rendering & quality check, all in the references/ folder.

Works with~Claude Code✓Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/JS-banana/any-to-videos/tree/HEAD

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

What does Any to Videos do?

Turn articles, products, data, and ideas into videos that feel like real films. There is only one core criterion: every beat has a protagonist changing, the change has a cause, and the visuals do what sound cannot. If you don't meet this, no amount of effects will save it from being a moving PPT.

The second criterion is just as important: pause at any frame and you get a designed composition — the subject is clear, text is large enough, there isn't too much in the frame, and the composition works. The main weakness of this repository's output is here, not in motion.

SKILL_DIR = the directory containing this file. New videos go in a separate directory under the current project (e.g. <project>/<video-name>/), not inside the skill directory.

What to Read First

TaskRequiredOn Demand
Any video-making taskreferences/01-质感原则.md (includes §11 Visual Appeal, §12 Four-Pass Construction, §13 Interesting, §14 Content & Runtime, §15 People & Things Need Images)—
Decide video type, choose tech stackreferences/03-风格路由.md—
Write motion, shots, transitionsreferences/02-运动与镜头手艺.mdtemplates/film.html toolbox
Write prompts for model / yourselfreferences/04-提示词库.md—
Voice-over explainers / seriesreferences/05-口播讲解片流程.mdtemplates/DESIGN.md
Music, sound effects, mixingreferences/06-声音与卡点.md—
Rendering, self-check, deliveryreferences/07-渲染与质检.md—
Deconstruct someone else's video03-风格路由 § 参考片复刻scripts/review.py sheet
Need photographic assets, layers, style explorationreferences/08-生图素材.md (optional extension)scripts/imagegen.py
Choose tools, check what's available locally; integrate GSAP / physics / WebGL libraries03-风格路由 § 工具速查07 §1 Stateful library integration

Workflow (⛳ = pause and show the user for confirmation before proceeding)

This is the default route, not a fixed procedure: merge, adjust, or skip steps based on the size of your video, using your own judgment to make a better video. The gates have only one purpose — let the user see real frames before expensive steps.

  1. Brief ⛳: Copy templates/brief.md to the video directory. Ask about purpose, audience, the one thing they should remember, duration & aspect ratio, video type, and clock (music or voiceover). List all assets needed and ask the user for them (brand terms, 9–12 real photos, royalty-free music, sound effects, voiceover, font). If assets are missing, state what's missing — don't start with placeholder images, they're the source of cheapness; missing photographic assets can be supplemented with generated images (08-生图素材). Anything you can infer (aspect ratio, framerate, tech stack), decide yourself, don't ask. For explainer/narrative videos, do content research first (coincidences, details, character stories — prepare 2x what you need), create an "object → image" table — people and things can't just be names.
  2. Set Visual Direction & Prohibitions: Colors ≤ 3–4 (accent color only for current focus), font down to weight/axis, font size hierarchy (must-read text ≥ 28 px), materials (≤ 2 worlds for the whole video), camera style; write at least 5 prohibitions (defaults: crossfade, blur fade-in, dead frames, centered large text with gradient background, particle/glow clutter, breathing/floating false motion). For a series, do static + motion tests first, then write DESIGN.md.
  3. Clock: For music videos, run scripts/beats.py (and listen to --click to confirm BPM and downbeats); for explainers, use scripts/voice.py to generate voiceover, produce the timeline (timeline.js with kw() keyword moments), review its playback differences and segment health checks (inner WAV header, syllable ending louder than body, clipping — AI can't hear these, so the numbers act as its first ear), then have the user listen and confirm before locking.
  4. Structure & Beat Table ⛳: First propose 2–3 candidate structures (one sentence + why) and runtime allocation (intro short, climax long, first 3 seconds hook — the hook should be the most concrete, counterintuitive result of the whole video; give the result first, then the argument; the first frame having an image is just form, an abstract argument is not a hook). Once selected, write the state chain per segment (who → becomes what, what triggers it). For explainers, fill in "sound already given / new visuals / must-keep text" for each segment; then fill in "beat → event → shot → sound effect" table, seam table (exit vector → entry vector + carrier), and energy curve (build-up, climax, release, true silence). Mark a surprise beat roughly every 30 seconds. Place the climax beat at the most important revelation; reduce information density during interludes.
  5. Key Still Frames ⛳: Following the first two of the Four-Pass Construction (01 §12) — first use grayscale blocks to establish composition hierarchy, then replace with real copy for layout — produce 4 key frames (opening / core / climax / final) and show them to the user. After viewing, point out the model defaults in the frame and add them to the prohibitions. For complex continuous states or contact, first render a few seconds of a risk prototype.
  6. Production: Start from templates/film.html (toolbox: closed-form spring superposition, logarithmic space camera zoom, easing, deterministic randomness, grain, mark() semantic markers). Write all times as beat b(n) or keyword kw(); draw(t) is a pure function. Use mark() / fillTextM() conveniently for drawing protagonists, must-read text, subtitles; for explainers, set window.KEYS. Apply colors and materials only after motion is set.
  7. Self-Check (do not skip):
    • render.mjs film.html --lint: font size, number of text blocks, subject size, shot distance, dead frames, subtitle occlusion, reading time — fix each issue or give a reason;
    • render.mjs --stills beats|keys → review.py sheet --images stills/ (also produce a --width 360 mobile-size sheet) → read the contact sheet yourself, check each beat against the criteria in 07 §3 ①, identify and fix issues, then produce again;
    • key transitions --from/--to partial render + 0.05 s dense contact sheet;
    • full render (60fps × 4 sub-frames, use --jobs for long videos) → review.py scan: skip frames, frozen frames, first and last frame.
    • Independent Final Review: Dispatch a sub-agent with a fresh context, give it only the key frame contact sheet, brief, and prohibitions, not the production rationale. Let it produce a timeline-stamped issue list per 07 §5. Fix all P0 issues before delivery; if no review is available, write "No independent review obtained" in the delivery notes.
  8. Audio ⛳: Page window.cues() gives sound effect and music timings → render.mjs --cues → voice.py mix (ducking, peak alignment, dual loudness normalization) → beats.py verify back-test beat alignment; user confirms with their ears.
  9. Delivery: Final video (ffprobe confirm 60fps, color metadata, intact audio track) + source HTML + asset source/license + quality check records (lint, scan, independent review conclusions); honestly state any unchecked items (e.g. "not viewed on mobile portrait", "not heard on external speakers").
  10. Retrospective: Points of rework, points to repeatedly remind, points to optimize → write general methods back to this skill's references/, write series preferences back to DESIGN.md.

Small requests (single animation, modify one segment) don't need documentation; but inspect still frames and scan results yourself before delivery — it's the cheapest time to catch "looks like PPT" problems.

Revision Protocol (for both user feedback and self-checks): Write each as timestamp · location · problem → fix · items not to change, 3–5 items per round. Fix P0 first (viewer can't understand, can't read, factual error). Stop when the feedback changes from "I can't understand" to "I prefer something else".

Hard Engineering Conventions

  • Page contract: window.FILM = {width,height,fps,duration,bpm}, window.seek(t) (pure function), optional window.ready, window.inspect(t) (for linting), window.KEYS (key moments), window.cues() (audio timeline); canvas canvas#film.
  • No CSS transitions/animations, timers, rAF accumulated state; reset Canvas context every frame; fix all randomness with a seed; fonts and assets loaded in ready.
  • Springs use closed-form step response; when a value changes multiple times, superposition the responses (track()); camera zoom uses zoomAt() (logarithmic space).
  • Stateful libraries (GSAP, physics engines) are not advanced inside seek: after pause, tl.time(t); physics pre-simulate with fixed timestep in ready, look up by t (07 §1). WebGL pages use Metal backend by default in render.mjs.
  • Shapes covering a transition must extend beyond all four corners, with about 0.3 s expansion; cut scenes during occlusion.
  • Video assets: all intra-frame encoding + blob URL + wait for seeked on every frame.
  • Final video: H.264 yuv420p, BT.709 limited with color metadata (handled by render.mjs); use -t not -shortest for container.

Division of Labor Boundaries

  • Code excels at: precise text, numbers, interfaces, graphics, routes, data, order & quantity, camera moves, beat alignment.
  • Leave to assets: real photo textures, real location shots, real sound effects and music. If no ready asset exists, Codex can generate photo-grade images, layers, and multi-version compositions (code still overlays text and numbers).
  • Leave to video models: continuous character performance, natural motion, cross-style motion transitions — code overlays precise text and readings on top.
  • True 3D lighting/claymation: Three.js (DOF+Bloom) or Blender.

Scripts

cd "$SKILL_DIR/scripts" && npm install        # First time (Playwright; reuse local Chromium, fall back to system Chrome)
node render.mjs <film.html> -o out.mp4 [--audio mix.wav] [--fps 60] [--sub 4] [--from s --to s] [--scale 0.5]
node render.mjs <film.html> -o out.mp4 --jobs 6               # Long videos: parallel time-sliced render, lossless concatenation (12 s video ~84 s, single process ~6 min)
node render.mjs <film.html> --stills beats|keys|t1,t2,... -o stills/
node render.mjs <film.html> --lint [--json lint.json]       # Semantic check (requires page to use mark() markers)
node render.mjs <film.html> --cues audio/sound.json         # Export window.cues() audio timeline
python3 review.py sheet <video> [--from a --to b] --every 0.25 -o sheet.jpg   # Also used to deconstruct reference videos
python3 review.py sheet --images stills/ -o sheet.jpg [--width 360]   # 360 = mobile readability check
python3 review.py scan <video> [--hold 1.0]
python3 beats.py <song> --fps 60 -o beats.json --click check.wav [--bpm 120]
python3 beats.py peak <sfx.wav>
python3 beats.py verify audio/stem-sfx.wav audio/sound.json   # Back-test sound effect alignment (then add --ref audio/mix.wav to final video to measure overall offset)
python3 voice.py tts 口播稿.txt -o audio/vo [--provider gemini]  # Per-sentence AI voiceover (OpenAI or Gemini, pay per use; can also use your own recording)
python3 voice.py timeline 口播稿.txt --vo audio/vo             # → audio/voice.wav + timeline.js (kw()) + segment health + playback differences
# For short vertical videos (≤ 90 s), tighten pauses: --lead 0.2 --tail 1.6 --gap 0.12 --seg-gap 0.28, after re-beating use --extra to leave 0.3–0.45 s landing point
python3 voice.py mix audio/sound.json --voice audio/voice.wav -o audio/mix.wav
python3 imagegen.py gen "<Task A>" "<Task B>" -o assets/ [--ref 参考图] [--effort medium]   # Parallel image generation via Codex (ChatGPT quota)
python3 imagegen.py check assets/*.png [--align master.png variant.png --fix-align] [--clean-alpha]

Dependencies: Node 18+, ffmpeg, Python 3 (pip install -r scripts/requirements.txt: numpy, Pillow; librosa, soundfile for beats.py; openai-whisper for voice.py timeline; openai only needed for voice.py tts default backend).

Examples & Sources

  • Starter template demo: templates/film.html render result — text markers squeeze into ellipsis, ellipsis becomes capsule, cursor click, iris open, grid unfolds from behind, bento rearranges, camera pushes in, slider drives re-lighting, black shape fills transition, full circle. The procedural landscape is just placeholder; real photo assets are what make the final video look professional.
  • examples/ contains approved 002 / 005 / 006 / 007 case source code, see examples/README.md for details.
  • Methodology sources (only paraphrased and distilled, watch original videos from the authors): 卡尔的AI沃茨 "AI做代码动画动效大片的零基础教程" (marked 〔卡〕), 一只桌子 "我的 AI 视频制作流程和开源 SOP" (marked 〔桌〕).

Related Skills