# @dropb/ffprobe

> ffprobe wrapper

Latest version **3.0.1** (published 2025-03-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install @dropb/ffprobe
pnpm add @dropb/ffprobe
yarn add @dropb/ffprobe
bun add @dropb/ffprobe
```

## Health

**Score 50/100 (C)** — status: stable.

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

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2025-03-05 |
| First published | 2018-03-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=14.17.0 |
| Dependencies | 0 |
| Unpacked size | 15.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | kukhariev |
| Maintainers | q_h |
| Keywords | ffprobe, media, video, audio, stream |

## Links

- npm: https://www.npmjs.com/package/@dropb/ffprobe
- Repository: https://github.com/kukhariev/ffprobe
- Homepage: https://github.com/kukhariev/ffprobe#readme
- Issues: https://github.com/kukhariev/ffprobe/issues
- npm.io page: https://npm.io/package/@dropb/ffprobe

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 3.0.1 (latest) — 2025-03-05
- 3.0.0 — 2023-04-30
- 2.0.1 — 2022-05-26
- 2.0.0 — 2021-03-02
- 1.5.0 — 2020-04-18
- 1.4.2 — 2019-09-30
- 1.4.1 — 2019-06-15
- 1.4.0 — 2019-06-13
- 1.3.2 — 2019-06-05
- 1.3.1 — 2018-10-06
- 1.3.0 — 2018-10-06
- 1.2.5 — 2018-10-05
- 1.2.4 — 2018-09-27
- 1.2.3 — 2018-05-19
- 1.2.2 — 2018-04-23
- … 4 more at https://npm.io/package/@dropb/ffprobe/versions

## README

# @dropb/ffprobe

[![npm version][npm-image]][npm-url] [![Build status][gha-image]][gha-url]
[![commits since latest release][comm-image]][comm-url]

simple ffprobe wrapper

## Install

```sh
npm install  @dropb/ffprobe
```

## Usage

```js
// This is a hybrid module that can be loaded with import
import { ffprobe, ffprobeSync } from '@dropb/ffprobe';
// or require()
// const { ffprobe, ffprobeSync } = require('@dropb/ffprobe');

// optional: specify the ffprobe path
import { path as ffprobePath } from 'ffprobe-static';
ffprobe.path = ffprobePath;
// or
// process.env.FFPROBE_PATH = ffprobePath;



// async/await
async function run() {
  try {
    // file
    const data = await ffprobe('./testfile.mp4');
    console.log(data.format.duration);
  } catch (e) {
    console.error(e);
  }
  try {
    // URL
    const { streams } = await ffprobe('http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4');
    console.log(streams[0].width);
  } catch (e) {
    console.error(e);
  }
  try {
    // Readable Stream
    const { format } = await ffprobe(createReadStream('./testfile.mp4'));
    console.log(format.duration);
  } catch (e) {
    console.error(e);
  }
}
run();

// node-style callback
ffprobe('./testfile.mp4', (err, data) => {
  if (err) {
    console.error(err);
  } else {
    console.log(data.format.duration);
  }
});

// sync
const data = ffprobeSync('./testfile.mp4');
console.log(data.format.duration);
```

## API

```ts
/**
 * Run ffprobe on specified input
 * @param input FilePath / URL / Readable Stream
 */
function ffprobe(input: string | Stream): Promise<FfprobeData>;
function ffprobe(input: string | Stream, cb: FfprobeCallback): void;
```

> interface
> [FfprobeData](src/interfaces.ts)

## License

[MIT](LICENSE)

[npm-image]: https://img.shields.io/npm/v/@dropb/ffprobe.svg
[npm-url]: https://www.npmjs.com/package/@dropb/ffprobe
[gha-image]: https://github.com/kukhariev/ffprobe/workflows/CI/badge.svg
[gha-url]: https://github.com/kukhariev/ffprobe/actions
[comm-image]: https://img.shields.io/github/commits-since/kukhariev/ffprobe/latest
[comm-url]: https://github.com/kukhariev/ffprobe/releases/latest

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