html-to-video-pipeline
Fungsinya
Skill ini menunjukkan cara merekam halaman web yang beranimasi menjadi file video. Skill ini ditujukan untuk orang yang membuat motion graphics atau video penjelasan dengan HTML dan menginginkan keluaran yang benar.
Kapan dipakai
- โSaat Anda ingin halaman web beranimasi diubah menjadi video MP4.
- โSaat video hasil ekspor memiliki waktu yang salah, teks buram, atau awal yang kosong dan panjang.
- โSaat Anda membangun alur kerja yang merekam animasi HTML dengan peramban tanpa antarmuka.
Link skill
https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/cli/src/skill/builtin/.bundle/html-to-video-pipeline/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
โSaya ingin mengubah kartu judul HTML yang beranimasi menjadi video MP4 berdurasi 10 detik dengan pengaturan waktu yang bersih.โ
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent merekam halaman di peramban tanpa antarmuka, memangkas bagian awal, dan mengodekan hasilnya dengan ffmpeg. Agent memeriksa durasi dan kualitas keluaran sebelum Anda memakainya.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum
Alat apa yang dipakai?
Skill ini memakai peramban tanpa antarmuka seperti Playwright atau Puppeteer untuk merekam, dan ffmpeg untuk pengodean.
Mengapa video kadang keluar salah?
Skill ini mendaftar penyebab umum, seperti ukuran viewport yang tidak cocok, font yang terlambat dimuat, dan animasi yang mulai sebelum perekaman.
Apakah skill ini memverifikasi file akhir?
Ya. Skill ini mencakup langkah verifikasi untuk memeriksa keluaran.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 14k
- Peringkat
- #11328
- Lisensi
- MIT
- Diperbarui
- 2/11/2026
Komentar
- โฆ
Skill lain dari repositori ini
effect
14kMembantu agent Anda menjawab pertanyaan tentang kerangka kerja TypeScript Effect dengan memeriksa kode sumber dan dokumentasinya, bukan mengandalkan ingatan.
arxiv
14kMembantu agent Anda mencari, membaca, mengutip, dan melacak makalah akademik di arXiv, mencakup abstrak, sitasi BibTeX, unduhan PDF, dan tautan sitasi.
claude-code
14kMembantu agent Anda menyerahkan tugas pemrograman ke alat baris perintah Claude Code, sebagai satu kali jalan, sesi interaktif, atau pekerjaan latar belakang.
codex
14kMembantu agent Anda menjalankan alat baris perintah OpenAI Codex tanpa jendela obrolan, untuk tugas pemrograman, skrip, dan alur kerja otomatis.
Skill serupa
taste-application
280kMembantu agent Anda membuat video dengan gaya tertentu, meniru ritme editing dari video referensi, membuat adegan baru, dan menyesuaikan warna.
taste-distillation
280kMembantu agent Anda menganalisis video untuk membuat style pack berisi warna, ritme pemotongan, dan elemen visual yang bisa dipakai ulang.
ui-demo
280kMembuat agent Anda merekam video demo UI yang rapi. Berguna untuk membuat tutorial atau menunjukkan cara kerja aplikasi web.