mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-03 04:38:33 +00:00
**Group lane labels drifted off the curves they name.** The labels iterated raw `elementAutomationLanes` while the curves and the reserved height both use `groupAutomationLanes` — deduped by property and filtered for resolvability — and the old `if (!parts) return null` consumed an index without drawing a row. So one unresolvable target slid every later label one row off its own curve. Both sides read the same source now, and the label takes its name and parameter from the group entry rather than re-deriving them (the second of the two duplicate `automationLaneLabelParts` calls the review counted). **`useEffectiveTimelineDuration` restated `getEffectiveTimelineDuration`** with weaker guards: no non-finite check on the stored duration or the result, so an element carrying NaN timing returned NaN and every downstream width became NaN with it. It delegates now. **`createStableContext` warns on a genuine name collision.** Two modules asking for one name silently share ONE context, so a provider's value is read by the other's consumers and the symptom appears far from either file. Told apart from an HMR re-evaluation by the default value: a re-evaluated module registers the same default, a collision does not. **Documented that `groupNormalizeOptionUnsupported` is live, not dead regex.** A review pass claimed the `amix` normalize fallback could never match; ffmpeg 8.1.1 emits `Error applying option 'X' to filter 'amix': Option not found`, which the second test matches. Verified against the binary, and the comment now says so with the one wording that would miss (pre-4.4 libavfilter, which predates `normalize` existing). **Left alone deliberately:** the leftover wrapper `<div>` in `PlayerControls`. It is genuinely redundant — `PreviewPane` supplies its own flex wrapper — but removing it is a pure-cosmetic JSX re-indent of a 300-line component with no test that would catch a mistake, which is a bad trade against the rest of this batch. Noted for whoever is next in that file. studio 1356 player tests, engine grouping 11. fallow clean.
@hyperframes/engine
Seekable web-page-to-video rendering engine built on Puppeteer and FFmpeg.
Framework-agnostic: works with GSAP, Lottie, Three.js, CSS animations, or any web content that implements the window.__hf seek protocol.
Install
npm install @hyperframes/engine
Requirements: Node.js >= 22, Chrome/Chromium (auto-downloaded by Puppeteer), FFmpeg
What it does
The engine opens your HTML composition in a headless Chrome instance, seeks frame-by-frame using Chrome's HeadlessExperimental.beginFrame API, captures screenshots, and encodes them into video with FFmpeg.
Key services
| Service | Description |
|---|---|
| browserManager | Launches and pools headless Chrome instances (chrome-headless-shell) |
| frameCapture | Manages capture sessions — seek, screenshot, buffer lifecycle |
| screenshotService | BeginFrame-based capture with CDP (Chrome DevTools Protocol) |
| chunkEncoder | FFmpeg encoding with chunked concat, GPU detection, faststart |
| streamingEncoder | Pipe frames to FFmpeg in real time (no intermediate PNGs on disk) |
| audioMixer | Parse <audio> elements and mix audio tracks via FFmpeg |
| videoFrameExtractor | Extract frames from <video> elements for compositing |
| parallelCoordinator | Split frame ranges across worker processes |
| fileServer | Serve local HTML files to the browser via Hono |
Usage
import {
acquireBrowser,
createCaptureSession,
initializeSession,
captureFrame,
closeCaptureSession,
} from "@hyperframes/engine";
// 1. Launch browser
const browserLease = await acquireBrowser({ captureMode: "beginFrame" });
// 2. Open a capture session
const session = createCaptureSession({
browser: browserLease.browser,
url: "http://localhost:3000/my-composition.html",
width: 1920,
height: 1080,
fps: 30,
});
await initializeSession(session);
// 3. Capture frames
for (let i = 0; i < totalFrames; i++) {
await captureFrame(session, i, `/tmp/frames/frame-${i}.png`);
}
// 4. Clean up
await closeCaptureSession(session);
await browserLease.release();
Most users should use @hyperframes/producer or the hyperframes CLI instead of calling the engine directly.
Documentation
Full documentation: hyperframes.heygen.com/packages/engine
Related packages
@hyperframes/core— types, parsers, frame adapters@hyperframes/producer— high-level render pipeline built on this enginehyperframes— CLI