Core philosophy: native-aligned architecture
Most programmatic video frameworks treat the browser as a “screenshot machine”—they freeze time, inject frame numbers, calculate every interpolated value in JavaScript, and capture the result. This simulation-based architecture works, but it means reimplementing what the browser already does natively. Helios takes a different approach: drive the browser’s animation engine, don’t replace it.The browser already knows how to animate
When you write CSS animations or use the Web Animations API, the browser’s C++ rendering engine handles:- Interpolation calculations
- Easing functions
- Hardware-accelerated compositing
- Subpixel rendering
- Performance optimizations
- Helios approach
- Simulation approach
Dual-mode time control
Helios uses different time control mechanisms depending on the context:Production rendering: CDP virtual time
For server-side rendering in headless Chrome, Helios uses the Chrome DevTools Protocol (CDP) to virtualize time at the environment level.- Deterministic: The browser cannot advance until the frame is fully rendered
- Scene-independent: Render time is proportional to scene complexity
- Native: All CSS animations, WAAPI timelines, and
requestAnimationFramecallbacks update automatically - Chromium-only: Requires CDP access (headless Chrome/Chromium)
packages/renderer/src/drivers/CdpTimeDriver.ts:20 for implementation details.
Preview mode: WAAPI seeking
For browser-based preview and development, Helios uses the Web Animations API to seek individual animations.- Interactive: Works in any modern browser
- Real-time: No headless browser required
- Standards-based: Uses the writable
Animation.currentTimeproperty - Scrub-friendly: Perfect for timeline scrubbing in the player
packages/core/src/drivers/DomDriver.ts:372 for implementation details.
The W3C spec marks
document.timeline.currentTime as read-only, but individual Animation objects expose a writable .currentTime property. Helios uses this to seek animations without violating the spec.Modular architecture
Helios is designed as a set of loosely-coupled packages:Core (@helios-project/core)
Headless logic engine with zero UI dependencies.
Responsibilities:
- Timeline state management (
currentFrame,duration,fps) - Playback controls (
play,pause,seek) - Signal-based reactivity
- Driver abstraction (TimeDriver, DomDriver, NoopDriver)
- Animation helpers (
interpolate,spring,sequence)
Helios.ts:79- Main engine classtypes.ts:11- Configuration and state typesdrivers/- Driver implementations
Renderer (@helios-project/renderer)
Server-side rendering pipeline using Playwright and FFmpeg.
Responsibilities:
- CDP-based time control
- Frame capture (screenshots or canvas)
- Video encoding pipeline
- Distributed rendering orchestration
Renderer.ts- Main rendering coordinatordrivers/CdpTimeDriver.ts:6- Virtual time driverstrategies/CanvasStrategy.ts- Canvas-to-video path
Player (@helios-project/player)
Web Component for browser-based preview.
Responsibilities:
- Sandboxed iframe rendering
- Transport controls UI
- Timeline scrubbing
- Client-side export (WebCodecs)
Studio (@helios-project/studio)
Visual composition editor (currently in beta).
Responsibilities:
- Visual timeline editing
- Asset management
- Real-time preview
- Export workflows
Framework-agnostic design
The core engine is a vanilla TypeScript class with zero framework dependencies. Framework adapters provide idiomatic APIs:- React
- Vue
- Vanilla JS
Signal-based reactivity
Helios uses a custom signal implementation for fine-grained reactivity:- Efficient updates: Only changed values trigger re-renders
- Computed values: Derived state updates automatically
- Framework adapters: Easy integration with React, Vue, etc.
packages/core/src/signals.ts for the full implementation.
Stability and determinism
Deterministic rendering requires waiting for all asynchronous operations to complete before capturing each frame.Stability checks
Helios waits for:- Fonts:
document.fonts.ready - Images:
img.decode()for all images - Media elements:
seekedevent after seeking video/audio - Custom checks: User-registered async operations
Custom stability checks
Register custom async operations that should block rendering:Helios.ts:876 for the stability check API.
Advantages of this architecture
Performance
- Hardware acceleration: Browser’s C++ compositor handles all interpolation
- Optimized rendering: Same engine that powers the web
- Zero JavaScript overhead: No per-frame calculation loops
Maintainability
- Declarative CSS: Animation logic lives in stylesheets, not code
- Separation of concerns: Styling vs. logic
- Less code: Browser does the heavy lifting
Familiarity
- Standard web APIs: CSS
@keyframes, WAAPI,requestAnimationFrame - Transferable skills: Existing web development knowledge applies
- Library compatibility: Works with GSAP, Framer Motion, Motion One, etc.
This architecture is a bet on native platform capabilities. If you need maximum compatibility or control over every interpolated value, simulation-based approaches like Remotion may be more appropriate.
Trade-offs and constraints
Browser dependency
Helios requires Chromium for production rendering (CDP access). This is a harder dependency than simulation-based approaches that can run in any JavaScript environment.Time control limitations
CDP virtual time is powerful but Chromium-specific. Other browsers don’t expose equivalent APIs (yet).Learning curve for advanced use cases
While basic CSS animations “just work,” advanced scenarios (canvas rendering, complex synchronization) may require understanding Helios’s driver system.Next steps
- Learn about compositions and how to structure your projects
- Explore timeline control for playback and seeking
- Understand the animation system in depth
- Dive into drivers for custom time control