Skip to content

Configuration

Settings can be applied per input. Legacy applications may also configure executable paths globally.

Per-operation settings

ts
const video = await ffmpeg(input, {
  ffmpegPath: '/opt/ffmpeg/bin/ffmpeg',
  ffprobePath: '/opt/ffmpeg/bin/ffprobe',
  overwrite: true,
  timeout: 90_000,
  maxBuffer: 32 * 1024 * 1024,
  signal: abortController.signal,
});
SettingDefaultPurpose
ffmpegPathffmpegFFmpeg executable
ffprobePathffprobeffprobe executable
overwritefalseUse -y; otherwise -n protects existing files
timeout0Maximum operation time in milliseconds; zero disables it
maxBuffer16 MiBRetained stdout/stderr tail without terminating the process
signalAbortSignal for probes and conversions
encodingutf8Process output encoding
cwd, envinheritedChild working directory and environment

Global executable paths

ts
ffmpeg.bin = '/opt/ffmpeg/bin/ffmpeg';
ffmpeg.ffprobeBin = '/opt/ffmpeg/bin/ffprobe';

When ffmpegPath is absolute and no explicit ffprobe override exists, a sibling ffprobe binary is inferred.

Cancellation

ts
const controller = new AbortController();
const video = await ffmpeg(input, { signal: controller.signal });

setTimeout(() => controller.abort(), 10_000);
await video.save(output);

Cancellation rejects with an FfmpegError whose historical numeric code is 117.

Built around FFmpeg. Designed for modern Node.js.