npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

mp4-box-encoding

1.3.0 • Public • Published

abstract-encoding

mp4-box-encoding

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.

License

MIT

install

npm i mp4-box-encoding

Downloadsweekly downloads

1,826

version

1.3.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability