I have an app for MacOS that is compiled with py2app
. The app uses the pydub
module and the latter uses ffmpeg family package.
The problem is that once I compile the app and move it to a different OS, the subprocess
call from pydub
fails to find any of the ffmpeg
packages even though they are installed in /usr/local/bin
.
If I launch the app from terminal ./Nameapp.app/Contents/MacOs/Nameapp
then it runs no problem, but if I launch it with double click then pydub
complains not finding the packages and the app hangs where ffmpeg/ffprobe
should do the work.
I can see that pydub
searches in the /usr/local/bin
only if launched from terminal, otherwise no. If I add /usr/local/bin
to PATH
, pydub
doesnt complain anymore that it doesnt find ffmpeg/ffprobe, but it still gives me an error for both ffmpeg and ffprobe: [Errno 2] No such file or directory:
.
If I hardcode the path pydub.AudioSegment.converter = "/usr/local/bin/ffmpeg"
, the app gives me only ffprobe error [Errno 2] No such file or directory:'ffprobe': 'ffprobe'
.
On some other posts i've seen pydub.AudioSegment.ffprobe = "/path/to/ffprobe"
but it doesnt seem to work in my case?
So my two questions are:
How to hardcode the ffprobe path in pydub?
How to solve this without hardcoding path?