# bento4js

> Native NodeJS wrapper implementing the bento4 utilities.

Latest version **0.0.3** (published 2021-10-06) · GPL-2.0 license · 0 weekly downloads

## Install

```sh
npm install bento4js
pnpm add bento4js
yarn add bento4js
bun add bento4js
```

## Health

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

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

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2021-10-06 |
| First published | 2021-10-06 |
| Weekly downloads | 0 |
| License | GPL-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 2 |
| Unpacked size | 1.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 3 |
| Author | nunsie |
| Maintainers | nusrath |
| Keywords | bento4, mp4info, mp4dump, mp4edit, mp4extract, mp4encrypt, mp4decrypt, mp4dcfpackager, mp4compact, mp4fragment, mp4split, mp4tag, mp4mux, mp42aac, mp42avc, mp42hls, mp42ts, mp4-dash, mp4-dash-clone |

## Links

- npm: https://www.npmjs.com/package/bento4js
- Repository: https://github.com/nunsie/bento4js
- Homepage: https://github.com/nunsie/bento4js#readme
- Issues: https://github.com/nunsie/bento4js/issues
- npm.io page: https://npm.io/package/bento4js

## Dependencies (2)

- [bindings](https://npm.io/package/bindings.md) ^1.5.0
- [node-addon-api](https://npm.io/package/node-addon-api.md) ^4.2.0

## Recent versions

- 0.0.3 (latest) — 2021-10-06
- 0.0.2 — 2021-10-06
- 0.0.1 — 2021-10-06

## README

<h1 align="center">Welcome to bento4js 👋</h1>
<p>
  <img alt="Version" src="https://img.shields.io/badge/version-0.0.1-blue.svg?cacheSeconds=2592000" />
  <a href="https://github.com/nunsie/bento4js#readme" target="_blank">
    <img alt="Documentation" src="https://img.shields.io/badge/documentation-yes-brightgreen.svg" />
  </a>
  <a href="https://github.com/nunsie/bento4js/graphs/commit-activity" target="_blank">
    <img alt="Maintenance" src="https://img.shields.io/badge/Maintained%3F-yes-green.svg" />
  </a>
  <a href="https://github.com/nunsie/bento4js/blob/master/LICENSE" target="_blank">
    <img alt="License: GPL--2.0" src="https://img.shields.io/github/license/nunsie/bento4js" />
  </a>
  <a href="https://twitter.com/0x6e75730a" target="_blank">
    <img alt="Twitter: 0x6e75730a" src="https://img.shields.io/twitter/follow/0x6e75730a.svg?style=social" />
  </a>
</p>

> Native NodeJS wrapper implementing the bento4 utilities.

### 🏠 [Homepage](https://github.com/nunsie/bento4js)

### ✨ [Demo](https://github.com/nunsie/bento4js)

---

## Install

```sh
yarn add bento4js
```

## Usage

```js
const { mp4decrypt } = require('bento4js');

const keys = {
  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',
};

const encrypted = fs.readFileSync('enc.m4s');
mp4decrypt.decrypt(encrypted, keys).then(decrypted => {
  fs.writeFileSync('dec.mp4', decrypted);
});
```

## Run tests

```sh
yarn test
```

---

## Roadmap

| app name       | description                                                                                                                     | status | reference                                                                                                               |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------- |
| mp4info        | displays high level info about an MP4 file, including all tracks and codec details                                              | ❌     | mp4info.cpp                                                                                                             |
| mp4dump        | displays the entire atom/box structure of an MP4 file                                                                           | ❌     | mp4dump.cpp                                                                                                             |
| mp4edit        | add/insert/remove/replace atom/box items of an MP4 file                                                                         | ❌     | mp4edit.cpp                                                                                                             |
| mp4extract     | extracts an atom/box from an MP4 file                                                                                           | ❌     | mp4extract.cpp                                                                                                          |
| mp4encrypt     | encrypts an MP4 file (multiple encryption schemes are supported)                                                                | ❌     | mp4encrypt.cpp                                                                                                          |
| mp4decrypt     | decrypts an MP4 file (multiple encryption schemes are supported)                                                                | ✅     | [Mp4Decrypt.cpp](https://github.com/axiomatic-systems/Bento4/blob/master/Source/C%2B%2B/Apps/Mp4Decrypt/Mp4Decrypt.cpp) |
| mp4dcfpackager | encrypts a media file into an OMA DCF file                                                                                      | ❌     | mp4dcfpackager.cpp                                                                                                      |
| mp4compact     | converts ‘stsz’ tables into ‘stz2′ tables to create more compact MP4 files                                                      | ❌     | mp4compact.cpp                                                                                                          |
| mp4fragment    | creates a fragmented MP4 file from a non-fragmented one or re-fragments an already-fragmented file                              | ❌     | mp4fragment.cpp                                                                                                         |
| mp4split       | splits a fragmented MP4 file into discrete files                                                                                | ❌     | mp4split.cpp                                                                                                            |
| mp4tag         | show/edit MP4 metadata (iTunes-style and others)                                                                                | ❌     | mp4tag.cpp                                                                                                              |
| mp4mux         | multiplexes one or more elementary streams (H264, AAC) into an MP4 file                                                         | ❌     | mp4mux.cpp                                                                                                              |
| mp42aac        | extract a raw AAC elementary stream from an MP4 file                                                                            | ❌     | mp42aac.cpp                                                                                                             |
| mp42avc        | extract a raw AVC/H.264 elementary stream from an MP4 file                                                                      | ❌     | mp42avc.cpp                                                                                                             |
| mp42hls        | converts an MP4 file to an HLS (HTTP Live Streaming) presentation, including the generation of the segments and .m3u8 playlist. | ❌     | mp42hls.cpp                                                                                                             |
| mp42ts         | converts an MP4 file to an MPEG2-TS file.                                                                                       | ❌     | mp42ts.cpp                                                                                                              |
| mp4-dash       | creates an MPEG DASH output from one or more MP4 files, including encryption.                                                   | ❌     | mp4-dash.cpp                                                                                                            |
| mp4-dash-clone | creates a local clone of a remote or local MPEG DASH presentation, optionally encrypting the segments as they are cloned.       | ❌     | mp4-dash-clone.cpp                                                                                                      |

---

## Author

👤 **nunsie**

- Website: https://github.com/nunsie
- Twitter: [@0x6e75730a](https://twitter.com/0x6e75730a)
- Github: [@nunsie](https://github.com/nunsie)

---

## Acknowledgements

[@ubuntuegor](https://github.com/ubuntuegor): For the [ubuntuegor/mp4decrypt-buffer](https://github.com/ubuntuegor/mp4decrypt-buffer) repo that this project is based on and the pointers he has provided me with to get started.

[@axiomatic-systems](https://github.com/axiomatic-systems): For the [axiomatic-systems/Bento4](https://github.com/axiomatic-systems/Bento4) fantastic Bento4 SDK.

---

## 🤝 Contributing

Contributions, issues and feature requests are welcome!<br />Feel free to check [issues page](https://github.com/nunsie/bento4js/issues). You can also take a look at the [contributing guide](https://github.com/nunsie/bento4js/blob/master/CONTRIBUTING.md).

---

## Show your support

Give a ⭐️ if this project helped you!

---

## 📝 License

Copyright © 2021 [nunsie](https://github.com/nunsie).<br />
This project is [GPL--2.0](https://github.com/nunsie/bento4js/blob/master/LICENSE) licensed.

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