# @hyperframes/producer Full HTML-to-video rendering pipeline: capture frames with Chrome's BeginFrame API, encode with FFmpeg, mix audio — all in one call. ## Install ```bash npm install @hyperframes/producer ``` **Requirements:** Node.js >= 22, Chrome/Chromium (auto-downloaded), FFmpeg ## Usage ### Render a video ```typescript import { createRenderJob, executeRenderJob } from "@hyperframes/producer"; const job = createRenderJob({ inputPath: "./my-composition.html", outputPath: "./output.mp4", width: 1920, height: 1080, fps: 30, }); const result = await executeRenderJob(job, (progress) => { console.log(`${Math.round(progress.percent * 100)}%`); }); console.log(result.outputPath); // ./output.mp4 ``` ### Run as an HTTP server The producer can also run as a render server, accepting render requests over HTTP: ```typescript import { startServer } from "@hyperframes/producer"; await startServer({ port: 8080 }); // POST /render with a RenderConfig body ``` ### Configuration `RenderConfig` controls the render pipeline: | Option | Default | Description | | ------------------ | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- | | `inputPath` | — | Path to the HTML composition | | `outputPath` | — | Output video file path (or directory, for `format: "png-sequence"`) | | `width` | 1920 | Frame width in pixels | | `height` | 1080 | Frame height in pixels | | `fps` | 30 | Frames per second (24, 30, or 60) | | `quality` | `"standard"` | Encoder preset (`"draft"`, `"standard"`, `"high"`) | | `format` | `"mp4"` | Output container — `"mp4"`, `"webm"`, `"mov"`, or `"png-sequence"`. See [Transparent Video Output](#transparent-video-output) below. | | `videoFrameFormat` | `"auto"` | Source video frame extraction format — `"auto"`, `"jpg"`, or `"png"`. Use `"png"` for UI recordings, screen captures, and color-sensitive source videos. | ## Transparent Video Output The producer can render HTML compositions to formats that carry a **true alpha channel** — not chroma key. The same composition that renders an opaque MP4 renders a layerable overlay when you set `format`. | `format` | Codec / pixel format | Alpha | Audio | Use case | | ----------------- | --------------------------------- | ----------------------- | ------------------- | --------------------------------------------------------------------------------------- | | `"mp4"` (default) | H.264 (yuv420p) or H.265 + HDR10 | No | AAC | Streaming, social, default deliverable | | `"webm"` | VP9 + yuva420p | **True alpha** | Opus | Web playback as overlay (`