使视频缩略图Firebase云功能

时间:2018-08-11 17:21:24

标签: firebase ffmpeg google-cloud-functions

我正在尝试在存储中上传视频时获取图像的缩略图。似乎无法正常工作,给我一个错误。

const tempThumbnailFilePath=path.join(os.tmpdir(), 'neew.jpg');
return bucket.file(thumbnailName).download({
     destination: tempThumbnail,
   }).then(()=>{
return spawn('ffmpeg', ['-ss', '0', '-i', tempThumbnail, '-f', 'image2', '-vframes', '1', '-vf', 'scale=512:-1', tempThumbnailFilePath], { capture: [ 'stdout', 'stderr' ]}).then((writeResult) => {
console.log('thumnail created');
  console.log('[spawn] stdout: ', writeResult.stdout.toString());
}).catch(function (err) {
        console.log('[spawn] stdout: ', err);
    });

我收到这样的错误

  

[spawn]标准输出:{错误:spawn ffmpeg ENOENT       在exports._errnoException(util.js:1020:11)

0 个答案:

没有答案