1.0.2 • Published 9 years ago
bpp v1.0.2
bits-per-pixel
A little module that outputs a video file's bits-per-pixel value, i.e.:
video_bitrate / (video_height video_width video_fps)
How?
This module depends upon FFmpeg. Any recent version should do.
Installation
$ npm install bppUsage
const bpp = require('bpp');
bpp.calculate('/path/to/video.mp4', (result) => {
console.log(result);
});API
bpp.calculate(filePath, callback)
Calculates the bpp, or bits-per-pixel for a video at a given file path.
It returns an instance of a Promise that is rejected when an error occurs, or
resolved with the results of the calculate() function.
The calculate() function calls the given callback() function with the results
as the second argument, if given. If an error occurs, the callback() function,
if given, is called with the error as the first argument with undefined results.
filePathrequired - The file path for a video to calculate the bppcallbackoptionatl - The callback function called with results or when an error occurs.
License
TBA