pydub
pydub copied to clipboard
[Errno 2] No such file or directory: 'ffprobe': 'ffprobe'
Steps to reproduce
linux o/s installed my application under /Documents/ I don't want to install ffmpeg as I need to upload application to the cloud using Cloud Foundry I downloaded ffmpeg static binary and unpacked it under ./resources/ffmpeg In the code, I configured AudioSegment.converter = './resources/ffmpeg/ffmpeg' I tried including and excluding the executable I also tried defining the absolute path to the file
Expected behavior
Then I run audio = AudioSegment.from_mp3(filename)
Actual behavior
I get this error message: [Errno 2] No such file or directory: 'ffprobe': 'ffprobe'
It looks like it does not find the path to the executables
Your System configuration
- Python version: 3.7
- Pydub version: 0.23.1
- ffmpeg or avlib?: ffmpeg
- ffmpeg/avlib version: ffmpeg-4.1.4-i686-static.tar.xz
Is there an audio file you can include to help us reproduce?
You can include the audio file in this issue - just put it in a zip file and drag/drop the zip file into the github issue.
-
Are both the statically linked executables for
ffmpeg
andffprobe
present in your folder? -
By default pydub builds the command for
subprocess
assuming that those executables are present in yourPATH
. If your executables are not in aPATH
folder, then you'll have to add your resources folder to thePATH
environment variable before you launch your script. OverridingAudioSegment.converter
in your code won't probably work: there's some code in pydub that relies onconverter
being exactly "ffmpeg" or "avconv". Additionally, a relative path like that won't make it very robust if you launch your script from another folder.
did you solve this problem? I met the same issue, and if you get any approach, would you please share it with me? Thank you.
If you look at the logic to get the ffprobe
executable you'll notice that it simply relies on which
.
IMHO there are more robust and portable ways to get if an executable is present in PATH
(like for example exploring os.environ['PATH']
), but this should be irrelevant for the actual functionality if you run pydub on Linux/MacOS.
Make sure that the ffprobe
executable, which comes with ffmpeg
, is present somewhere in your PATH
. pydub will start working once it can find it.
If you look at the logic to get the
ffprobe
executable you'll notice that it simply relies onwhich
.IMHO there are more robust and portable ways to get if an executable is present in
PATH
(like for example exploringos.environ['PATH']
), but this should be irrelevant for the actual functionality if you run pydub on Linux/MacOS.Make sure that the
ffprobe` executable, which comes with
ffmpeg, is present somewhere in your
PATH`. pydub will start working once it can find it.
Thank you! It works for me, I fixed it with your approach.
Faced the same problem:
- OS - Ubuntu 22.04 LTS
- Python - 3.10
- Using Python's virtual environment.
To solve this, I created a symlink between the system's ffprobe
and python's virtual environment like below and it worked for me.
ln -s /path/to/ffprobe /path/to/your/virtualenv/bin/ffprobe
Faced the same problem:
1. OS - Ubuntu 22.04 LTS 2. Python - 3.10 3. Using Python's virtual environment.
To solve this, I created a symlink between the system's
ffprobe
and python's virtual environment like below and it worked for me.ln -s /path/to/ffprobe /path/to/your/virtualenv/bin/ffprobe
@Satendra-SR, thank you so much, it worked for me.