⚡ HyperFrames Rust (hyperframes)
High-performance native Rust programmatic video rendering engine with seekable HTML/CSS/JS clock protocol.
A native Rust port and engine inspired by HeyGen HyperFrames. HyperFrames turns any web page (HTML, CSS, SVG, Canvas, WebGL, GSAP, Three.js, Lottie) into frame-accurate, production-quality video without frame skips, clock drift, or wall-clock dependence.
🚀 Key Features
- Frame-Accurate Deterministic Virtual Time: Controls
performance.now(),Date.now(), andrequestAnimationFramevia thewindow.__hfseek protocol. - Native Chrome DevTools Protocol (CDP): Async headless browser automation via
chromiumoxidewith zero-overhead frame captures. - Piped FFmpeg Streaming Pipeline: Frame image buffers stream directly into FFmpeg stdin over asynchronous pipes—never writing millions of temporary image files to disk.
- Multi-Format & Multi-Codec: First-class support for MP4 (
libx264,libx265), MOV (prores_ks), WebM (libvpx-vp9), and animated GIFs. - DAW-Grade Audio Automation: Exponential, linear, logarithmic, and conic via-point envelope interpolation for volume, speed ramps, and FX automation.
- Zero-Config CLI & Pure Rust SDK: Use it as a turnkey command-line tool or embed it directly into your Rust video pipelines.
📦 Installation
From Cargo
In Your Cargo.toml
[]
= "0.1.0"
🛠️ Prerequisites
HyperFrames requires:
- Google Chrome or Chromium (auto-detected on macOS, Linux, and Windows, or configured via
CHROME_BIN). - FFmpeg installed and accessible on your
PATH.
💻 CLI Usage
1. Scaffold a New Project
2. Inspect Composition Metadata
3. Render into High-Definition MP4
# Render using composition's native duration and resolution
# Render with custom overrides
4. Render Apple ProRes 4444 (MOV)
📜 The window.__hf Seek Protocol
HyperFrames does not force a specific animation library or frontend framework. Any page that implements window.__hf can be rendered deterministically:
Hello World
Note: For pages without an authored window.__hf, HyperFrames automatically injects a deterministic virtual clock shim that intercepts performance.now() and requestAnimationFrame!
🦀 Programmatic Rust API
use ;
async
🧪 Testing & Verification
Run the test suite:
Run linter checks:
⚖️ License
Licensed under the Apache License, Version 2.0 (LICENSE).