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

<class 'spleeter.SpleeterError'>, message: ffmpeg binary not found #546

Open
AnkitKundariya opened this issue Jan 1, 2021 · 18 comments
Open
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@AnkitKundariya
Copy link

AnkitKundariya commented Jan 1, 2021

from spleeter.separator import Separator

separator = Separator('spleeter:2stems')
separator.separate_to_file(temp_file, '/var/www/myproject/')

above code rise below error

<class 'spleeter.SpleeterError'>, message: ffmpeg binary not found

image

ffmpeg is installed correctly at /usr/bin/

spleeter version = 1.5.4
python version = 3.6.5
os : ubuntu 20.0.4
nginx + uwsgi

@AnkitKundariya AnkitKundariya added bug Something isn't working invalid This doesn't seem right labels Jan 1, 2021
@mmoussallam
Copy link
Collaborator

Hi @AnkitKundariya

This is weird since this error is raised after a call to the exact same command. Are you executing your python in a similar shell ?

@AnkitKundariya
Copy link
Author

AnkitKundariya commented Jan 5, 2021

@mmoussallam
when i try to do this in my python shell it's work fine, but same when i try to use with my flask app on a web server with nginx + uwsgi it's throwing me an error <class 'spleeter.SpleeterError'>, message: ffmpeg binary not found

if ffmpeg binary is not present the it should not work with Python shell too. but in our case it working in python shell but when we do this on webapp it's not working.

does spleeter require any special configuration?

i have tried to set FFMPEG_PATH in my server. but still no help.

@romi1502
Copy link
Member

romi1502 commented Jan 8, 2021

Hi @AnkitKundariya,
spleeter does not require any special configuration. ffmpeg needs to be installed in the shell where spleeter is run so you should make sure the directory where the ffmpeg binary is located is in the PATH of the shell your server is running in.

@AnkitKundariya
Copy link
Author

AnkitKundariya commented Jan 24, 2021

hi @romi1502

here i'm sharing list of executables path in my system.

image

where is my ffmpeg in system.
image

which ffmpeg.
image

@romi1502 please check all of the above items and please try to help me out if anything is wrong or misconfigured.

UWSGI LOG :
2021-01-24 06:31:59.277154: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 AVX512F FMA 2021-01-24 06:31:59.291768: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2294600000 Hz 2021-01-24 06:31:59.292326: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x555753b54500 initialized for platform Host (this does not guarantee that XLA will be used). Devices: 2021-01-24 06:31:59.292381: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version Error while processing file with spleeter : ffmpeg binary not found [pid: 170053|app: 0|req: 1/2] 106.213.254.187 () {44 vars in 762 bytes} [Sun Jan 24 06:31:59 2021] POST /api/file_upload => generated 83 bytes in 272 msecs (HTTP/1.1 200) 3 headers in 103 bytes (3 switches on core 0)

@romi1502
Copy link
Member

I can't see anything wrong in this configuration. ffmpeg seems to be properly installed and accessible.
But you said:

when i try to do this in my python shell it's work fine

So it seems that the environment where your flask server is run may not be the same. ffmpeg as to be accessible from it and it seems not to be.

@DanielHammerin
Copy link

Maybe you already solved it but I just ran sudo pkcon install ffmpeg in my terminal and then pip3 install ffmpeg in my project venv.
This gave me AttributeError: module 'ffmpeg' has no attribute '_run'
Which I found the solution to in this
Solution:

pip install ffmpeg-python
instead of
pip install ffmpeg

But wait. There's more.

I'm guessing this happens if you've installed both, ffmpeg and ffmpeg-python.
uninstall both with:
pip uninstall ffmpeg
pip uninstall ffmpeg-python
and install ffmpeg-python again with :
pip install ffmpeg-python
This solved the problem in my system :)

Now I have a working spleeter lib in my project.

@shahyashr
Copy link

I was stuck at the same step, eventually followed @DanielHammerin's answer.
But installed "ffmpeg" manually using the following wikihow link before installing "spleeter" using the PIP command.
https://www.wikihow.com/Install-FFmpeg-on-Windows

Then did the steps that @DanielHammerin mentioned viz. -
pip uninstall ffmpeg
pip uninstall ffmpeg-python
pip install ffmpeg-python

And voila, it worked. :)

@mantasu
Copy link

mantasu commented Sep 1, 2021

I think you also need to install ffmpeg with your package manager, e.g.:

sudo apt install ffmpeg

@Diego92Ita
Copy link

I was stuck at the same step, eventually followed @DanielHammerin's answer.
But installed "ffmpeg" manually using the following wikihow link before installing "spleeter" using the PIP command.
https://www.wikihow.com/Install-FFmpeg-on-Windows

Then did the steps that @DanielHammerin mentioned viz. -
pip uninstall ffmpeg
pip uninstall ffmpeg-python
pip install ffmpeg-python

And voila, it worked. :)

I've followed your steps but my spleeter doesn't work yet. It still says:
ERROR:spleeter:ffmpeg binary not found

@Diego92Ita
Copy link

I was stuck at the same step, eventually followed @DanielHammerin's answer.
But installed "ffmpeg" manually using the following wikihow link before installing "spleeter" using the PIP command.
https://www.wikihow.com/Install-FFmpeg-on-Windows
Then did the steps that @DanielHammerin mentioned viz. -
pip uninstall ffmpeg
pip uninstall ffmpeg-python
pip install ffmpeg-python
And voila, it worked. :)

I've followed your steps but my spleeter doesn't work yet. It still says:
ERROR:spleeter:ffmpeg binary not found

Ok, I've solved it. You have to make shure that ffmpeg is installed in the system evironmant variables. For Windows users just follow this tutorial: https://www.youtube.com/watch?v=qjtmgCb8NcE&ab_channel=LinuxLeech

@ayan0074
Copy link

no it dose not work for mee

@ayan0074
Copy link

I the whole process again from beginning , but the result is same "ERROR:spleeter:ffmpeg binary not found"
I stuck here ...............................

@walterjose4
Copy link

For Windows 10 users.

  1. download FFmpeg from: http://ffmpeg.org/download.html#build-windows
  2. extract the binaries: FFmpeg and FFprobe
  3. add the path to these binaries to environment variables
    image

@tikarammardi
Copy link

I got same issue on windows 11.
@Diego92Ita Solution doesn't worked for me although ffmpeg is install and I have pointed it the correct path. I was getting error of ModuleNotFoundError: No module named 'ffmpeg'
Solved by installing ffmpeg using pip3
pip3 install ffmpeg-python

@PiYuanZhouLv
Copy link

#672 (comment)
Here is the solution.

@neoconifer
Copy link

sudo apt install ffmpeg

works for me in Debian linux

@dhananroy
Copy link

in your service file for fastapi
please add ffmpeg environment
like
if your ffmpeg path = /usr/bin/ffmpeg
then add

Environment="PATH=/root/project/venv/bin:/usr/bin/ffmpeg"
restart daemon
restart fastapi services
100% working.

Thanks

@IMeeus
Copy link

IMeeus commented Dec 23, 2023

On windows:

  1. Install ffmpeg using this tutorial: https://www.youtube.com/watch?v=qjtmgCb8NcE&ab_channel=LinuxLeech
  2. pip uninstall ffmpeg
  3. pip install ffmpeg-python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests