6.3.0 • Published 2 months ago

mux.js v6.3.0

Weekly downloads
218,647
License
Apache-2.0
Repository
github
Last release
2 months ago

mux.js Build Status Greenkeeper badge

Lightweight utilities for inspecting and manipulating video container formats.

Maintenance Status: Stable

Diagram

mux.js diagram

MPEG2-TS to fMP4 Transmuxer

Feed in Uint8Arrays of an MPEG-2 transport stream, get out a fragmented MP4:

// create a transmuxer:
var transmuxer = new muxjs.mp4.Transmuxer(initOptions);
// data events signal a new fMP4 segment is ready:
transmuxer.on('data', function (segment) {
  // Tada! Now you have an MP4 that you could use with Media Source Extensions
  sourceBuffer.appendBuffer(segment.data.buffer);
});

Metadata

The transmuxer can also parse out supplementary video data like timed ID3 metadata and CEA-608 captions. You can find both attached to the data event object:

transmuxer.on('data', function (segment) {
  // create a metadata text track cue for each ID3 frame:
  segment.metadata.frames.forEach(function(frame) {
    metadataTextTrack.addCue(new VTTCue(time, time, frame.value));
  });
  // create a VTTCue for all the parsed CEA-608 captions:
  segment.captions.forEach(function(cue) {
    captionTextTrack.addCue(new VTTCue(cue.startTime, cue.endTime, cue.text));
  });
});

MP4 Inspector

Parse MP4s into javascript objects or a text representation for display or debugging:

// drop in a Uint8Array of an MP4:
var parsed = muxjs.mp4.tools.inspect(bytes);
// dig into the boxes:
console.log('The major brand of the first box:', parsed[0].majorBrand);
// print out the structure of the MP4:
document.body.appendChild(document.createTextNode(muxjs.textifyMp4(parsed)));

The MP4 inspector is used extensively as a debugging tool for the transmuxer. You can see it in action by cloning the project and opening the debug page in your browser.

Building

If you're using this project in a node-like environment, just require() whatever you need. If you'd like to package up a distribution to include separately, run npm run build. See the package.json for other handy scripts if you're thinking about contributing.

Collaborator

If you are a collaborator, we have a guide on how to release the project.

7.0.3

2 months ago

7.0.2

5 months ago

7.0.1

7 months ago

7.0.0

9 months ago

6.3.0

1 year ago

6.1.0

2 years ago

6.2.0

2 years ago

6.0.1

2 years ago

6.0.0

2 years ago

5.14.1

3 years ago

5.14.0

3 years ago

5.13.0

3 years ago

5.12.2

3 years ago

5.12.1

3 years ago

5.11.3

3 years ago

5.12.0

3 years ago

5.11.2

3 years ago

5.11.1

3 years ago

5.11.0

3 years ago

5.10.0

3 years ago

5.9.2

3 years ago

5.9.1

3 years ago

5.8.0

3 years ago

5.7.0

3 years ago

5.6.7

4 years ago

5.6.6

4 years ago

5.6.5

4 years ago

5.6.4

4 years ago

5.6.3

4 years ago

5.6.2

4 years ago

5.6.1

4 years ago

5.6.0

4 years ago

5.5.4

4 years ago

5.5.3

4 years ago

5.5.2

4 years ago

5.5.1

5 years ago

5.5.0

5 years ago

5.4.0

5 years ago

5.3.1

5 years ago

5.3.0

5 years ago

5.2.1

5 years ago

5.2.1-1

5 years ago

5.2.1-0

5 years ago

5.2.0

5 years ago

5.2.0-5

5 years ago

5.2.0-4

5 years ago

5.2.0-3

5 years ago

5.2.0-2

5 years ago

5.2.0-1

5 years ago

5.2.0-0

5 years ago

5.1.3

5 years ago

5.1.2

5 years ago

5.1.1

5 years ago

5.1.0

5 years ago

5.0.1

5 years ago

5.0.0

6 years ago

4.5.1

6 years ago

4.5.0

6 years ago

4.4.1

6 years ago

4.4.0

6 years ago

4.3.2

6 years ago

4.3.1

7 years ago

4.3.0

7 years ago

4.2.2

7 years ago

4.2.1

7 years ago

4.2.0

7 years ago

4.1.5

7 years ago

4.1.4

7 years ago

4.1.3

7 years ago

4.1.2

7 years ago

4.1.1

7 years ago

4.1.0

7 years ago

4.0.1

7 years ago

4.0.0

7 years ago

3.1.0

7 years ago

3.0.4

7 years ago

4.0.0-0

7 years ago

3.0.3

7 years ago

3.0.2

8 years ago

3.0.1

8 years ago

3.0.0

8 years ago

2.5.0

8 years ago

2.4.3

8 years ago

2.4.2

8 years ago

2.4.1

8 years ago

2.4.0

8 years ago

2.3.1

8 years ago

2.3.0

8 years ago

2.2.1

8 years ago

2.2.0

8 years ago

2.2.0-0

8 years ago

2.1.2

8 years ago

2.1.1

8 years ago

2.0.2

8 years ago

2.1.0

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.4.1

8 years ago

1.4.0

8 years ago

1.3.1

8 years ago

1.3.0

8 years ago

1.2.0

8 years ago

1.0.0

9 years ago