node.js - NodeJs - Fluent-FFMPEG 找不到 FFMPEG

标签 node.js

情况:

在 Windows 和 nodejs 上使用 fluent-ffmpeg 和 ffmpeg 运行 mp3-to-video。 用于启动服务器的命令:nodemon server.js 启动时,它执行 mp3-to-video 功能。然后调用 fluent-ffmpeg,我将其调试到 fluent-ffmpeg 找不到我的 ffmpeg 包的那一行。 我确实添加了几个系统变量。包括 FFMPEG_PATH,包括 PATH,以及所有不同的目录,如 ffmpeg\和 ffmpeg\lib\

不知道怎么办 我收到此错误:

Error: Cannot findd ffmpeg
    at C:\Users\lexha\Desktop\nodejs\node_modules\fluent-ffmpeg\lib\processor.js:136:22
    at C:\Users\lexha\Desktop\nodejs\node_modules\fluent-ffmpeg\lib\capabilities.js:123:9
    at C:\Users\lexha\Desktop\nodejs\node_modules\async\dist\async.js:421:16
    at next (C:\Users\lexha\Desktop\nodejs\node_modules\async\dist\async.js:5302:29)
    at C:\Users\lexha\Desktop\nodejs\node_modules\async\dist\async.js:906:16
    at C:\Users\lexha\Desktop\nodejs\node_modules\fluent-ffmpeg\lib\capabilities.js:116:11
    at C:\Users\lexha\Desktop\nodejs\node_modules\fluent-ffmpeg\lib\utils.js:223:16
    at F (C:\Users\lexha\Desktop\nodejs\node_modules\which\which.js:68:16)
    at E (C:\Users\lexha\Desktop\nodejs\node_modules\which\which.js:80:29)
    at C:\Users\lexha\Desktop\nodejs\node_modules\which\which.js:89:16

最佳答案

EvilBurrito 在这方面挽救了局面。 只是想添加,确保使用这个要求:

const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;
const ffmpeg = require('fluent-ffmpeg');
ffmpeg.setFfmpegPath(ffmpegPath);

关于node.js - NodeJs - Fluent-FFMPEG 找不到 FFMPEG,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45555960/

相关文章:

javascript - 如何一次导出所有常量?

javascript - 无法使用 Node.js 中的请求模块传输大尺寸文件

javascript - 在 node.js express 上使用中间件设置简单服务器时出错

html - 如何使用 jstransformer-scss 和 pug-cli 将 SCSS 嵌入到 Pugjs 模板中?

node.js - Firebase NodeJS管理SDK每次获取实时数据库路径的数据时都会下载数据

javascript - 解析javascript for循环,创建多个不重复的对象

javascript - 使用 Puppeteer 检查网站是否响应

ios - socket.io 官方客户端连接问题?

javascript - 我在哪里可以学习高级网络编程,特别是游戏开发方面的知识?

javascript - 使用 gulp-connect 插件在 gulp 中配置中间件