ffprobe
Use ffprobe to get info from media files and return as JSON

Installation
This module is installed via npm:
$ npm install ffprobe
Example Usage
ffprobe
is a dual API, supporting both node.js callbacks AND Promise
s.
Callback API
List the output of ffprobe for a media file in a convenient JSON format:
var ffprobe = require('ffprobe'),
ffprobeStatic = require('ffprobe-static');
ffprobe('./file.mp4', { path: ffprobeStatic.path }, function (err, info) {
if (err) return done(err);
console.log(info);
});
Promise API
List the output of ffprobe for a media file in a convenient JSON format:
var ffprobe = require('ffprobe'),
ffprobeStatic = require('ffprobe-static');
ffprobe('./file.mp4', { path: ffprobeStatic.path })
.then(function (info) {
console.log(info);
})
.catch(function (err) {
console.error(err);
})
});
API
ffprobe(mediaFilePath, opts, [cb])
mediaFilePath
- path to your audio / video / image that you want to get media
info for.opts
- options object with the following options:
path
- path to ffprobe binary (You can use
ffprobe-static
to easily get
a static binary that you can install with npm.
cb(err, info)
- standard callback, with the info returned as a javascript
object. NB: If the cb
parameter is not provided, a Promise
will be returned
allowing chained then()
, catch()
methods.