pydub icon indicating copy to clipboard operation
pydub copied to clipboard

[Errno 2] No such file or directory: 'ffprobe': 'ffprobe'

Open fantess opened this issue 5 years ago • 6 comments

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.

fantess avatar Jul 12 '19 08:07 fantess

  1. Are both the statically linked executables for ffmpeg and ffprobe present in your folder?

  2. By default pydub builds the command for subprocess assuming that those executables are present in your PATH. If your executables are not in a PATH folder, then you'll have to add your resources folder to the PATH environment variable before you launch your script. Overriding AudioSegment.converter in your code won't probably work: there's some code in pydub that relies on converter 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.

blacklight avatar Jul 23 '19 14:07 blacklight

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.

frozamilan1899 avatar Aug 24 '20 02:08 frozamilan1899

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.

blacklight avatar Aug 24 '20 13:08 blacklight

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 withffmpeg, 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.

frozamilan1899 avatar Aug 25 '20 07:08 frozamilan1899

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 avatar Dec 22 '23 14:12 Satendra-SR

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.

bjmeo8 avatar Dec 31 '23 11:12 bjmeo8