mk:html-video
Renders a local HTML, CSS and JavaScript animation to an H.264 MP4 by capturing frames with Playwright and encoding them with ffmpeg.
| Source | .claude/skills/html-video/SKILL.md |
| Owner | utility |
| Runtime | claude-code |
| Risk | low |
What it does
mk:html-video captures fps × duration PNG frames from a local HTML file, encodes them to an MP4 with yuv420p compatibility, removes its temporary frame directory on success or failure and prints the output path. It suits authored web animation, canvas, WebGL and GSAP output. It is not enabled by default (default_enabled: false) and needs Playwright and ffmpeg.
When to use it
Use it to export a local HTML animation as MP4 or to produce a video from a deterministic web template. It is not for live browser recording, screen capture or AI video generation.
Usage
bash ${CLAUDE_SKILL_DIR}/scripts/render-html-to-mp4.sh template.html output.mp4 30 5 1920 1080| Argument | Meaning |
|---|---|
<html-file> | The template to render |
<output.mp4> | Output path |
[fps], [duration-seconds] | Frame rate and length |
[width], [height] | Viewport size. Use even values. |
[background-color] | Optional |
To capture frames only, run node ${CLAUDE_SKILL_DIR}/scripts/capture-frames.mjs <html-file> <frame-dir> <fps> <duration-seconds> <width> <height> [background-color].
Steps
- Check that ffmpeg and Playwright are installed. Install Chromium only if it is missing and you approve.
- Pick an even width and height.
- Expose a
window.onFramehook in the template for fast deterministic stepping. Without it, capture runs in real time. - Render, then check the MP4 with the
ffprobecommand inreferences/render-workflow.md.
References
| File | Load for |
|---|---|
references/render-workflow.md | Dependency checks, dimensions, fps |
references/html-template-contract.md | Deterministic JavaScript, canvas, WebGL, GSAP stepping |
references/troubleshooting.md | Module, file://, codec, cleanup and dimension failures |
Gotchas
This is a skill, not an npm package. Run its bundled scripts directly.