Skip to content

CrowdEmotion/node-mp4duration

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node MP4 Duration

node-mp4duration Dependency Status TravisCI Coveralls

A node.js package for parse mp4 duration.

Installation

$ npm install mp4duration

Usage

First you should require this package:

var mp4duration = require("mp4duration");

There're two API for you to parse your mp4 file duration:

  • parse(filename|buffer)
  • parseSync(filename|buffer, callback)

Each API can receive either String or Buffer. If you passed a String, it should be the filename of your mp4 file, otherwise, you should pass your MP4 file buffer.

Example

parse

var filename = "test/small.mp4";
var buff = fs.readFileSync(filename);
parser.parse(buff, function(err, d) { console.log(d); });
parser.parse(filename, function(err, d) { console.log(d); });

parseSync

var filename = "test/small.mp4";
var buff = fs.readFileSync(filename);
console.log(parser.parseSync(buff));
console.log(parser.parseSync(filename));

Contribute

You're welcome to make pull requests!

「雖然我覺得不怎麼可能有人會關注我」

About

A node.js package to parse mp4 file's duration.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 60.5%
  • JavaScript 24.9%
  • Python 9.6%
  • C 5.0%