When to Use
Use@hyperframes/producer when you need to:
- Render compositions to MP4 programmatically from Node.js (e.g., in a backend service or CI pipeline)
- Build a custom rendering service with fine-grained control over the pipeline
- Run visual regression tests against golden baselines
- Benchmark render performance across different configurations
- Render from the command line without writing code — use the CLI (
npx hyperframes render) - Preview compositions in the browser — use the CLI or studio
- Capture frames without encoding — use the engine
- Lint or parse composition HTML — use core
What It Does
The producer orchestrates the full render pipeline:Inject the Hyperframes runtime
Adds the runtime script that manages timeline seeking, clip lifecycle, and media playback.
Wait for readiness gates
Polls for
window.__playerReady and window.__renderReady to ensure all assets (fonts, images, video) are loaded before capture begins.Capture frames via the engine
Uses the engine’s BeginFrame pipeline to capture each frame as a pixel buffer.
Encode to MP4 via FFmpeg
Pipes frame buffers into FFmpeg with the selected quality preset and encoding settings.
Programmatic Usage
With All Options
Docker Rendering
For deterministic output, the producer can render inside a Docker container with a pinned Chrome version and font set. This guarantees identical output across machines — critical for CI pipelines and production services.Docker mode requires Docker to be installed and running. Run
npx hyperframes doctor to verify your environment. See Deterministic Rendering for details on what makes Docker mode deterministic.Quality Presets
| Preset | Resolution | Encoding | Use Case |
|---|---|---|---|
draft | Original | Fast CRF | Quick iteration, previewing edits |
standard | Original | Balanced CRF | Production renders, sharing |
high | Original | High-quality CRF | Final delivery, archival |
GPU Encoding
The producer supports hardware-accelerated encoding for faster renders:| Platform | Encoder | Flag |
|---|---|---|
| NVIDIA | NVENC | Auto-detected |
| macOS | VideoToolbox | Auto-detected |
| Linux | VAAPI | Auto-detected |
Regression Testing
The producer includes a regression harness for comparing render output against golden baselines. This is useful for catching visual regressions when changing the runtime, engine, or rendering pipeline.Benchmarking
Find optimal render settings for your hardware:Related Packages
CLI
Command-line interface that wraps the producer for rendering, previewing, and more.
Engine
The low-level capture pipeline that the producer uses to grab frames.
Core
Types, runtime, and linter that the producer depends on.
Studio
Visual editor for building compositions before rendering with the producer.