// the find
Vanilagy/mediabunny
Pure TypeScript media toolkit for reading, writing, and converting video and audio files, directly in the browser.
Mediabunny is a zero-dependency TypeScript library for reading, writing, muxing, demuxing, and converting media files entirely in the browser using the WebCodecs API. It covers 10+ container formats (MP4, WebM, HLS, MKV, Ogg, WAV, MP3, FLAC, MPEG-TS, ADTS) and 25+ codecs, with streaming I/O so you're not buffering entire files in memory. It's aimed at developers building web-based video editors, recorders, or converters who would otherwise reach for FFmpeg.wasm.
The tree-shaking story is serious — the monorepo splits codec-specific WASM extensions (AAC encoder, AC3, FLAC encoder, MP3 encoder) into separate packages so you only pay for what you import. The WebCodecs integration is correct: it uses hardware-accelerated encode/decode where available and falls back gracefully, which is the hard part that most DIY attempts get wrong. The streaming I/O design means you can process files larger than available RAM, which is a real constraint in browser contexts that competitors like mp4box.js paper over. The test suite is split into node and browser suites with real media fixtures, not synthetic blobs — that's a meaningful correctness signal.
WebCodecs browser support is still gated — Safari only shipped it in 2023, and the @mediabunny/server package ships polyfills for Node/Bun/Deno that are hand-rolled rather than using a mature implementation, so server-side behavior may diverge from browser behavior in subtle ways. The MPL-2.0 license is positioned as 'not much different from MIT' in the README, but that's not accurate for teams whose build pipelines bundle and distribute modified versions — legal will push back on that characterization. HEVC decode is listed but HEVC encode is absent, which matters if you're targeting Apple devices where H.265 is the native format. The HLS output muxer is relatively new (there's a blog post about it) and the test coverage for HLS edge cases looks thin compared to the MP4/WebM paths.