错误:在Google云计算引擎Debian Wheezy 7.8托管实例上“无法找到FFMPEG”,即使已安装

时间:2015-09-28 07:23:46

标签: node.js ffmpeg debian google-compute-engine

我编写了一个Node.JS应用程序,该应用程序使用fluent-ffmpeg模块为平台上传的视频添加水印。我将代码推送到了我的Google Cloud Compute Engine项目,每次我都获得Error : Cannot Find FFMPEG。我在创建实例后ssh进入实例并运行这些命令以在实际测试代码之前安装FFMPEG。我不确定是什么导致了错误,因为在此之后我肯定安装了FFMPEG

sudo apt-get update
sudo apt-get install -y ffmpeg
export FFMPEG_PATH="/usr/bin/ffmpeg"
export FFPROBE_PATH="/usr/bin/ffprobe"

以下是我的FFMPEG代码

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 个答案:

答案 0 :(得分:1)

您是否可以从shell执行/usr/bin/ffmpeg以验证它是否是正确的路径?

您也可以使用setFfmpegPath方法手动设置FFMPEG二进制文件的路径。

相关问题