TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/BintzGavin/helios/llms.txt
Use this file to discover all available pages before exploring further.
RenderOrchestrator class enables distributed rendering by splitting a composition into multiple chunks that can be rendered in parallel. This dramatically reduces rendering time for long videos on multi-core systems.
How it works
- Plan: Divides the composition into frame ranges based on concurrency
- Render: Executes chunks in parallel using worker renderers
- Concatenate: Stitches chunk videos into a single file
- Mix: Applies final audio mixing and encoding
Static methods
plan
URL of the HTML composition to render.
Final output file path for the rendered video.
Configuration object extending RendererOptions with distributed rendering settings.
Returns
ARenderPlan object containing:
Total number of frames in the composition.
Array of chunk specifications, each containing:
id: Chunk identifierstartFrame: First frame in this chunkframeCount: Number of frames to renderoutputFile: Temporary file path for chunk outputoptions: RendererOptions for this specific chunk
List of chunk file paths to concatenate.
Temporary file path for the concatenated video (before final audio mix).
Final output path (same as the outputPath parameter).
Options for the final audio mixing pass.
List of temporary files to delete after successful rendering.
Example
render
URL of the HTML composition to render.
Final output file path for the rendered video.
Configuration object extending RendererOptions with distributed rendering settings.
Optional job configuration including progress callbacks and abort signals.
Example
Distributed render options
Number of parallel render workers. Defaults to
os.cpus().length - 1.Custom executor for running render chunks. Defaults to
LocalExecutor which runs chunks as parallel processes on the local machine. Implement custom executors for cloud-based or distributed execution.Concurrency behavior
Automatic concurrency
Single worker fallback
Whenconcurrency: 1, the orchestrator skips chunking and uses a standard Renderer directly:
Custom concurrency
Audio handling in distributed mode
The orchestrator uses a multi-stage audio pipeline:Chunk rendering
- Each chunk renders with PCM audio (
pcm_s16lecodec) - Audio tracks are not mixed during chunk rendering
- Chunks output to
.movcontainer format to preserve PCM audio
Concatenation
- Chunk videos are concatenated without re-encoding
- PCM audio streams are preserved in the concatenated file
Final mix
- Concatenated video is processed with final audio options
- Audio tracks from
audioFilePathandaudioTracksare mixed - Output is encoded with specified
audioCodec(default:aac) - Final video uses the container format from
outputPathextension
Example with audio
Progress tracking
The orchestrator aggregates progress from all workers:Error handling and cancellation
Abort signal
Worker failure propagation
If any worker fails, all other workers are immediately aborted:Temporary file cleanup
The orchestrator automatically cleans up temporary files:- Chunk video files (e.g.,
temp_123_part_0.mov) - Concatenated intermediate file (e.g.,
temp_concat_123.mov)
finally block, ensuring files are removed even if rendering fails.
Custom executors
Implement theRenderExecutor interface to run chunks on cloud infrastructure:
Performance considerations
Optimal concurrency
- CPU-bound: Set concurrency to CPU core count minus 1
- Memory-bound: Reduce concurrency if renders are memory-intensive
- Cloud: Scale concurrency based on available cloud workers
Chunk size
Chunk size is automatically calculated astotalFrames / concurrency. For very short videos, some workers may receive no frames:
When to use distributed rendering
Use distributed rendering when:- Videos are longer than 30 seconds
- You have multiple CPU cores available
- Rendering time is critical
- Videos are very short (< 10 seconds)
- Single-core environment
- Simplicity is preferred over speed