Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jhiesey/mp4-box-encoding
mp4 header reading and writing using the abstract-encoding interface
https://github.com/jhiesey/mp4-box-encoding
Last synced: 8 days ago
JSON representation
mp4 header reading and writing using the abstract-encoding interface
- Host: GitHub
- URL: https://github.com/jhiesey/mp4-box-encoding
- Owner: jhiesey
- License: mit
- Created: 2016-01-31T05:53:11.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2021-07-09T18:52:28.000Z (over 3 years ago)
- Last Synced: 2025-01-01T09:05:17.045Z (14 days ago)
- Language: JavaScript
- Size: 38.1 KB
- Stars: 49
- Watchers: 5
- Forks: 13
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-nodejs-pure-js - mp4-box-encoding - encoding interface (graphic (图形库))
README
[![abstract-encoding](https://img.shields.io/badge/abstract--encoding-compliant-brightgreen.svg?style=flat)](https://github.com/mafintosh/abstract-encoding)
# mp4-box-encoding
This module provides encoders and decoders with the
[abstract encoding](https://github.com/mafintosh/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:``` js
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](https://github.com/mafintosh/mp4-stream).
## License
MIT