【问题标题】:Facing issues while taking thumbnail from video in NodeJS在 NodeJS 中从视频中获取缩略图时面临问题
【发布时间】:2020-12-08 21:40:17
【问题描述】:
 let thumbnail = `${req.file.filename.split('.')[0]}.png`
        await ffmpeg(path.join(__dirname, `../../public/uploads/posts/${req.file.filename}`))
            .screenshots({
                filename: `${thumbnail}`,
                folder: path.join(__dirname, `../../public/uploads/posts`),
                count: 1,
                size: '320x240'
            });

遇到这个问题

Error: Cannot find ffprobe
at C:\Users\user\Documents\projects\stitchlr_web\node_modules\fluent-ffmpeg\lib\ffprobe.js:145:31
at C:\Users\user\Documents\projects\stitchlr_web\node_modules\fluent-ffmpeg\lib\capabilities.js:194:9
at wrapper (C:\Users\user\Documents\projects\stitchlr_web\node_modules\async\dist\async.js:268:20)
at next (C:\Users\user\Documents\projects\stitchlr_web\node_modules\async\dist\async.js:4582:24)
at C:\Users\user\Documents\projects\stitchlr_web\node_modules\async\dist\async.js:321:20
at C:\Users\user\Documents\projects\stitchlr_web\node_modules\fluent-ffmpeg\lib\capabilities.js:186:13
at C:\Users\user\Documents\projects\stitchlr_web\node_modules\fluent-ffmpeg\lib\capabilities.js:123:9
at wrapper (C:\Users\user\Documents\projects\stitchlr_web\node_modules\async\dist\async.js:268:20)
at next (C:\Users\user\Documents\projects\stitchlr_web\node_modules\async\dist\async.js:4582:24)
at C:\Users\user\Documents\projects\stitchlr_web\node_modules\fluent-ffmpeg\lib\capabilities.js:116:11
at C:\Users\user\Documents\projects\stitchlr_web\node_modules\fluent-ffmpeg\lib\utils.js:223:16
at F (C:\Users\user\Documents\projects\stitchlr_web\node_modules\which\which.js:68:16)
at E (C:\Users\user\Documents\projects\stitchlr_web\node_modules\which\which.js:80:29)
at C:\Users\user\Documents\projects\stitchlr_web\node_modules\which\which.js:89:16
at C:\Users\user\Documents\projects\stitchlr_web\node_modules\isexe\index.js:42:5

在 FfmpegCommand 实例上发出“错误”事件: 在 runCommand (C:\Users\user\Documents\projects\stitchlr_web\node_modules\fluent-ffmpeg\lib\recipes.js:345:21) 在包装器处(C:\Users\user\Documents\projects\stitchlr_web\node_modules\async\dist\async.js:268:20) 在下一个(C:\Users\user\Documents\projects\stitchlr_web\node_modules\async\dist\async.js:4582:24) 在 C:\Users\user\Documents\projects\stitchlr_web\node_modules\async\dist\async.js:321:20 在 C:\Users\user\Documents\projects\stitchlr_web\node_modules\fluent-ffmpeg\lib\recipes.js:177:15 在 C:\Users\user\Documents\projects\stitchlr_web\node_modules\fluent-ffmpeg\lib\recipes.js:162:11 在 handleCallback (C:\Users\user\Documents\projects\stitchlr_web\node_modules\fluent-ffmpeg\lib\ffprobe.js:106:9) 在 C:\Users\user\Documents\projects\stitchlr_web\node_modules\fluent-ffmpeg\lib\ffprobe.js:145:16 在 C:\Users\user\Documents\projects\stitchlr_web\node_modules\fluent-ffmpeg\lib\capabilities.js:194:9 [...与原始堆栈跟踪匹配的行...] 在下一个(C:\Users\user\Documents\projects\stitchlr_web\node_modules\async\dist\async.js:4582:24)

【问题讨论】:

    标签: node.js express


    【解决方案1】:

    你还没有安装 ffmpeg。先安装ffmpeg

    【讨论】:

      猜你喜欢
      • 2018-01-13
      • 2020-06-26
      • 1970-01-01
      • 2018-11-06
      • 2013-08-31
      • 2017-10-21
      • 2011-05-25
      • 2011-10-19
      • 2013-07-22
      相关资源
      最近更新 更多