Skip to main content

API Reference

The node-webcodecs API follows the W3C WebCodecs specification, providing native video and audio encoding/decoding in Node.js.
All classes and types are exported from the main node-webcodecs package:

Core Classes

Video Processing

VideoEncoder

Encode raw VideoFrame objects into compressed video chunks (H.264, H.265, VP9, AV1)

VideoDecoder

Decode compressed video chunks back into VideoFrame objects

VideoFrame

Raw video frame data with pixel format, dimensions, and color space

EncodedVideoChunk

A chunk of compressed video data (keyframe or delta frame)

Audio Processing

AudioEncoder

Encode raw AudioData into compressed audio (AAC, MP3, Opus, FLAC)

AudioDecoder

Decode compressed audio chunks back into AudioData objects

AudioData

Raw audio samples with sample rate, channel count, and format

EncodedAudioChunk

A chunk of compressed audio data

Image & Color

ImageDecoder

Decode image files (JPEG, PNG, WebP, GIF) into VideoFrame objects

VideoColorSpace

Color space information (primaries, transfer, matrix coefficients)

Utility Functions

FFmpeg Information

Returns FFmpeg version information, or null if native module unavailable.
Lists all available encoders and decoders.
Check if a specific codec is available.
Check if the native FFmpeg addon loaded successfully.

Supported Codecs

Video Codecs

Audio Codecs


Type Definitions

For detailed type information, see the Types Reference.

Common Types


Quick Reference

Encoding Pipeline

Decoding Pipeline