0.1.0-beta.5 • Published 4 years ago

mp4tools v0.1.0-beta.5

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
4 years ago

MP4Tools

JavaScript library to inspect MP4 files in NodeJS and the browser. Fork of MP4Box.js, in an attempt of making it more standard I am currently in the progress of migrating it to TypeScript. MP4Box.js' code style is quite outdated, it doesn't use modules and doesn't have any type definitions. This libary will not be as comprehensive as MP4Box, it will only provide a basic tool to analyze MP4 files, mainly to use for the MediaSource API. NodeJS is fully supported, you can install it from NPM npm install mp4tools

Chrome, Firefox, Edge and hopefully most modern browsers are supported. You can load MP4Tools from unpkg, which is always up-to-date with NPM, or use bundlers such as WebPack and Rollup to

<!-- Copy/Paste this before your scripts -->
<script src="https://unpkg.com/mp4tools/dist/MP4Tools.bundle.js"></script>

API

In NodeJS you must either import (if you're using modules) or require the NPM package.

// CommonJS
const { MP4Tools } = require('mp4tools');
// ES Modules
import { MP4Tools } from 'mp4tools';

On browsers including the bundle from unpkg will expose the namespace MP4Tools.

To retrieve information from videos directly you can use MP4Tools.probe()

const buffer = /* ArrayBuffer containing your video */;
const info = MP4Tools.probe(buffer);
console.log(info);
0.1.0-beta.5

4 years ago

0.1.0-beta.4

4 years ago

0.1.0-beta.3

4 years ago

0.1.0-beta.2

4 years ago

0.1.0-beta.1

4 years ago

0.1.0-beta.0

4 years ago