Skip to content

Latest commit

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

mp4.js

A streaming MP4 demuxer in JavaScript, for av.js.

Example

Like all av.js demuxers, mp4.js is a writable stream that you pipe mp4 data to. It emits 'track' events, each with a readable stream containing the data for that track.

The following example shows how you might extract just the audio track to a file.

import{MP4Demuxer}from'mp4';importfsfrom'fs';fs.createReadStream('movie.mp4').pipe(newMP4Demuxer).on('track',function(track){console.log(track.type,track.format)if(track.type==='audio'){track.pipe(fs.createWriteStream('audio.out'));}else{track.discard();}});

License

MIT

About

Streaming MP4 demuxer for av.js

Resources

Stars

8 stars

Watchers

4 watching

Forks

Releases

Packages

Contributors

Languages