Reputation: 426
Situation:
Run mp3-to-video with fluent-ffmpeg and ffmpeg on windows and nodejs. command used to startup server: nodemon server.js When starting up, it executes mp3-to-video function. Then calls fluent-ffmpeg and i debugged it down to the line where fluent-ffmpeg cannot find my ffmpeg package. I did add a couple of system variables. FFMPEG_PATH is included, PATH is included, and all the different directories like ffmpeg\ and ffmpeg\lib\
I dont know what to do.. I get this error:
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
Upvotes: 39
Views: 49959
Reputation: 61
Try install the package by running
npm i @ffmpeg-installer/ffmpeg
Upvotes: 6
Reputation: 937
EvilBurrito saved the day on this one. Just wanted to add, make sure use this require:
const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path;
const ffmpeg = require('fluent-ffmpeg');
ffmpeg.setFfmpegPath(ffmpegPath);
Upvotes: 87
Reputation: 874
You could perhabs install this node module "ffmpeg-installer/ffmpeg". You can find it here: https://www.npmjs.com/package/@ffmpeg-installer/ffmpeg
It will install ffmpeg on your system and node should be able to use it immediately.
Hope this answer helps you and other people :-)
Upvotes: 50