I installed fluent-ffmpeg with npm install fluent-ffmpeg
and verified its present in the node-modules. There is no error if I include it in the server var ffmpeg = require('fluent-ffmpeg');
But when I use it to convert a .gif
file in the directory to .mp4
it throws an error : Error: Cannot find ffmpeg
My code :
var express = require('express');
var bodyParser = require('body-parser');
var app = express();
var ffmpeg = require('fluent-ffmpeg');
var proc = new ffmpeg({ source: '/uploads/myfile.gif' })
.usingPreset('podcast')
.saveToFile('/uploads/mynewfile.mp4', function(stdout, stderr) {
console.log('file has been converted succesfully');
});
What am I doing wrong? I want to convert the .gif
to .mp4