fluent-ffmpeg / node-fluent-ffmpeg

A fluent API to FFMPEG (http://www.ffmpeg.org)
MIT License
7.93k stars 880 forks source link

An error happened: Cannot find ffmpeg #748

Closed trevordowdle closed 7 years ago

trevordowdle commented 7 years ago

Version information

I Installed ffmpeg on the server, however, I get the following message: Cannot find ffmpeg

Expected results

To be able run and use ffmpeg on the server

Observed results

Can't find or doesn't recognize that ffmpeg is installed.

If I SSH into the server I can run the ffmpeg command, so I know it's installed on the server, what do I need to do in order to get fluent-ffmpeg to run it?

Thanks

positlabs commented 7 years ago

This probably isn't an issue related to fluent-ffmpeg.

  1. Does the process that is trying to run ffmpeg have permission to run the executable?
  2. Is the executable on the PATH of the user trying to run it?

To debug, you can run which ffmpeg and it will output the location of the executable, if it's on the PATH (I'm guessing it's not).

If it's a permissions error, you can grant permission to the user via the chmod command.

If it's a PATH error, then you can add it to the PATH for that user.

You can also try manually setting the path to ffmpeg like this: fluentFfmpeg.setFfmpegPath(ffmpegPath)

trevordowdle commented 7 years ago

Thank you for your input, I you are correct on that the issue is not related to fluent-ffmpeg, I am using MUP to deploy my meteor app which uses a docker image. And so unless ffmpeg is installed on the docker image I can't access it.

odykyi commented 6 years ago

npm dependencies

"dependencies": {
    "@ffmpeg-installer/ffmpeg": "^1.0.13",
    "fluent-ffmpeg": "^2.1.2"

  },

const ffmpegInstaller = require('@ffmpeg-installer/ffmpeg');
const ffmpeg = require('fluent-ffmpeg');

ffmpeg.setFfmpegPath(ffmpegInstaller.path);
// console.log(ffmpegInstaller.path, ffmpegInstaller.version);

module.exports = ffmpeg;
djbritt commented 6 years ago

You're the best. Was having trouble getting this working on an Elastic Beanstalk nodjs web server, and it works great.

gclsoft commented 6 years ago
const ffmpegInstaller = require('@ffmpeg-installer/ffmpeg');
const ffmpeg = require('fluent-ffmpeg');

ffmpeg.setFfmpegPath(ffmpegInstaller.path);
// console.log(ffmpegInstaller.path, ffmpegInstaller.version);

module.exports = ffmpeg;

Does these code must write?

gclsoft commented 6 years ago

It doesn't work @odykyi on electron windows app.

977106024 commented 5 years ago

npm依赖项

"dependencies": {
    "@ffmpeg-installer/ffmpeg": "^1.0.13",
    "fluent-ffmpeg": "^2.1.2"

  },

const ffmpegInstaller = require('@ffmpeg-installer/ffmpeg');
const ffmpeg = require('fluent-ffmpeg');

ffmpeg.setFfmpegPath(ffmpegInstaller.path);
// console.log(ffmpegInstaller.path, ffmpegInstaller.version);

module.exports = ffmpeg;

牛批大神,语音格式转换的资料我找了一下午,你这代码复制粘贴就成功转换了,膜拜!!!

tanerozel commented 4 years ago

npm dependencies

"dependencies": {
    "@ffmpeg-installer/ffmpeg": "^1.0.13",
    "fluent-ffmpeg": "^2.1.2"

  },

const ffmpegInstaller = require('@ffmpeg-installer/ffmpeg');
const ffmpeg = require('fluent-ffmpeg');

ffmpeg.setFfmpegPath(ffmpegInstaller.path);
// console.log(ffmpegInstaller.path, ffmpegInstaller.version);

module.exports = ffmpeg;

thank you , it is work

ConquerStars commented 4 years ago

npm dependencies

"dependencies": {
    "@ffmpeg-installer/ffmpeg": "^1.0.13",
    "fluent-ffmpeg": "^2.1.2"

  },

const ffmpegInstaller = require('@ffmpeg-installer/ffmpeg');
const ffmpeg = require('fluent-ffmpeg');

ffmpeg.setFfmpegPath(ffmpegInstaller.path);
// console.log(ffmpegInstaller.path, ffmpegInstaller.version);

module.exports = ffmpeg;

thank you so much, it is work

Romick2005 commented 3 years ago

It seems that ffmpeg-static is a better way to go as it supports darwin-arm64 (apple silicon M1).

const ffmpeg = require("fluent-ffmpeg");
const pathToFfmpeg = require("ffmpeg-static");

ffmpeg.setFfmpegPath(pathToFfmpeg);
melody4482 commented 1 year ago

I have the same error. What should I change? This is my code

  ffmpeg(`${process.env.UPLOAD_DIR}/${req.file?.originalname}`)
  .toFormat('mp3')
  .saveToFile(`${process.env.UPLOAD_DIR}/${uuidv4()}-${req.file?.originalname}`)
  .on('error', (err) => {
    console.error(err);
  })
  .on('progress', (progress) => {
    console.log('...frames ' + progress.frames);
  })
  .on('end', () => {
    console.log("finished processing");
  });
jeffersonveloso commented 1 year ago

I have the same problem and this solution not work for me.


import ffmpeg from "@ffmpeg-installer/ffmpeg";
import stream from "stream";
ffmpegFluent.setFfmpegPath(ffmpeg.path);```