ERROR : “Cannot Find FFMPEG” on Google Cloud Compute Engine Debian Wheezy 7.8 Managed Instance even though it's installed

那年仲夏 提交于 2019-12-12 02:27:19

问题


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/'
  });
}

回答1:


Can you execute /usr/bin/ffmpeg from the shell to verify if it's the correct path?

Also you can set path to the FFMPEG binary manually with setFfmpegPath method.



来源:https://stackoverflow.com/questions/32817661/error-cannot-find-ffmpeg-on-google-cloud-compute-engine-debian-wheezy-7-8-ma

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!