@napi-rs/webcodecs
- W3C WebCodecs API compliant - Full implementation of the WebCodecs specification with native
DOMException errors
- Video encoding/decoding - H.264, H.265, VP8, VP9, AV1
- Audio encoding/decoding - AAC, Opus, MP3, FLAC, Vorbis, PCM variants
- Image decoding - JPEG, PNG, WebP, GIF, BMP, AVIF
- Canvas integration - Create VideoFrames from
@napi-rs/canvas for graphics and text rendering
- Hardware acceleration - Zero-copy GPU encoding with VideoToolbox (macOS), NVENC (NVIDIA), VAAPI (Linux), QSV (Intel)
- Cross-platform - macOS, Windows, Linux (glibc/musl, x64/arm64/armv7)
Supported Codecs
Video
| Codec |
Codec String |
Encoding |
Decoding |
| H.264 |
avc1.* |
✅ |
✅ |
| H.265 |
hev1.*, hvc1.* |
✅ |
✅ |
| VP8 |
vp8 |
✅ |
✅ |
| VP9 |
vp09.*, vp9 |
✅ |
✅ |
| AV1 |
av01.*, av01, av1 |
✅ |
✅ |
Note: Short form codec strings (vp9, av01, av1) are accepted for compatibility with browser implementations.
Audio
| Codec |
Codec String |
Encoding |
Decoding |
| AAC |
mp4a.40.2 |
✅ |
✅ |
| Opus |
opus |
✅ |
✅ |
| MP3 |
mp3 |
✅ |
✅ |
| FLAC |
flac |
✅ |
✅ |
| Vorbis |
vorbis |
❌ |
✅ |
| PCM |
pcm-* |
❌ |
✅ |
Image
| Format |
MIME Type |
Decoding |
| JPEG |
image/jpeg |
✅ |
| PNG |
image/png |
✅ |
| WebP |
image/webp |
✅ |
| GIF |
image/gif |
✅ |
| BMP |
image/bmp |
✅ |
| AVIF |
image/avif |
✅ |
Platform Support
Pre-built binaries are available for:
| Platform |
Architecture |
| macOS |
x64, arm64 |
| Windows |
x64, arm64 |
| Linux (glibc) |
x64, arm64 |
| Linux (musl) |
x64, arm64 |
| Linux (glibc, gnueabihf) |
armv7 |