NodeJs - Fluent-FFMPEG cannot find FFMPEG

Situation:

Run mp3-to-video with fluent-ffmpeg and ffmpeg on windows and nodejs. the command used to start the server is: nodemon server.js When started, it performs the mp3-to-video function. Then it calls fluent-ffmpeg and I debugged it down to the line where fluent-ffmpeg can't find my ffmpeg package. I added some system variables. FFMPEG_PATH is on, PATH is on, and all different directories like ffmpeg \ and ffmpeg \ lib \

I do not know what to do. I am getting 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

      

+6


source to share


2 answers


You can 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 use it right away.



Hope this answer helps you and other people :-)

+12


source


EvilBurrito saved the day. Just wanted to add, be sure to use this require:



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

0


source







All Articles