UNPKG

mp4box

Version:

JavaScript version of GPAC's MP4Box tool

21 lines (20 loc) 694 B
BoxParser.createFullBoxCtor("mvhd", "MovieHeaderBox", function(stream) { if (this.version == 1) { this.creation_time = stream.readUint64(); this.modification_time = stream.readUint64(); this.timescale = stream.readUint32(); this.duration = stream.readUint64(); } else { this.creation_time = stream.readUint32(); this.modification_time = stream.readUint32(); this.timescale = stream.readUint32(); this.duration = stream.readUint32(); } this.rate = stream.readUint32(); this.volume = stream.readUint16()>>8; stream.readUint16(); stream.readUint32Array(2); this.matrix = stream.readUint32Array(9); stream.readUint32Array(6); this.next_track_id = stream.readUint32(); });