A streaming MP4 demuxer in JavaScript, for av.js.
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();}});MIT