0.0.1 • Published 7 years ago

node-mp4-parser v0.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

node-mp4-parser

Build Status npm Code Climate GitHub license

Node.js MP4 video parser

Installation

npm install node-mp4-parser

Usage

const fs = require('fs');
const Parser = require('node-mp4-parser');

fs.open('/path/to/file.mp4', 'r', function(fd) {
    try {
        let movie = Parser.parse(fd);
        // Work with movie
        // https://github.com/pipll/node-video-common#movie
        console.log('Duration:', movie.relativeDuration());
    } catch (ex) {
        console.error('Error:', ex);
    } finally {
        fs.close(fd);
    }
});