RendererOptions
Primary configuration interface for theRenderer class.
Composition settings
Video width in pixels.
Video height in pixels.
Frames per second for the output video.
Total duration of the composition in seconds.
Frame number to start rendering from. Useful for distributed rendering where different workers render different frame ranges.
Exact number of frames to render. If provided, overrides
durationInSeconds for calculating the render loop. Useful for distributed rendering to avoid floating-point errors.Custom properties to inject into the composition. Accessible as
window.__HELIOS_PROPS__ in your HTML.Rendering mode
Rendering strategy:
canvas: Captures frames from a canvas element using WebCodecs or image export. Best for canvas-based animations and WebGL.dom: Captures frames via viewport screenshots. Best for CSS and DOM animations.
CSS selector for the canvas element in
canvas mode. Uses document.querySelector() to find the target canvas.CSS selector for the target element in
dom mode. If provided, screenshots are limited to this element’s bounding box. Supports Shadow DOM traversal.Intermediate capture
Codec for intermediate video capture in
canvas mode (when using WebCodecs):vp8: Widely supported, good performancevp9: Better compression, higher qualityav1: Best compression, requires modern hardware- Custom codec strings (e.g.,
av01.0.05M.08)
Image format for intermediate capture in
dom mode, or as a fallback in canvas mode when WebCodecs is unavailable.JPEG quality (0-100) when
intermediateImageFormat is jpeg. Higher values mean better quality.Number of frames between keyframes (GOP size) when using WebCodecs in
canvas mode. For example, at 30fps, a value of 60 means a keyframe every 2 seconds.WebCodecs acceleration preference in
canvas mode:hardware: Prioritize hardware-accelerated codecssoftware: Prioritize software codecs (for deterministic testing)disabled: Disable WebCodecs entirely, fall back to image capture
Video encoding
FFmpeg video codec for final output. Common values:
libx264: H.264 (widely compatible)libx265: H.265/HEVC (better compression)libvpx: VP8 for WebMlibvpx-vp9: VP9 for WebMcopy: Copy video stream without re-encoding (requires matching input codec)- Hardware encoders:
h264_nvenc,h264_qsv,h264_videotoolbox
FFmpeg pixel format. Common values:
yuv420p: 8-bit 4:2:0 (standard, widely compatible)yuv420p10le: 10-bit 4:2:0yuv444p: 4:4:4 (higher quality, larger file size)
Constant Rate Factor for quality control. Lower values mean better quality (larger files). Range varies by codec:
- libx264/libx265: 0-51 (recommended: 18-28)
- libvpx/libvpx-vp9: 4-63 (recommended: 10-31)
Encoding preset balancing speed and compression. Slower presets produce smaller files:
ultrafast,superfast,veryfast,faster,fastmedium,slow,slower,veryslow
Target video bitrate (e.g.,
5M, 1000k). If provided, may override CRF for some codecs.Hardware acceleration method for FFmpeg. Common values:
cuda: NVIDIA GPU accelerationvaapi: Video Acceleration API (Linux)qsv: Intel Quick Sync Videovideotoolbox: macOS hardware accelerationauto: Let FFmpeg choose
Audio
Path to a single audio file to include in the output video.
Array of audio tracks to mix into the output. Each item can be:
- A string file path
- An
AudioTrackConfigobject with volume, offset, fades, etc.
Audio codec for final output:
aac: AAC audio (widely compatible)libmp3lame: MP3libvorbis: Vorbis (for WebM)libopus: Opus (modern, efficient)pcm_s16le: Uncompressed PCMcopy: Copy audio stream without re-encoding
Audio bitrate (e.g.,
128k, 192k, 320k). Higher values mean better quality.Whether to mix audio from the input video (stream 0:a) into the output. Useful for multi-pass rendering or when preserving existing audio tracks.
Subtitles
Path to an SRT subtitle file to burn into the video. Requires video transcoding (
videoCodec cannot be copy).Browser
Configuration for the Playwright browser instance. See BrowserConfig for details.
Maximum time in milliseconds to wait for the page to stabilize after setting each frame time. Useful for waiting on font loading, image decoding, or custom async operations.
FFmpeg
Path to a custom FFmpeg binary. Defaults to the binary provided by
@ffmpeg-installer/ffmpeg.Determinism
Seed for the deterministic random number generator. The renderer overrides
Math.random() in the composition with a seeded PRNG to ensure reproducible renders.RenderJobOptions
Options for individual render jobs, including progress tracking and cancellation.Callback invoked periodically during rendering with a progress value between 0 and 1.
AbortSignal to cancel the rendering process. Use
AbortController to create and trigger signals:Path to save a Playwright trace file (ZIP format). Useful for debugging rendering issues. The trace includes screenshots, snapshots, and network activity.
AudioTrackConfig
Detailed configuration for individual audio tracks.Path to the audio file.
Optional audio data buffer. If provided, this buffer is piped to FFmpeg instead of reading from disk.
Volume multiplier between 0.0 (silent) and 1.0 (full volume). Values greater than 1.0 amplify the audio.
Time in seconds when this track should start in the composition timeline.
Time in seconds to seek into the source audio file before playing. Useful for trimming the beginning of a track.
Duration in seconds for the audio to fade in from silence.
Duration in seconds for the audio to fade out to silence.
Whether to loop the audio track indefinitely. The track will repeat until the end of the composition.
Playback speed multiplier:
0.5: Half speed (slower)1.0: Normal speed2.0: Double speed (faster)
Duration of the source audio in seconds, if known. Allows smart calculation of fade-out relative to the clip end rather than the composition end.
Audio track example
BrowserConfig
Configuration for the Playwright browser instance.Whether to run the browser in headless mode. Set to
false to see the browser window during rendering (useful for debugging).Path to a custom browser executable instead of the bundled Chromium:
/usr/bin/google-chrome/Applications/Google Chrome.app/Contents/MacOS/Google ChromeC:\Program Files\Google\Chrome\Application\chrome.exe
Additional command-line arguments to pass to the browser. These are merged with the default arguments:Example custom args:
DistributedRenderOptions
ExtendsRendererOptions with distributed rendering settings.
Number of parallel render workers. Determines how many chunks the composition is split into.When set to
1, the orchestrator skips chunking and uses a standard Renderer directly.Custom executor for running render chunks. Defaults to
LocalExecutor which runs chunks as parallel processes on the local machine.Implement the RenderExecutor interface to run chunks on cloud infrastructure or distributed systems.RenderExecutor interface
render method that accepts the same parameters as Renderer.render().