Skip to content

v1.2.0 — Mediabunny integration, natural process exit

Choose a tag to compare

@caseymanos caseymanos released this 14 Jul 21:55
· 14 commits to main since this release

Added

  • node-webcodecs/register — installs the WebCodecs classes on globalThis so browser-first media libraries (e.g. Mediabunny) run unmodified in Node
  • node-webcodecs/mediabunny — one-line Mediabunny integration: the globals plus a VideoSample transformer so Conversion resizing works without a canvas (native multithreaded scaling)

Measured against @mediabunny/server (NodeAV) on the same 1080p file: ~7× faster full-file decode (~2,600 vs ~350 fps), bit-identical pixels, 1.5× faster resize transcodes.

Fixed

  • Decoder/encoder unusable after flush() — FFmpeg was left in EOF state; per the WebCodecs spec both now accept new work after a flush. Fixes frame-accurate seeking in Mediabunny (getSample returned null).
  • Processes no longer hang after codec work finishes — the event loop is held only while encodes/decodes/flushes are in flight, so scripts exit naturally
  • optimizeForLatency was accepted but ignored; it now restricts the decoder to slice threading with low-delay flags
import 'node-webcodecs/mediabunny';
import { Input, ALL_FORMATS, FilePathSource, VideoSampleSink } from 'mediabunny';
// Mediabunny now decodes at native speed in Node — no browser, no canvas