I wrote a Node.JS application that uses the fluent-ffmpeg
module to watermark videos uploaded on the platform. I pushed the code to a my Google Cloud Compute Engine project, and every time I get Error : Cannot Find FFMPEG
. I ssh'd into the instance once it was created and ran these commands to install FFMPEG
before actually testing out the code. I am not sure what is causing the error because after this I am positive that FFMPEG
is installed.
sudo apt-get update
sudo apt-get install -y ffmpeg
export FFMPEG_PATH="/usr/bin/ffmpeg"
export FFPROBE_PATH="/usr/bin/ffprobe"
Below is my FFMPEG code
function generate_thumbnail(name, path){
logging.info("Generating Thumbnail");
ffmpeg(path)
.setFfmpegPath('/usr/bin/ffmpeg')
.setFfprobePath('/usr/bin/ffprobe')
.on('end', function() {
upload_thumbnail(name);
logging.info("Thumbnail Generated and uploaded");
return;
})
.on('error', function(err, stdout, stderr) {
logging.info('ERROR: ' + err.message);
logging.info('STDERR:' + stderr);
})
.on('start', function(commandLine) {
logging.info(commandLine);
})
.screenshots({
count: 1,
filename: name + '_thumbnail.png',
folder: 'public/images/thumbnails/'
});
}