# @ffmpeg-installer/ffmpeg

> Platform independent binary installer of FFmpeg for node projects

Latest version **1.1.0** (published 2021-07-15) · LGPL-2.1 license · 0 weekly downloads

## Install

```sh
npm install @ffmpeg-installer/ffmpeg
pnpm add @ffmpeg-installer/ffmpeg
yarn add @ffmpeg-installer/ffmpeg
bun add @ffmpeg-installer/ffmpeg
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2021-07-15 |
| First published | 2016-09-05 |
| Weekly downloads | 0 |
| License | LGPL-2.1 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 24 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 463 |
| Author | Kristoffer Lundén |
| Maintainers | ffmpeg-installer |
| Keywords | ffmpeg, binary, installer, audio, sound |

## Links

- npm: https://www.npmjs.com/package/@ffmpeg-installer/ffmpeg
- Repository: https://github.com/kribblo/node-ffmpeg-installer
- Homepage: https://github.com/kribblo/node-ffmpeg-installer#readme
- Issues: https://github.com/kribblo/node-ffmpeg-installer/issues
- npm.io page: https://npm.io/package/@ffmpeg-installer/ffmpeg

## Dependencies (8)

- [@ffmpeg-installer/linux-arm](https://npm.io/package/@ffmpeg-installer/linux-arm.md) 4.1.3
- [@ffmpeg-installer/linux-x64](https://npm.io/package/@ffmpeg-installer/linux-x64.md) 4.1.0
- [@ffmpeg-installer/win32-x64](https://npm.io/package/@ffmpeg-installer/win32-x64.md) 4.1.0
- [@ffmpeg-installer/darwin-x64](https://npm.io/package/@ffmpeg-installer/darwin-x64.md) 4.1.0
- [@ffmpeg-installer/linux-ia32](https://npm.io/package/@ffmpeg-installer/linux-ia32.md) 4.1.0
- [@ffmpeg-installer/win32-ia32](https://npm.io/package/@ffmpeg-installer/win32-ia32.md) 4.1.0
- [@ffmpeg-installer/linux-arm64](https://npm.io/package/@ffmpeg-installer/linux-arm64.md) 4.1.4
- [@ffmpeg-installer/darwin-arm64](https://npm.io/package/@ffmpeg-installer/darwin-arm64.md) 4.1.5

## Recent versions

- 1.1.0 (latest) — 2021-07-15
- 1.0.20 — 2019-09-12
- 1.0.19 — 2019-07-02
- 1.0.18 — 2019-06-11
- 1.0.17 — 2018-12-17
- 1.0.16 — 2018-10-13
- 1.0.15 — 2018-05-31
- 1.0.14 — 2018-05-03
- 1.0.13 — 2017-09-20
- 1.0.12 — 2017-04-25
- 1.0.11 — 2017-04-24
- 1.0.10 — 2017-04-22
- 1.0.9 — 2016-09-29
- 1.0.8 — 2016-09-29
- 1.0.7 — 2016-09-27
- … 6 more at https://npm.io/package/@ffmpeg-installer/ffmpeg/versions

## README

# node-ffmpeg-installer

Platform independent binary installer of [FFmpeg](https://ffmpeg.org/) for node projects. Useful for tools that should "just work" on multiple environments.

Installs a binary of `ffmpeg` for the current platform and provides a path and version. Supports Linux, Windows and Mac OS/X.

A combination of package.json fields `optionalDependencies`, `cpu`, and `os` let's the installer only download the binary for the current platform. See also "Warnings during install", below.

## Install

    npm install --save @ffmpeg-installer/ffmpeg

## Usage examples

```javascript
const ffmpeg = require('@ffmpeg-installer/ffmpeg');
console.log(ffmpeg.path, ffmpeg.version);
```

### [process.spawn()](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options)

```javascript
const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;
const spawn = require('child_process').spawn;
const ffmpeg = spawn(ffmpegPath, args);
ffmpeg.on('exit', onExit);
```

### [fluent-ffmpeg](https://github.com/fluent-ffmpeg/node-fluent-ffmpeg)

```javascript
const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;
const ffmpeg = require('fluent-ffmpeg');
ffmpeg.setFfmpegPath(ffmpegPath);
```

## Known issues

### Warnings during install

To automatically choose the binary to install, [optionalDependencies](https://docs.npmjs.com/files/package.json#optionaldependencies) are used. This currently outputs warnings in the console, an issue that is [tracked by the npm team here](https://github.com/npm/npm/issues/9567).

### AWS and/or Elastic Beanstalk

If you get permissions issues, try adding a .npmrc file with the following:

    unsafe-perm=true

See [issue #21](https://github.com/kribblo/node-ffmpeg-installer/issues/21)

### Wrong path under Electron with Asar enabled

It's a [known issue](https://github.com/electron-userland/electron-packager/issues/740) that Asar breaks native paths. As a workaround, if you use Asar, you can do something like this:

```javascript
const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path.replace('app.asar', 'app.asar.unpacked');
```

### Compiling ffmpeg for platforms other than your own

If you need to install a version of `ffmpeg` that differs than your current platform (e.g. compiling a Linux version to upload to AWS Lambda from MacOS), you can use `npm install @ffmpeg-installer/linux-x64 --force` (substituting `linux-x64` with whatever platform you need). Note that if you are compressing your project into a `.zip` for Lambda, you will need to exclude the other platforms' builds from your archive.

## The binaries

Downloaded from the sources listed at [ffmpeg.org](https://ffmpeg.org/download.html):

* Linux 32-bit: (20181210-g0e8eb07980): https://www.johnvansickle.com/ffmpeg/
* Linux 64-bit: (20181210-g0e8eb07980): https://www.johnvansickle.com/ffmpeg/
* Mac OS/X (92718-g092cb17983): https://www.osxexperts.net/
* Mac OS/X (92718-g092cb17983): https://evermeet.cx/ffmpeg/
* Windows 32-bit (20181217-f22fcd4): https://ffmpeg.zeranoe.com/builds/win32/static/
* Windows 64-bit (20181217-f22fcd4): https://ffmpeg.zeranoe.com/builds/win64/static/

For version updates, submit issue or pull request.

## Upload new versions

In every updated `platforms/*` directory:
 
    npm run upload
    
## See also

* [node-ffprobe-installer](https://www.npmjs.com/package/@ffprobe-installer/ffprobe) - fork of this project that does the same thing for FFprobe

---
_Source: https://npm.io/package/@ffmpeg-installer/ffmpeg · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
