Renderer class is the primary interface for rendering browser-based animations to video files. It orchestrates the entire rendering pipeline including browser automation, frame capture, and FFmpeg encoding.
Constructor
RendererOptions
required
Configuration object for the renderer. See render options for all available fields.
Basic usage
Methods
render
string
required
URL of the HTML page containing the animation composition. Can be a local file path (file://) or HTTP URL.
string
required
File path where the rendered video will be saved. The file extension determines the container format (e.g., .mp4, .webm, .mov).
RenderJobOptions
Optional job-specific configuration including progress callbacks, abort signals, and tracing. See render options for details.
Example
diagnose
browser: Browser diagnostics including GPU info, WebCodecs support, and rendering mode capabilitiesffmpeg: FFmpeg diagnostics including version, available hardware acceleration methods, and encoders
Example
Rendering modes
The Renderer supports two capture strategies:Canvas mode
Best for: Canvas-based animations, WebGL content, game enginesDOM mode
Best for: CSS animations, DOM-based content, text animationsFFmpeg integration
The Renderer automatically manages FFmpeg for video encoding:Default configuration
Custom FFmpeg settings
Hardware acceleration
The renderer validates that the specified
hwAccel method is available in your FFmpeg build. Check diagnostics output for available acceleration methods.Audio integration
Single audio file
Multiple audio tracks
Subtitles
Input props
Pass data to your composition at runtime:Deterministic rendering
Ensure reproducible renders across different machines:- Overrides
Math.random()with a seeded PRNG - Controls time progression deterministically
- Prevents race conditions in async operations
Browser configuration
Error handling
- Page JavaScript errors
- Browser crashes
- FFmpeg encoding failures
- Abort signal cancellations