Choose your target
Every alpha2 package renders the same project document with the same rendering code. They differ in where they run and in who decodes and encodes the media. Use this page to pick one.
At a glance
Section titled “At a glance”| Package | Runs in | Decodes media | Encodes files | Renders on |
|---|---|---|---|---|
alpha2 |
Browser (WebAssembly) | Your app (helpers: WebCodecs, mediabunny) | Your app (helpers: WebCodecs, mediabunny) | WebGPU, else WebGL2, else the CPU renderer |
@alpha2-sh/react |
Browser, React 18 or later | As alpha2 |
As alpha2 |
As alpha2 |
@alpha2-sh/editor |
Browser; its editing core also in Node.js | Its browser bridge imports files | Its browser bridge exports through WebCodecs | As alpha2 |
@alpha2-sh/node |
Node.js, Electron main process | alpha2-host (FFmpeg 8) |
alpha2-host (FFmpeg 8) |
GPU, or the CPU renderer |
alpha2-host |
Command line, or any language over stdio | FFmpeg 8 | FFmpeg 8 | GPU, or the CPU renderer |
alpha2 (Python) |
Python 3.11.4 or later | alpha2-host |
alpha2-host |
GPU, or the CPU renderer |
alpha2 (crate) |
Your Rust program | Your program (or alpha2-native) |
Your program (or alpha2-native) |
wgpu: Direct3D 12 on Windows, Metal on macOS, Vulkan (then GL) on Linux |
Browser: alpha2
Section titled “Browser: alpha2”Choose it when you preview or export in the browser and want control over every step. The package is the engine as WebAssembly plus the TypeScript that drives it.
- Does: load and validate projects, render a time on a canvas, export offscreen on the exact frame grid (planar I420 frames), mix audio, measure loudness, lay out text.
- Doesn’t: open files. Your app decodes media and uploads frames and audio, and encodes the export.
alpha2/frame-supply,alpha2/mediaand the optionalalpha2/mediabunny(decoders, and an MP4, MOV, MKV and WebM sink) do most of that work for you.
React: @alpha2-sh/react
Section titled “React: @alpha2-sh/react”Choose it to show the alpha2 player in a React tree. Alpha2Canvas makes the canvas, hands it to a player you create, presents timeTicks when it changes and recovers from a lost GPU onto a new canvas. You still supply the player and the frames.
Editor: @alpha2-sh/editor
Section titled “Editor: @alpha2-sh/editor”Choose it when you build an editing app. Its core holds documents, typed commands, validation and undo, and runs without a DOM, so it also works in Node.js. Its browser bridge imports files, previews, plays with audio and exports to MP4, MOV, MKV or WebM through WebCodecs. @alpha2-sh/editor/react adds React bindings (React 19.3 or a later 19).
Node.js and Electron: @alpha2-sh/node
Section titled “Node.js and Electron: @alpha2-sh/node”Choose it to export files on a server or from an Electron main process. It runs alpha2-host, the native renderer, one process per export. The host decodes and encodes with FFmpeg 8 (MP4 with H.264 and AAC by default; MOV, Matroska and WebM too) and renders on a hardware GPU, or on the CPU when there is none. npx @alpha2-sh/node install fetches the host for your platform.
- Does: export files, render stills to PNG, report capabilities, check media before rendering (
conform). - Doesn’t: preview interactively. For that, pair it with the browser packages.
Any other language: alpha2-host
Section titled “Any other language: alpha2-host”Choose it from a shell script, or from a language without a client. alpha2-host export exports one project from the command line. alpha2-host serve takes JSON requests on standard input and answers on standard output: the host protocol. The archives also contain alpha2, a media command that probes, transcodes and thumbnails files.
Python: alpha2
Section titled “Python: alpha2”Choose it to build, validate and export projects from Python. Projects are plain dicts, validation runs the engine’s own validator in-process, and rendering runs alpha2-host. It adds authoring helpers, a text measurer and alpha2.compose, which compiles a video described by intent (slideshows, titles, captions, music) into a project.
Rust: the alpha2 crate
Section titled “Rust: the alpha2 crate”Choose it to embed the engine in a Rust program. You lend the engine decoded frames through a FrameProvider and take back rendered frames and YUV 4:2:0 planes. The crate does not read or write media files; alpha2-native decodes, probes and encodes with FFmpeg 8 if you need it. The wgpu-interop feature shares your own wgpu device and textures with the engine.
Extensions
Section titled “Extensions”SVG, animated images (GIF, animated WebP, APNG), Lottie, OpenEXR and image sequences are read by extension providers. alpha2-host reads them natively, and the browser loads the same code from its own WebAssembly module only when a project opens such a source. See Extensions.
Platforms
Section titled “Platforms”| Platform | GPU | Hardware decode and encode |
|---|---|---|
| Browser | WebGPU; WebGL2 when drawing on a canvas without WebGPU | by the application |
| Linux x64, arm64 (glibc 2.35 or later; not musl) | Vulkan | Vulkan Video |
| macOS (Apple silicon) | Metal | VideoToolbox |
| Windows x64 | Direct3D 12 | D3D12VA |
Windows on ARM is not supported. Minimum runtimes: Node.js 22.21 or later (24.5 or later on Node 24), Python 3.11.4, Rust 1.88.
