html-to-video-pipeline
하는 일
이 스킬은 애니메이션 웹 페이지를 영상 파일로 녹화하는 방법을 보여 줍니다. HTML로 모션 그래픽이나 설명 영상을 만들고 결과물이 제대로 나오기를 원하는 사람을 위한 스킬입니다.
사용하는 경우
- ✓애니메이션 웹 페이지를 MP4 영상으로 만들고 싶을 때.
- ✓내보낸 영상의 타이밍이 틀리거나 글자가 흐리거나 처음이 길게 비어 있을 때.
- ✓헤드리스 브라우저로 HTML 애니메이션을 녹화하는 파이프라인을 만드는 경우.
스킬 링크
https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/cli/src/skill/builtin/.bundle/html-to-video-pipeline/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“애니메이션 HTML 타이틀 카드를 깔끔한 타이밍의 10초짜리 MP4 영상으로 만들어 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 헤드리스 브라우저에서 페이지를 녹화하고, 앞부분을 잘라 낸 뒤 ffmpeg로 인코딩합니다. 사용하기 전에 결과물의 길이와 품질을 확인합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
HTML → Video: the pipeline that actually works
Turning a live HTML page into an MP4 sounds like a one-liner ("Playwright records, ffmpeg encodes") and the first draft always looks fine — until you play back the export and notice text flashing in a fallback font, three dead seconds at the start, or a "10-second" clip that clocks in at 35s. This skill captures the specific ordering, waits, and encoder flags that make the output trustworthy.
Think of the pipeline as five phases with a single invariant between them:
launch → hold @ frame 0 → align capture start with animation start → record → trim & encode
The invariant: no pixel of the animation should render before capture is ready, AND capture must not start before every asset that affects layout has loaded. Every gotcha below is a violation of that invariant.
Quick checklist (each item is expanded below):
viewportmust exactly equalrecordVideo.size— mismatch silently rescales the output soft/blurry.- Freeze CSS animations via
addInitScriptbeforegoto(). gotowithdomcontentloaded, neverload.- Pre-inline
data-composition-srcsub-scenes —file://blocks client-sidefetch. - Font wait = stylesheet
<link>load →face.load()per face →fonts.ready→ 2 rAFs. - Probe duration with infinite-iteration /
repeat: -1guards. - Unfreeze = t=0; trim
leadInMs − 120mswith-ssbefore-i. - Concat: same engine → demuxer
-c copy; mixed engines → concat filter + re-encode. - Verify with ffprobe duration + full decode + sampled frames. Always.
There are two capture modes, and picking the wrong one wastes a day:
- Mode A — real-time
recordVideo(the phases below). Simple, wall-clock = clip length. But the screencast is best-effort variable frame rate (~25fps) and competes with the animation for CPU. Good enough for previews and ≤30fps deliverables on an idle machine. - Mode B — deterministic frame stepping (pause everything, seek to
i / fps, screenshot, encode the PNG sequence). Exact fps, every frame rendered, no lead-in trim, immune to machine load. Required when the output must be genuinely smooth ≥30fps or renders run on loaded CI. See "Deterministic frame stepping" below.
Prerequisites — install these first
Two hard requirements: a headless browser driver (Playwright or Puppeteer) and ffmpeg. Everything below assumes both are installed and on PATH.
1. Headless browser driver
Playwright is the default in this skill (its recordVideo API is what the pipeline is written against). Puppeteer works too but you'll wire recording yourself via CDP screencast — pick Playwright unless you have a reason not to.
# Playwright (recommended) — npm / pnpm / bun all work
npm install playwright
pnpm add playwright
bun add playwright
# Then install the actual browser binaries (this is the step people forget):
npx playwright install chromium # just Chromium — enough for this pipeline
npx playwright install --with-deps chromium # Linux/CI: also install shared libs
Verify: npx playwright --version prints the driver version, and node -e "require('playwright').chromium.launch().then(b => b.close())" exits cleanly.
Puppeteer alternative (only if you already have it in the project):
npm install puppeteer # bundles a matching Chromium automatically
# or, to reuse a system Chrome:
npm install puppeteer-core # no bundled browser — you supply executablePath
2. ffmpeg
The encode/trim/concat/verify steps all shell out to ffmpeg (and ffprobe, which ships in the same package). It is not an npm dependency — install it at the OS level.
# macOS
brew install ffmpeg
# Debian / Ubuntu
sudo apt-get update && sudo apt-get install -y ffmpeg
# Fedora / RHEL
sudo dnf install ffmpeg # requires RPM Fusion enabled
# Windows
winget install Gyan.FFmpeg # or: choco install ffmpeg
Verify: ffmpeg -version and ffprobe -version both print. If a script spawns ffmpeg and gets ENOENT, the binary isn't on PATH — see the graceful-failure snippet in references/ffmpeg-cheatsheet.md.
Do not rely on the ffmpeg-static / @ffmpeg-installer/ffmpeg npm packages for production: their bundled builds skip codecs and encoder flags you'll hit sooner or later (e.g. libx264 presets, tpad). A system ffmpeg is the durable choice.
3. Optional — ImageMagick (verification only)
Only needed if you want th
자주 묻는 질문
어떤 도구를 쓰나요?
녹화에는 Playwright나 Puppeteer 같은 헤드리스 브라우저를, 인코딩에는 ffmpeg를 사용합니다.
영상이 왜 잘못 나오기도 하나요?
뷰포트 크기 불일치, 늦은 글꼴 로딩, 캡처 전에 시작되는 애니메이션 같은 흔한 원인을 나열합니다.
최종 파일도 검증하나요?
네. 스킬은 결과물을 확인하는 검증 단계를 포함합니다.
상세 정보
작성자의 원본 설명
Reliable HTML-to-MP4 rendering via headless browser recording (Playwright/Puppeteer) + ffmpeg — the ordering, gotchas, and verification steps you MUST get right or the output silently rots. Trigger whenever the user is building or debugging any pipeline that turns an HTML/CSS/JS page (single-file, multi-composition, GSAP-driven, or `@keyframes`-driven) into a video file, including headless recording, screen capture of a web page, deterministic frame-by-frame capture, multi-scene concatenation, or engine-mixed video output. Also trigger when the symptom sounds like: font swap flashing in the op
repo: XiaomiMiMo/MiMo-Code
인기도
- GitHub 스타
- 14k
- 순위
- #11328
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
effect
14k에이전트가 기억에 의존하지 않고 소스 코드와 문서를 확인해 Effect TypeScript 프레임워크에 관한 질문에 답하도록 돕습니다.
arxiv
14k에이전트가 arXiv의 학술 논문을 검색하고, 읽고, 인용하고, 추적하도록 돕습니다. 초록, BibTeX 인용, PDF 다운로드, 인용 관계를 포함합니다.
claude-code
14k에이전트가 코딩 작업을 Claude Code 명령줄 도구에 맡기도록 돕습니다. 한 번 실행하거나, 대화형 세션으로 하거나, 백그라운드 작업으로 돌릴 수 있습니다.
codex
14k채팅 창 없이 OpenAI Codex 명령줄 도구를 실행해 코딩 작업, 스크립트, 자동화 파이프라인을 처리하도록 에이전트를 돕습니다.
비슷한 스킬
taste-application
280k특정 스타일의 영상을 에이전트가 만들도록 돕습니다. 참고 영상의 편집 리듬을 살려 새 장면과 색을 더하고 영상을 편집합니다.
taste-distillation
280k영상을 분석해 스타일 팩을 만들도록 에이전트를 돕습니다. 색, 컷 리듬, 시각 요소를 포함하며 같은 느낌의 새 영상을 만드는 데 재사용할 수 있습니다.
ui-demo
280k에이전트가 완성도 높은 UI 데모 영상을 녹화하도록 돕습니다. 튜토리얼을 만들거나 웹 앱의 작동 방식을 보여 줄 때 유용합니다.