spleeter icon indicating copy to clipboard operation
spleeter copied to clipboard

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

Open AnkitKundariya opened this issue 3 years ago • 18 comments

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 avatar Jan 01 '21 13:01 AnkitKundariya

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 ?

mmoussallam avatar Jan 04 '21 14:01 mmoussallam

@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.

AnkitKundariya avatar Jan 05 '21 05:01 AnkitKundariya

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.

romi1502 avatar Jan 08 '21 13:01 romi1502

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)

AnkitKundariya avatar Jan 24 '21 06:01 AnkitKundariya

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.

romi1502 avatar Jan 29 '21 10:01 romi1502

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.

DanielHammerin avatar Mar 31 '21 09:03 DanielHammerin

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. :)

shahyashr avatar Aug 21 '21 12:08 shahyashr

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

sudo apt install ffmpeg

mantasu avatar Sep 01 '21 08:09 mantasu

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 avatar Sep 02 '21 10:09 Diego92Ita

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

Diego92Ita avatar Sep 02 '21 10:09 Diego92Ita

no it dose not work for mee

ayan0074 avatar Sep 24 '21 08:09 ayan0074

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

ayan0074 avatar Sep 25 '21 14:09 ayan0074

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

walterjose4 avatar Nov 29 '21 03:11 walterjose4

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

tikarammardi avatar Dec 19 '21 13:12 tikarammardi

https://github.com/deezer/spleeter/issues/672#issuecomment-1162924661 Here is the solution.

PiYuanZhouLv avatar Jun 22 '22 10:06 PiYuanZhouLv

sudo apt install ffmpeg

works for me in Debian linux

neoconifer avatar Nov 01 '22 02:11 neoconifer

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

dhananroy avatar Feb 25 '23 04:02 dhananroy

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

IMeeus avatar Dec 23 '23 14:12 IMeeus