npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@helios-project/renderer

v1.78.1

Published

Renderer for Helios video engine.

Downloads

648

Readme

@helios-project/renderer

The high-performance Node.js rendering engine for Helios. This package orchestrates the rendering process, capturing frames from a browser environment (via Playwright) and piping them directly into FFmpeg to generate video output.

Key Features

  • Dual-Path Architecture:
    • Canvas Mode: Optimizes for WebGL/Canvas 2D. Uses WebCodecs (H.264/VP9/AV1) for high-performance intermediate capture, falling back to standard canvas capture if needed.
    • DOM Mode: Optimizes for HTML/CSS animations. Uses Playwright's screenshot capabilities to capture pixel-perfect renderings of the DOM.
  • Zero Disk I/O: Frames are piped directly from the browser to the Node.js process and then to FFmpeg's stdin, completely bypassing the disk for maximum speed.
  • Smart Codec Selection: automatically detects the best intermediate format (e.g., passing through H.264 streams directly or using raw video for screenshot mode).
  • Audio Mixing: Supports multiple audio tracks with precise offset, volume control, and seeking.
  • Diagnostics: Built-in tools to verify the rendering environment (FFmpeg version, browser capabilities).

Installation

npm install @helios-project/renderer

Usage

import { Renderer } from '@helios-project/renderer';

async function main() {
  // Initialize the renderer with options
  const renderer = new Renderer({
    width: 1920,
    height: 1080,
    fps: 30,
    durationInSeconds: 10,
    mode: 'canvas', // or 'dom'
    videoCodec: 'libx264',
    // ... other options
  });

  // Render a composition
  await renderer.render(
    'http://localhost:3000/my-composition', // URL to the composition
    './output.mp4'                          // Output file path
  );
}

main();

Configuration

The Renderer constructor accepts a RendererOptions object:

| Option | Type | Default | Description | |Args|---|---|---| | width | number | Required | Output width in pixels. | | height | number | Required | Output height in pixels. | | fps | number | Required | Frames per second. | | durationInSeconds | number | Required | Total duration of the render. | | mode | 'canvas' \| 'dom' | 'canvas' | Rendering strategy. Use 'canvas' for WebGL, 'dom' for HTML/CSS. | | videoCodec | string | 'libx264' | Output video codec (e.g., 'libx264', 'libvpx-vp9', 'copy'). | | audioFilePath | string | undefined | Primary audio file path. | | audioTracks | AudioTrackConfig[] | [] | List of audio tracks with volume/offset/seek control. | | inputProps | Record<string, any> | {} | Props injected into the page as window.__HELIOS_PROPS__. |

See src/types.ts for the full list of advanced options including bitrates, CRF, presets, and intermediate formats.

Architecture

Render Strategies

The renderer uses the Strategy Pattern to handle different content types:

  • CanvasStrategy: Injects scripts to capture OffscreenCanvas or <canvas> elements. Prioritizes VideoEncoder (WebCodecs) for hardware-accelerated encoding within the browser before transmission.
  • DomStrategy: Uses Playwright's page.screenshot() to capture the entire viewport. Ideal for complex CSS animations that cannot be captured via canvas.

Time Drivers

To ensure deterministic rendering, time is controlled via Time Drivers:

  • SeekTimeDriver: Manually seeks the document timeline and media elements to exact timestamps for each frame, ensuring perfect synchronization regardless of rendering speed.