Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error happened: Cannot find ffmpeg #748

Closed
trevordowdle opened this issue Aug 27, 2017 · 12 comments
Closed

An error happened: Cannot find ffmpeg #748

trevordowdle opened this issue Aug 27, 2017 · 12 comments

Comments

@trevordowdle
Copy link

trevordowdle commented Aug 27, 2017

Version information

  • OS: Umbuntu 16.04

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
Copy link

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
Copy link
Author

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
Copy link

odykyi commented Feb 16, 2018

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
Copy link

djbritt commented Apr 6, 2018

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

@gclsoft
Copy link

gclsoft commented Nov 11, 2018

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
Copy link

gclsoft commented Nov 11, 2018

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

@977106024
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

jeffersonveloso commented Aug 14, 2023

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);```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests