Skip to content
mp4 header reading and writing using the abstract-encoding interface
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore First commit Jan 31, 2016
LICENSE First commit Jan 31, 2016 First commit Jan 31, 2016
descriptor.js Replace buffer constructor with buffer-from and buffer-alloc (#2) Mar 23, 2018
index.js Move tfdt before trun Apr 20, 2018
package-lock.json 1.3.0 Jul 28, 2018
package.json 1.3.0 Jul 28, 2018



This module provides encoders and decoders with the abstract encoding interface.

The module exports the interface for a generic box, including all headers and children (for container boxes) Encodings for many leaf (non-container) boxes, without headers, is available keyed by the box type:

var box = require('mp4-box-encoding')

var buffer = fs.readFileSync('myvideo.mp4')
// decode any box including headers
// decode the entire moov box and its children
var moov = box.decode(buffer.slice(24, 236989))

var moov.mfhd.mtime = new Date() // Change the modification time

// now this is an encoding of the modified moov box
var moofBuffer = box.encode(moov)

// decode the contents of just the stts box
var stts = box.decode(buffer.slice(609, 625))

These encodings are factored out of mp4-stream.



You can’t perform that action at this time.