js-ffmpeg
This is a simple wrapper for FFMPEG and FFPROBE.
Getting Started
git clone https:
npm install
grunt
Basic Usage
ffmpeg = require('js-ffmpeg');
ffmpeg.ffprobe('video.mp4').success(function (json) {
console.log(json);
}).error(function (error) {
console.log(error);
});
ffmpeg.ffprobe_simple('video.mp4').success(function (json) {
console.log(json);
}).error(function (error) {
console.log(error);
});
ffmpeg.ffmpeg('video.mp4', [...], 'output.mp4', function (progress) {
console.log(progress);
}).success(function (json) {
console.log(json);
}).error(function (error) {
console.log(error);
});
ffmpeg.ffmpeg_simple('video.mp4', {
width: 640,
height: 360,
auto_rotate: true,
ratio_strategy: "fixed",
shrink_strategy: "crop",
mixed_strategy: "crop-pad",
stretch_strategy: "pad"
}, 'output.mp4', function (progress) {
console.log(progress);
}).success(function (json) {
console.log(json);
}).error(function (error) {
console.log(error);
});
Contributors
License
Apache-2.0