whiteboard-video
ASecurityProduce a classic whiteboard explainer video written entirely in code: a photo-real hand writes text and draws icons, arrows and charts on a board, the camera scrolls between pages, and cartoon characters are outlined and then colored in with marker scribbles. Canvas 2D + WebAudio, rendered to MP4 with headless Chrome and ffmpeg, narration synced phrase-by-phrase to the drawing. Use when asked for a "whiteboard video", "whiteboard animation", "hand-drawn explainer", "a hand that draws", "draw...
- 4 stars
- 0 votes
- 0 copies
- 0 views
- Added November 29, 2026
Works with
Security analysis
92/100- Installs packages at runtime which could introduce malicious dependencies
- Installs packages at runtime which could introduce malicious dependencies
Pro scans all 9 files and shows the line behind each finding
npx -y skills add malachi-user/whiteboard-video --agent claude-codeAre you the author of whiteboard-video?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/malachi-user-whiteboard-video)---
name: whiteboard-video
description: Produce a classic whiteboard explainer video written entirely in code: a photo-real hand writes text and draws icons, arrows and charts on a board, the camera scrolls between pages, and cartoon characters are outlined and then colored in with marker scribbles. Canvas 2D + WebAudio, rendered to MP4 with headless Chrome and ffmpeg, narration synced phrase-by-phrase to the drawing. Use when asked for a "whiteboard video", "whiteboard animation", "hand-drawn explainer", "a hand that draws", "draw then color characters", or "explainer in sketch style". Works in English and natively in Hebrew/RTL.
---
# Whiteboard video
Everything lives in `studio/` (relative to this file). Rendering costs nothing: no video-generation API is used.
The only optional paid parts are the narration (any TTS) and the music bed. Always tell the user the expected
cost of those before calling a paid API, and wait for approval.
## 0. Setup (once)
```bash
cd studio && npm install # puppeteer-core
# needs: Node 22+, Google Chrome or Chromium (or CHROME=/path), ffmpeg on PATH
# asset packing: python3 -m pip install pillow numpy scipy
```
## 1. Start from a template
| Template | Use it for |
|---|---|
| `films/whiteboard-synced.html` | **Recommended start (v2 engine).** Hebrew, 4 pages, characters drawn then colored, multi-line labels, CTA held on screen. The hand never lags or leads the ink (section 3b) |
| `films/starter-en.html` | English board, no voice. 35 s, 3 pages, music synthesized in code |
| `films/whiteboard-demo.html` | Same story in Hebrew (RTL), no voice |
| `films/whiteboard-demo-vo.html` | Hebrew with narration mixed in post (`const VO`) |
| `films/whiteboard-color-chars.html` | Characters that are outlined and then colored in |
Copy a template to `films/<name>.html` and replace only the SECTION blocks (and `VO` if narrated).
The older templates use the v1 engine (outlines fade in, the hand can jump); prefer `whiteboard-synced.html` and port
its engine block if you start from another one.
The engine, the hand, the fonts and the mix already work.
## 2. Script and board content
- Three "pages" with a camera scroll between them: **problem, solution, bottom line**. One or two narration sentences per page.
- What is written on the board is shorter than the narration: titles and labels, not full sentences.
- Ads: the last page is the call to action, held on screen ~3 s. Write the exact action ("send a message") and the
contact on the board and in the post text; the narration says the action but does not read a phone number out.
- 1080x1920 vertical by default (`W`, `H`). Pages are ~1640 px apart in world space.
- Fonts (embedded, OFL): `Caveat` for English; `Gveret Levin` (titles) and `Playpen Sans Hebrew` (labels) for Hebrew.
The Hebrew subset of Playpen has no Latin letters and no maqaf: write Latin words in Gveret Levin or Caveat.
Gveret Levin does have Latin letters ("AI" looks good in it). URLs and phone numbers: `Rubik` weight 600-700 with `ltr: true`.
## 3. The timeline API (inside the film)
Actions run one after another; `cur` advances automatically.
- `text({str, x, y, size, family, color, dur, align, weight, dir})` - the text is written glyph by glyph under the hand.
Direction is automatic: right-to-left for Hebrew/Arabic, left-to-right otherwise (`dir: 'rtl' | 'ltr'` overrides).
- `path({paths, color, width, dur, fill, fillIdx, gap, amp, cap})` - strokes drawn with marker jitter.
Shapes: `P.rect`, `P.circle`, `P.line`, `P.arc`, `P.arrow`, `P.catmull`, `P.polyline`, `P.transform`.
`fill` + `fillIdx` fade a fill into closed shapes after they are drawn.
- `svg(d, cx, cy, scale)` - any 24x24 SVG path (Lucide style) becomes strokes the hand draws. The cheapest, most "whiteboard" way to add an icon.
- `char({slug, x, y, hgt, drawDur, colorDur, gap})` - a packed character (section 5): outline first, then color. `x, y` = top-center, `hgt` = height in px.
- `pan(y)` - scroll the camera to the next page; the hand leaves the frame during the scroll.
- `gap` = pause after an action, `dur` = drawing time.
- `text({..., ltr: true})` writes left to right (times, URLs, phone numbers). `\n` in `str` = multi-line label.
- `charLine({slug, x, y, hgt, drawDur})` + `charColor(line, {colorDur})` (v2) - outline and color as two acts, so other
acts (speech bubbles, icons) can sit between the outline and the coloring.
- `score(A)` - sound: marker scratches follow every action, a whoosh on each pan, and an optional code-synthesized groove
(`A.groove('lofi', ...)`). No chime at the end: the film ends on the music fade.
## 3b. Hand/ink sync (v2 engine) - the viewer must believe the hand makes every mark
Lessons from a real ad, each one fixed in `whiteboard-synced.html`:
- **No global fade-in of a character's line layer.** Viewers spot lines appearing before the hand arrives. Line art the
pen paths miss (beard shading, small face marks) goes into a *residue* layer (line art minus the pen mask, width 24)
that is revealed by a wider brush (52) riding the same pen path. Color-edge slivers (`misc`) follow the coloring brush.
- **Pen travel costs time by distance** (`JK = .6` per px, plus `JUMP = 36` per lift), between character strokes, between
sub-paths of a `path()`, and between color regions. Otherwise the hand teleports across the figure.
- **Fills sweep with the pen** (a pie wedge from the shape centre to the traced outline), not a fade after the stroke.
- **Speed cap:** a full figure is ~36k px of line; in 2.5 s that is ~480 px per frame and the hand no longer looks
attached to the line. 3.3 s outline / 3.2 s coloring worked for a ~1000 px tall figure.
- **Multi-line text:** each line reveals inside its own vertical band (half the gap to the neighbour line), otherwise
revealing line 1 uncovers the top of line 2.
- **Page turns:** the next page starts drawing at ~85% of the pan, so the board is never empty.
Automatic check (renders the board without the hand via `?nohand=1` and flags new ink far from the pen point):
```bash
node dev/wb-sync.mjs films/<name>.html 140 # list of (frame, t, samples, maxDist, act)
node dev/wb-sync-frames.mjs films/<name>.html out/sync 112 179 # diff images: new ink red, pen green
node dev/wb-times.mjs films/<name>.html # page/act timing table for placing the VO
```
Some flags are normal (the wide residue brush, marker scratches during a pen glide; the template scores ~110 at 140 px).
Look at the acts with many samples or a large `maxDist`, and confirm with `wb-sync-frames.mjs`.
## 4. The hand
A hand drawn in code looks wrong. The hand is a real image keyed from a magenta backdrop and is ready to use:
`films/lib/wb-hand.js` (source: `assets/hand/source/hand-b.png`, alternate angle `hand-a.png`, transparent cutout
`assets/hand/hand-b-cut.png`). It is anchored on the marker tip (`WB_HAND_META.tip`) at `HAND_S = .74`; its shadow is
the same image with `brightness(0) blur`.
New hand (other sleeve, other skin tone, left hand...):
1. Generate with any image model using `references/prompt-hand.md`. The composition is mandatory: marker tip lower-left,
forearm exits on the right, flat magenta `#FF00FF` background, 3:2, no text, no pink on the hand.
2. Save it as `assets/hand/source/<name>.png` and run `python3 assets/hand/pack_hand.py <name>`. It writes
`films/lib/wb-hand.js` and finds the marker tip.
3. Check `assets/hand/<name>-cut.png` by eye. The mask erosion (MinFilter 5 + blur 1) is what removes the pink halo.
## 5. Characters that are outlined, then colored
The classic whiteboard look: the hand traces the outline, then scribbles the color in, marker after marker.
Copy the engine (`char`, `prepChar`, `charPen`, `drawChar`) from `films/whiteboard-color-chars.html`.
1. **Generate the character** with any image model using `references/prompt-characters.md`. Non-negotiable:
uniform thick black outlines with every color area fully enclosed; flat fills only (no gradients/shading/texture);
flat magenta background without floor shadow; no pink/purple in the character; no text; full body with ~10% margin, 2:3.
For several images of the same character (before/after), request them in one call with a shared style block and
repeat the clothes and colors explicitly.
2. **Pack it** (from `studio/`):
```bash
python3 assets/pack_color_char.py assets/chars/source/<name>.png <slug> --max 1100 --line 45 --k 18
```
Output: `films/lib/wb-char-<slug>.js` (`window.WB_CHARS[slug]`) with the line layer, pen paths for the outline
(top to bottom), k-means color regions with a scribble zigzag per region, and `misc` small details (eyes, dots)
that fade in at the end. Coloring goes marker by marker: the color that appears highest first.
Dark details (a beard): `--line 32 --k 18`; with `--line 45` the beard comes out speckled.
Check `assets/cut/<slug>-lines.png` and `<slug>-regions.png`: missing lines -> raise `--line`;
merged colors -> raise `--k`; too many tiny regions -> lower `--k`.
3. **In the film:** `<script src="lib/wb-char-<slug>.js">` in the head, `await prepChar(a)` in init, then `char({...})`.
Timing that worked for a full-height character (1360 px): `drawDur 4.6`, `colorDur 5.0`. Smaller characters get less.
## 6. Other elements
| Need | Way | Why |
|---|---|---|
| Simple icon (phone, check, arrow, bubble, chart) | SVG path or `P.*` shapes through `path()` | The hand draws it. Most whiteboard-like. Free |
| Character drawn then colored | Section 5 | Closest to classic whiteboard videos |
| Rich illustration, realistic object, sticker | Image on magenta, then `python3 assets/pack_codex_asset.py <src.png> <slug>` -> `films/lib/wb-asset-<slug>.js` | Real illustration quality |
| Emoji | `c.fillText('🚀', x, y)` with an installed color-emoji font | Fast. Check a frame: no tofu box |
Rule: on a whiteboard every element must look like the hand made it. Reveal images with an advancing clip under the
hand, or draw an outline with `path()` first and fade the image in. Nothing just pops in.
## 7. Visual QA before narration
```bash
node render.mjs films/<name>.html --grid 24 # contact sheet -> out/<name>-grid.jpg
node render.mjs films/<name>.html --only 0,90,300 # full-size frames
node render.mjs films/<name>.html --qa # frozen / blank / flash / loudness report
```
Look at the sheet: text direction, nothing outside the frame, the hand on the line, no pink fringes.
## 8. Narration (optional)
- One line per TTS call, saved as `audio/<name>/l1.wav`, `l2.wav`... Any TTS works; a calm, warm, slightly slow
explainer voice fits best. For Hebrew, always send **fully vowelized (niqqud) text** to the TTS, otherwise the
pronunciation is a guess; on-screen text stays without niqqud.
- Verify each clean line with a transcription before mixing (music can confuse transcription of the full mix).
## 9. Sync: every phrase lands on its drawing
1. Split each line into phrases on silences: `ffmpeg -i l3.wav -af silencedetect=n=-35dB:d=0.25 -f null -`, cut to `l3a.wav`, `l3b.wav`...
2. In `const VO = [...]` (must stay valid JSON, `mix-vo.mjs` parses it) set each phrase's `at` to the `t0` of the action
it describes minus 0.1-0.3 s. Keep `tempo: 1` unless you must compress.
3. If the voice is longer than the drawing, extend `dur`/`gap` in the film. Do not speed the voice up.
4. A long line over a list (three checks, three labels) is split into one piece per item and each piece lands on its
item's `t0`. Pieces cut from one line keep the parent line's loudness: give them all the same `"gainDb"` in `VO`
(otherwise each short piece is normalized on its own and the level jumps).
5. Cutting a line is better than rushing it: if the board has less to show than the line says, drop the line.
## 10. Render and mix
1. `node render.mjs films/<name>.html` -> `out/<name>.mp4` + `out/<name>.wav` (SFX/music from `score`). Typically 4-9 minutes.
2. External music (optional): quiet lo-fi/acoustic, no vocals. Mix it under the SFX with ffmpeg `amix` and a fade-out into `out/<name>.wav`.
3. `node mix-vo.mjs films/<name>.html audio/<name> [--duck-db -8] [--bed-gain 0.7]` - places each phrase
sample-accurately, ducks the bed under the voice, normalizes to -14 LUFS. Timing report: `out/<name>-vo-lines.json`.
If the music still competes with the voice, lower the whole bed (`--bed-gain 0.45`) rather than deepening the duck.
4. Check: about -14.5 LUFS, no jump or chime at the end, transcribe the final video once.
## 11. Cover image before publishing
The first frame of a whiteboard video is an empty white board, and platforms use it as the thumbnail when no cover is
sent. Make a dedicated cover (generate it with an image model in the board style: the title in handwriting, one icon,
the brand; check every letter, image models swap similar Hebrew letters such as מ/ס), save it as `cover.jpg` next to the
video and send it explicitly to every platform (YouTube thumbnail, Facebook/Instagram Reel cover, LinkedIn video
thumbnail). An Instagram Reel's cover cannot be changed through the API after publishing, so get it right before.
## Lessons
- A code-drawn hand looks uncanny; use a real keyed image.
- The pink halo disappears only with mask erosion.
- TTS without niqqud (Hebrew) mispronounces. Always vowelize.
- A closing chime sounds cheap. End on the music fade.
- An `adelay`/`amix` graph shifted every line ~0.4 s early; that is why `mix-vo.mjs` places voice in JS, sample-accurate.
- Character splitting only works if every area is closed by a black line and colors are flat. Say so in the prompt.
- Ink that appears before the hand reaches it is noticed at once. Reveal everything along the pen path (section 3b).
- A hand moving faster than ~480 px/frame no longer looks attached to the line. Cap the drawing speed.
- Pieces of one narration line share one gain, or the level jumps between them.
- Without an explicit cover the platform thumbnail is a blank white board.
Files in this skill
- README.en.md
- SKILL.md
- docs/index.html
- references/prompt-characters.md
- references/prompt-hand.md
- studio/mix-vo.mjs
- studio/package-lock.json
- studio/package.json
- studio/render.mjs
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.