@hyperframes/engine

中文文档
0.8.226发布于 2026/11/01TypeScriptES Module构建来源已验证

Seekable web page to video rendering engine (Puppeteer + FFmpeg)

原始使用文档
文档目录6 节
  1. Install
  2. What it does
  3. Key services
  4. Usage
  5. Documentation
  6. Related packages

@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

ServiceDescription
browserManagerLaunches and pools headless Chrome instances (chrome-headless-shell)
frameCaptureManages capture sessions — seek, screenshot, buffer lifecycle
screenshotServiceBeginFrame-based capture with CDP (Chrome DevTools Protocol)
chunkEncoderFFmpeg encoding with chunked concat, GPU detection, faststart
streamingEncoderPipe frames to FFmpeg in real time (no intermediate PNGs on disk)
audioMixerParse <audio> elements and mix audio tracks via FFmpeg
videoFrameExtractorExtract frames from <video> elements for compositing
parallelCoordinatorSplit frame ranges across worker processes
fileServerServe 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

版本与发布记录

@hyperframes/engine 共发布 581 个版本,首次发布于 2026/03/23;过去 12 个月发布了 581 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.8.226latest2026/11/012 天前
0.8.2252026/11/012 天前
0.8.2242026/11/012 天前
0.8.2232026/10/313 天前
0.8.2222026/10/313 天前
0.8.2212026/10/304 天前

其他发布通道:alpha → 0.7.67-alpha.0,desktop → 0.8.53-desktop.0,hdr → 0.8.190-hdr.1。

关于 @hyperframes/engine 的常见问题

@hyperframes/engine 是什么?

可搜索的网页视频渲染引擎(Puppeteer + FFmpeg)

如何安装 @hyperframes/engine?

在项目目录运行 npm install @hyperframes/engine,或使用 pnpm add / yarn add / bun add。

@hyperframes/engine 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@hyperframes/engine 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@hyperframes/engine 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@hyperframes/engine 可以商用吗?

@hyperframes/engine 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@hyperframes/engine 还在维护吗?

最新版本 0.8.226 发布于 2026/11/01(2 天前);至今共发布 581 个版本,其中过去 12 个月发布了 581 个;首次发布于 2026/03/23。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。