Skip to content

ffmpeg-forgeModern FFmpeg Wrapper

Type-safe FFmpeg for Node.js with hardware acceleration and zero dependencies

Quick Example ​

typescript
import { FFmpeg, VideoCodec, AudioCodec } from 'ffmpeg-forge';

const ffmpeg = new FFmpeg();

await ffmpeg.convert({
  input: 'input.mp4',
  output: 'output.mp4',
  video: {
    codec: VideoCodec.H264,
    bitrate: '2M',
    size: '1920x1080',
  },
  audio: {
    codec: AudioCodec.AAC,
    bitrate: '128k',
  },
});

Why ffmpeg-forge? ​

This package was created as a modern alternative to fluent-ffmpeg, which is no longer actively maintained. It provides:

  • TypeScript native - Not just type definitions
  • Zero dependencies - Only Node.js built-ins
  • Hardware acceleration - 2-10x faster encoding
  • Modern API - Configuration-based instead of chaining
  • Smaller bundle - 25.5 KB gzipped vs 45 KB
  • Better DX - Full autocomplete and type safety

Installation ​

bash
npm install ffmpeg-forge

Requirements:

  • Node.js 16+
  • FFmpeg 4.0+ installed on your system

What's Next? ​

Released under the MIT License.