jiaaro / pydub

Manipulate audio with a simple and easy high level interface
http://pydub.com
MIT License
8.76k stars 1.03k forks source link

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

Open fantess opened 5 years ago

fantess commented 5 years ago

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

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.

blacklight commented 5 years ago
  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.

frozamilan1899 commented 4 years ago

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.

blacklight commented 4 years ago

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.

frozamilan1899 commented 4 years ago

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 yourPATH`. pydub will start working once it can find it.

Thank you! It works for me, I fixed it with your approach.

Satendra-SR commented 8 months ago

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
bjmeo8 commented 8 months ago

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.