0.2.2 • Published 5 years ago

fmp4.js v0.2.2

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

A Javascript library to parse ISO Base Media File Format (MPEG-4 Part 12) ISO/IEC 14496-12

Usage (Node JS)

npm install --save fmp4.js

The library implements the Writable stream interface and acts a a "sink". For example to download and parse an MP4 fragment:

const request = require("request");
const fMP4 = require("fmp4.js");

request.get("http://example.com/video.dash")
.pipe(fMP4.parse())
.on("finish", function() {

  // Obtain all boxes found in the fragment
  const boxes = fMP4.boxes;

  // Parse each box
  for (let i = 0; i < boxes.length; i++) {
    let parsedBox = boxes[i].parse(); // MP4Box

    /**
     *
     * MP4Box {
     *   hdr: { size, type, hdrsize },
     *   $type: {
     *     key/value pairs,
     *     array of child boxes (if available)
     *   }
     * }
     */
    console.log(parsedBox);
  }
});

An example implementation of the library that parses and dump the contents of an ISOBMFF file is included:

node mp4dump.js test/support/testassets/cmaf_chunk.mp4
0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.17

5 years ago

0.1.16

5 years ago

0.1.15

5 years ago

0.1.14

5 years ago

0.1.13

5 years ago

0.1.11

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.5

5 years ago