Skip to main content

video-basic

ShippedSkillFrom skills/video-basic/SKILL.md

Make a short MP4 explainer or promo video for a software project in the "talking head + animated UI cards" YouTube style, from one HTML page rendered with headless Chrome and ffmpeg. Use for a quick, finished video; use video-pro for an editable DaVinci Resolve timeline.

npx skills add rtorcato/video-ai --skill video-basic

Turns a software project (a repo, README, docs site) into a 30–60s MP4 (1080p30 by default; --size WxH and --fps N for 4K, 60 fps, etc.): gradient backgrounds, white UI cards that spring in, terminals typing real commands, checklists that tick off, highlighter caption pills, and a rounded box for the presenter's talking head.

It costs nothing to render: no Remotion license, no paid AI video credits. The video is one self-contained index.html with a deterministic render(t), filmed frame by frame by Playwright and piped into ffmpeg.

Read references/style.md before writing the page. It has the tokens, animation helpers, render(t) rules and pitfalls. templates/index.html is a complete working page to start from.

Other looks: if the user asks for a different style, or the content suits one better, start from one of templates/<style>/index.html instead: ledger (flat editorial, tutorials), prompt (terminal-first, CLI tools and changelogs), walkthrough (step-by-step phone how-tos) gameshow (quiz-show explainer, short quizzes and myth-busters) orbit (space mission control, launches and feature drops for a younger audience) or market (finance desk with three hosts, charts and a stock ticker, for market recaps and money explainers). Market's camera windows are styled placeholders: in a real build, swap each window for that host's recorded footage. Each has dark and light themes and reads brand.json. You fill in its beats.json rather than writing scenes. See Styles.

Needs: Python 3 with pip install playwright (then playwright install chromium, or use an installed Chrome), and ffmpeg.

1. Research the project (accuracy over polish)​

Never invent what the tool does when the source is reachable.

  • Read the README, AGENTS.md or CLAUDE.md, example configs, and the CLI help or reference. Take real commands, output shapes and example data from them.
  • Find brand assets (brand/, DESIGN.md, favicon, logo, mascot) and any brand.json (see the style guide). Use the project's own palette.
  • If commands or package names don't exist yet, use plausible ones, keep them in variables at the top of the script, and say in the reply that they're placeholders.
  • Check whether the project has been renamed. Use the name the user asked for and mention the other.

2. Script it as beats (one idea per scene)​

A proven structure for teaching a dev tool to someone new:

  1. Hero (optional, about 5s): dark brand field, wordmark, tagline, a $ command typing, logo or mascot animating in.
  2. Intro with talking head: camera box on the left; on the right a title card ("New to X?") and three checklist rows that tick off.
  3. The problem / old way: manual chores pop in and get crossed out, a red pill names the pain, then a yellow pill gives the new way.
  4. Step 1…N: a STEP n OF N tag and a big title, then a terminal or code card with the real commands and output.
  5. Payoff visual: a hub-and-spokes diagram (centre circle plus cards with progress bars and status pills), or a small simulation of the tool working.
  6. Outro with talking head: camera box, logo card with URL, recap checklist, a call-to-action pill.

Give each section its own background and blur-dissolve between scenes. Keep caption pills to 2–5 words. Write the spoken line for each beat at about 2.5 words per second, so the user has a script to record.

The script is beats.json. Every template (the default, the six styles, and video-pro) reads the same format, described by scripts/beats.schema.json: a top-level object with a beats array, plus optional name, tagline, url and meta. Each beat has:

  • id (b1, b2…), start and end in seconds. Beats start at 0 and run back to back: no gaps, no overlaps, unique ids.
  • vo: the spoken line. text, title, kicker: on-screen text (*stars* mark the emphasis word).
  • Layout hints: type picks the template's beat layout, bg its background (video-pro uses mode instead).
  • Anything else the template's layout needs (rows, options, series…). Copy the template's own beats.json and keep its field names.

python3 render.py validate beats.json checks a script and lists every problem with its path. render.py stills and video run the same check first, then write beats.js next to the page, which the page loads (browsers can't fetch() a file over file://).

3. Build the page​

Work in one folder per video: index.html, beats.json, a copy of the whole scripts/ folder's contents (render.py, check.py, parallel.py, compose.py, publish.py, subs.py, beats.py, beats.schema.json and fonts/), and any assets next to them. Start from templates/index.html and its beats.json: edit the beats, and add or change a layout in the page's L object when a scene needs one. With a style template, copy templates/<style>/index.html and its beats.json, edit the beats, paste brand.json into BRAND, and set THEME. The length is always the last beat's end.

4. Check, then render once​

  1. python3 render.py check index.html (add times to pick your own, e.g. 4.0 12.5 20.0). It samples 8 frames, prints JSON and exits non-zero on text overflowing its box, content off the canvas, overlapping cards, text contrast below WCAG AA, or a render(t) that isn't deterministic. Fix what it names and re-run until it passes. Mark a deliberate break (a watermark, a ticker) with data-check-ignore.
  2. python3 render.py sheet index.html [times…] writes stills/sheet.jpg, a labelled contact sheet. Look at it at full size.
  3. Fix anything check can't see (taste, pacing). Then render once: python3 render.py video index.html out.mp4. It films 5-second segments in parallel (--jobs N, default half the CPUs up to 4), so a 45s video takes well under a minute. If a render stops part-way, run the same command again and it films only the missing segments (--fresh starts over). Add --offline to fail the render if the page reaches for the network.
  4. Sample a few frames from the MP4 (select='eq(n\,N)+…',tile=3x3) to confirm the transitions.

Vertical (9:16) for Shorts, Reels and TikTok​

python3 render.py --size 1080x1920 video index.html short.mp4 (or stills, check, sheet with the same --size). Every shipped template has a vertical layout: when the output is taller than wide, the page gets a 1080x1920 stage and lays itself out for it, from the same beats.json. Each style keeps its colours, fonts and motion; only the layout changes. Camera beats become a stack: the camera window on top, the graphics underneath (in beats.json, mode: "stack"; pipL/pipR draw as a stack on a vertical size). compose fills the window the same way: a 16:9 take is centre-cropped to it, a 9:16 phone take fills it. Gameshow and Orbit have no camera beat in their samples: give a reveal (Gameshow) or card (Orbit) beat mode: "stack" to put the camera window on top of it in the vertical render (the 16:9 render ignores it).

Nothing readable goes where the platform UI covers the frame: the top 220px, the bottom 420px, and the right-hand button rail (x > 940 from y 880). On the vertical stage check adds a safe-zone rule for exactly that, and burned-in --captions sit 440px up, at most 800px wide. A page of your own opts in with <meta name="video-ai:stages" content="1920x1080 1080x1920"> and branches its layout on innerHeight > innerWidth; without the tag a vertical size keeps the 16:9 stage and pads the rest. video-pro has its own vertical layout: see its SKILL.md.

Subtitles and captions​

Every beat's vo line, timed to its beat, makes the subtitles:

python3 render.py subs beats.json # subs.srt and subs.vtt next to beats.json
python3 render.py --captions video index.html out.mp4 # the same lines burned into the video

Lines wrap at 42 characters (--max-chars N), two lines per cue; a longer line becomes several cues that share its beat's time. Beats with no vo get no cue. Ship the .srt/.vtt beside the MP4 so players and YouTube can switch them on; burn them in (--captions, which also works with stills) for feeds that autoplay muted. The burned-in bar sits bottom centre in the template's own panel colour, ink and font, so it follows the dark and light themes; a page can override --cap-bg, --cap-ink, --cap-font, --cap-size and --cap-bottom. Gameshow already shows each vo as its host line, so it doesn't need --captions. If you narrate with video-voice, write the subtitles after retime so they match the voice.

5. Put the talking head in​

Once the presenter has recorded their take, drop it into the camera box:

python3 render.py compose index.html out.mp4 take.mp4 final.mp4 --offset 8.55

compose opens the page at the render's size, finds the camera box (the first visible .cam; pass --box SELECTOR for another) on every frame, and lays the take into it: scaled to cover the box, with the box's rounded corners, following it as it slides in or out. Where no box is on screen the take is hidden but its audio keeps playing, and the take's audio becomes the video's audio. --offset S is the time in the render where the take starts (use the first camera beat's start); a negative offset skips that many seconds into the take instead. The take covers everything inside the box, including its label and any lower third. A box faded below half opacity counts as hidden, so the take cuts rather than fades at a crossfade. compose fills one box: in market, whose three windows all use .cam, give the one to fill its own class and pass that with --box.

6. Deliver​

  • Hand over the MP4 plus index.html, beats.json and the scripts so the video can be edited and re-rendered.
  • Publish kit: python3 render.py kit index.html publish/ writes thumb.jpg (1280x720), PUBLISH.md (title options, a description and YouTube chapters taken from the beat starts, first at 00:00) and a short loop.gif + loop.webm for a README. Mark the thumbnail beat with "thumb": true; thumb, publish and loop make one piece each (see publish.py). Beats under 10 s fold into the chapter before them (--min-chapter 0 keeps every beat). Review the titles and description before posting; they're drafts.
  • Say what's real (taken from the repo) and what's a placeholder.
  • The video is silent. The talking-head take supplies the audio once render.py compose puts it in (step 5), or add narration with the video-voice skill (retime first, then render, then mux). For a layered, editable timeline with the camera in its own track, use video-pro.