seydx/node-av
FFmpeg bindings for Node.js. Features both low-level and high-level APIs, full hardware acceleration, TypeScript support, and modern async patterns
What it solves
Node.js developers who need audio/video processing often rely on the FFmpeg command-line tool, which means spawning processes and parsing output. NodeAV eliminates that layer by binding directly to FFmpeg's native libraries, giving you full control with minimal overhead. It adds TypeScript type safety so options for codecs, formats, filters, and more are checked at compile time, reducing errors and improving developer experience.
How it works
NodeAV uses N-API to connect Node.js to FFmpeg's C APIs. It provides three levels of API:
- Low-level: Direct access to FFmpeg's functions for maximum control.
- High-level: Abstractions for common tasks like decoding, encoding, and transcoding.
- Pipeline: A simple chainable interface for multi-step processing.
It includes hardware acceleration with auto-detection (CUDA, VAAPI, etc.) and manages resources automatically using the Disposable pattern (e.g., using and await using). Prebuilt binaries are downloaded during installation, matching the FFmpeg build used by the bindings, so no separate setup is needed. It also offers utilities like device capture, filtering, and streaming.
Who it’s for
Node.js developers building applications that require media processing – such as video transcoding, IP camera integration, live streaming, or screen capture – who want performance close to FFmpeg CLI without losing the convenience of a well-typed JavaScript API. It’s also useful for projects that need to embed FFmpeg functionality directly in a Node.js process, especially those needing hardware acceleration.
Highlights
- Type-safe options for every codec, format, ~580 filters, and bitstream filter, generated from FFmpeg’s own metadata – autocomplete and validation in editors.
- Three API tiers (low-level, high-level, pipeline) to match different needs.
- Hardware acceleration with automatic detection and support for specific devices (CUDA, VAAPI, etc.).
- Device capture for cameras, microphones, and screen (platform-specific backends like AVFoundation, V4L2, DirectShow).
- Whisper speech recognition integration via whisper.cpp, with automatic model download and hardware-accelerated inference.
- Advanced filtering with FilterComplexAPI for complex graphs, overlays, and real-time effects.
- Browser streaming via fMP4 or WebRTC, including support for RTSP cameras.
- RTSP backchannel/talkback for bidirectional audio with IP cameras.
- Performance comparable to FFmpeg CLI (benchmarks show near-zero overhead in most operations).
- Automatic resource cleanup with the Disposable pattern, reducing memory leaks.
- Prebuilt binaries for Windows, Linux, and macOS – no manual FFmpeg installation.
- Tree-shaking support with separate entry points for API, constants, and layouts.
Related
- Project
- Project
- Project
- Project