Aller au contenu
Skillpedia
Montage vidéo14k · #11328

html-to-video-pipeline

Ce qu’il fait

Cette compétence montre comment enregistrer une page web animée dans un fichier vidéo. Elle s'adresse aux personnes qui créent des animations graphiques ou des vidéos explicatives en HTML et veulent un résultat correct.

Quand l’utiliser

  • ✓Quand vous voulez transformer une page web animée en vidéo MP4.
  • ✓Quand votre vidéo exportée a un mauvais timing, un texte flou ou un long début vide.
  • ✓Quand vous construisez un pipeline qui enregistre des animations HTML avec un navigateur sans interface.

Lien du skill

https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/cli/src/skill/builtin/.bundle/html-to-video-pipeline/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/cli/src/skill/builtin/.bundle/html-to-video-pipeline/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Je veux transformer ma carte de titre animée en HTML en vidéo MP4 de 10 secondes avec un timing propre.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

L'agent enregistre la page dans un navigateur sans interface, coupe le début, puis encode le résultat avec ffmpeg. Il vérifie la durée et la qualité de la sortie avant utilisation.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis 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):

  1. viewport must exactly equal recordVideo.size — mismatch silently rescales the output soft/blurry.
  2. Freeze CSS animations via addInitScript before goto().
  3. goto with domcontentloaded, never load.
  4. Pre-inline data-composition-src sub-scenes — file:// blocks client-side fetch.
  5. Font wait = stylesheet <link> load → face.load() per face → fonts.ready → 2 rAFs.
  6. Probe duration with infinite-iteration / repeat: -1 guards.
  7. Unfreeze = t=0; trim leadInMs − 120ms with -ss before -i.
  8. Concat: same engine → demuxer -c copy; mixed engines → concat filter + re-encode.
  9. 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

Questions fréquentes

Quels outils utilise-t-elle ?

Elle utilise un navigateur sans interface comme Playwright ou Puppeteer pour l'enregistrement, et ffmpeg pour l'encodage.

Pourquoi la vidéo sort-elle parfois mal ?

La compétence énumère les causes courantes, comme des tailles de fenêtre différentes, un chargement tardif des polices ou des animations qui démarrent avant la capture.

Vérifie-t-elle le fichier final ?

Oui. La compétence inclut des étapes de vérification pour contrôler la sortie.

Détails

Description originale de l’auteur

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

Popularité

Étoiles GitHub
14k
Position au classement
#11328
Licence
MIT
Mis à jour
02/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires