When we are using python pydub to convert audio files, we may get this error: Couldn’t find ffmpeg or avconv. In this tutorial, we will introduce you how to do.
Pydub will use os.environ[“PATH”] to find ffprobe.exe and ffmpeg.exe.
In order to install ffprobe.exe or ffmpeg.exe, you can read this tutorial:
How to fix this error?
The simplest way is to add the installation path of ffmpeg.exe to your compute environment variable. However, if you do not want to add, you can fix this error manually.
For example, if the installation path of ffmpeg.exe is: D:\ffmpeg\bin, we can add it as follows:
Then this error can fixed.
However, we also have to edit other source code to make ffprobe.exe and ffmpeg.exe can be called by python Popen.
For example: in utils.py
The aim is to make pydub can use subprocess.Popen() to call D:\ffmpeg\bin\ffprobe.exe and D:\ffmpeg\bin\ffmpeg.exe.
Then, you can find this error is fixed.