【发布时间】: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)
【问题讨论】: