pydub no ffprobe found - python-3.x

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?

for some reason it works when changing the shell to zsh... switching back to bash no. not really happy with this solution but it's something

Related

why pyinstaller kepp throwing codesign failure while my script has been signied?

im on macbook old version El Capitan 10.11.6 and my python script is 147bytes just for auto shutdown program but when i try to boundle it pyinstaller filename.py it done almost everything and end up with (codesign failure). do someone know how to solve this?
Try the following command in your terminal, type: sudo codesign -f -s followed by your script name test.py Make sure you are in your script file directory by using cd path to your file folder.
After that, you can run pyinstaller test.py However, I am using macOS Monterey Version 12.6 and am not sure if it will work on your current version. In fact, I don't even know how that command makes it work, but it works for me. If your app is a windowed app, such as the Tkinter app, your system may prevent it from opening; in that case, use the following command to disable the security system sudo spctl --master-disable . then you will see a new option available in your macOS Settings under Security; down there it says Allow app from: App Store, App Store and identified developer; and at last, you will see a new option "Anywhere" which wasn't there before; check that, and your app will work perfectly. hope helped

Why does my .exe file stop responding after installing using pyinstaller -w filename.py but works fine if I just use pyinstaller filename.py?

I currently have a program that takes the user's microphone input and does something with it. I use tkinter and have all aspects of my program presented on the gui so that it doesn't run in the python shell upon execution.
When I install the program using pyinstaller, the executable file opens with the command prompt and works completely fine. When I install the program using pyinstaller -w, the executable opens and then fails to respond after calling for the user's input. I'm not sure if the user input is a factor but it is around that point in which the program stops responding.
I've tried including used packages in the hidden imports section of the .spec file but this didn't work.
I ultimately want to create an executable file that opens without the command prompt and runs normally, regardless of how I build it. (i.e. doesn't matter if it uses pyinstaller or not)
I'm sorry if this is a duplicate somewhere, I've searched for hours and haven't found a solution.
Note: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work
warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning) comes up each time I run the file but it doesn't seem to impact my program's execution.

Getting "Cannot find ffprobe error " when attempting to run nodejs script

I am attempting to use an npm package for splitting audio (https://github.com/calufornia/audio-split), however I am not able to run a single test since I get the following error on my callback:
Error: Cannot find ffprobe, I have read a bit and it seems that this is directly related to the npm package fluent_ffmpeg, which is actually a dependency of the first package I mentioned.
The problem on some other questions/forums is that people do not have properly installed ffmpeg on their environment. In my case however, I have made sure that my PATH is updated with the ffmpeg directory (C:\FFmpeg\bin for me), and I am able to open a command prompt and run both
ffmpeg -version
and
ffprobe -version
I would much appreciate if anyone else has struggled with this previously and could provide me with some more guidance. Thanks

Error: spawn EACCESS node-webkit ffmpeg with fluent-ffmpeg

I'm doing a nodewebkit app and trying to bundle ffmpeg inside so the user doesn't have to have ffmpeg installed on their system.
EACCESS has to do with rights running the code. I tried a chmod -R ug+rw ffmpegFolder to no avail.
I downloaded the osx binaries from here: https://evermeet.cx/ffmpeg/ I'm assuming these are compiled but I could be wrong?
I am bundling the extracted ffmpeg folder into the root of my .nw, which, extracted looks like this:
This part has to do with fluent-ffmpeg.
It has this method called setFfmpegPath(path) which tells fluent-ffmpeg to use a FFMPEG you provide.
I get the fs.realpath to ffmpeg-2.5.4 and use that.Using ./ffmpeg-2.5.4 or /ffmpeg-2.5.4 or ffmpeg-2.5.4 just gives a spawn ENOENT error which I've read, means not found.
If I remove setFfmepgPath from my fluent-ffmpeg command it works fine using my system ffmpeg.
I feel I'm on the right track with the spawn EACCESS error. How to make it play nice though?

F# on linux (mint/ubuntu) - dll path

This is a similar question to Running F# code with Mono but the solution there doesn't work for me, and I suspect I've got a slightly different problem.
I'm on linux mint petra (based on ubuntu saucy) and I've installed mono-complete and fsharp. Running it doesn't work:
$ fsharpi
/home/me/unknown(1,1): error FS0078: Unable to find the file 'FSharp.Core.dll' in any of
/usr/lib/mono/4.0
/home/me
/usr/lib/mono/4.0/
Which is not surprising, the file's in /usr/lib/cli/FSharp.Core-4.3. So let's try gacutil:
$ sudo gacutil -i /usr/lib/cli/FSharp.Core-4.3/FSharp.Core.dll
Installed /usr/lib/cli/FSharp.Core-4.3/FSharp.Core.dll into the gac (/usr/lib/mono/gac)
So mono and gacutil seem to disagree which paths to search! This is why I think I've got a different problem to the one referenced.
The command MONO_PATH=/usr/lib/cli/FSharp.Core-4.3/ fsharpi doesn't work either (it prints the same search paths as above).
How do I get F# up and running?

Resources