TagStudio icon indicating copy to clipboard operation
TagStudio copied to clipboard

[Bug]: Could Not Find FFmpeg Installation

Open myxxmikeyxx opened this issue 1 year ago • 13 comments

Checklist

  • [X] I am using an up-to-date version.
  • [X] I have read the documentation.
  • [X] I have searched existing issues.

TagStudio Version

Alpha 9.4.1

Operating System & Version

MacOS Sonoma 14.2.1

Description

I just updated my TagStudio after seeing it had a new release and reading the patches and additions. After that I am getting the error that it says FFmpeg is not installed. I clicked the help thinking maybe it will show a different way to install it. It does not. I have FFmpeg installed, see screen shot. I did install it from Homebrew like the help page says to do. For now I am hitting ignore but I am not sure what I am doing wrong. I can use ffmpeg command from terminal as well and get the version that way as well. I did tell brew to do updates thinking it was maybe and old version but still no luck. image

Expected Behavior

Launch TagStudio and not see the Warning of missing FFmpeg.

Steps to Reproduce

Install FFmpeg from Homebrew. (ffmpeg version 7.0.2 Copyright (c) 2000-2024 the FFmpeg developers) Install TagStudion 9.4.1 on MacOS Sonoma 14.2.1 (Intel) Lunch TagStudio (after accepting/allowing the security warning.) Wait and the Popup shows up.

Logs

No response

myxxmikeyxx avatar Sep 17 '24 17:09 myxxmikeyxx

Hi, sorry. Of course MacOS is the one OS that I couldn't/did not check... Does pressing ignore then opening a library containing a video or audio file display properly? (I.e; A thumbnail from video or the waveform of the audio file, not a generic video/music not icon) Would you be able to launch the program from the terminal and send the outputted log here? You may have to download the zip directly from the GitHub repo not the releases page (make sure to download the Alpha-v9.4 branch NOT main) What's the output of where ffmpeg and echo $PATH | grep ffmpeg?

seakrueger avatar Sep 17 '24 18:09 seakrueger

cc @NeedNot, looks like you have the same issue also ^

seakrueger avatar Sep 17 '24 18:09 seakrueger

@seakrueger Where is not installed on my mac, I am not sure how to install that. The second command echo $PATH | grep ffmpeg outputs nothing on my mac as well. When I run just echo $PATH I do get output but nothing containing ffmpeg or ffprobe (I saw on your code you check for both)

I tried downloading the Dev branch of 9.4 but I am not able to get it to launch, some weird TypeError. I do not code enough to know what to do to fix that. (Image below) I did try to run TagStudio app from terminal. open /Applications/TagStudio.app Sadly nothing showed up in the terminal. After looking around online I see I can do something like this if it helps open ./AppName.app --args -AppCommandLineArg

image

Sidenote: I did try downloading the dev branch and seeing if I could figure out what was going on. Found a different issue with the TagStudio.sh file. It doesn't check pip version. Not sure if this will fix the problem but here is my idea. Extra Info Here pip install -r requirements.txt || python3 -m pip install --upgrade pip && pip install -r requirements.txt

myxxmikeyxx avatar Sep 17 '24 19:09 myxxmikeyxx

@seakrueger I think I found the issue:

I was able to launch TagStudio 9.4 (and 9.4.1) from terminal after I updated my python version. (This appears to be part of the issue). I didn't realize I had python 3.9.12 installed but had used brew to install 3.12.6 but had not told brew to create symlinks (or it failed at that part) when I reran brew install [email protected] it told me to do --overwrite as well to create the symlinks. After that the zipped source code I opened, showed that I have FFmpeg installed.

I then ran the installed 9.4.1 App version and it still said I do not have FFmpeg installed. The build is suppose to have python and everything packaged into the program (or so I thought).

After all this here is my summary. The host machine has to have python version newer than 3.9.12 when trying to run the zip file. The precompiled package must be using an older version of python that the check FFmpeg works on but not on MacOS. Not sure if you can set the python version in the compiler but I am using 3.12.6 on my Mac and it is working for the Zip file.

myxxmikeyxx avatar Sep 17 '24 19:09 myxxmikeyxx

Hmm, it's interesting that the check passes when not bundled into a .app. Unfortunately, the windows exe ships with Python 3.12 and as far as I can tell so does the macOS app bundle, and that's the latest version the apps designed around

seakrueger avatar Sep 18 '24 11:09 seakrueger

I am not sure. I just tried to run the code to compile the program myself and that compiled version still gives me the error but when I run the ./TagStudio.sh to lunch it form terminal (not compiled) it works and I see this in the terminal:

[ResourceManager] 24 resources registered
[QT DRIVER] Config File not specified, defaulting to /Users/ultf/.config/TagStudio/TagStudio.ini
qt.qpa.fonts: Populating font family aliases took 131 ms. Replace uses of missing font family "Oxanium" with one that exists to avoid this cost. 
Calling NavForward with Content:False, Index:0, PageCount:0
[ENTRY PANEL] UPDATE WIDGETS ([])
/Volumes/Pegasus32 R8/Code Projects/FFmpeg Checker/TagStudio-9.4.1/tagstudio/src/qt/widgets/preview_panel.py:559: RuntimeError: Failed to disconnect (None) from signal "triggered()".
  self.delete_action.triggered.disconnect()
[FFmpegChecker] FFmpeg found: True, FFprobe found: True

Edit: I also tried ./Build_MacOS_app.sh and changed the command to python3.12 -m PyInstaller instead of python -m PyInstaller but still did not change anything but I did fine some errors in the code where directories are not always in quotes causing problems, created a small pull request to fix that. Pull Request #513

myxxmikeyxx avatar Sep 18 '24 13:09 myxxmikeyxx

@seakrueger Whats even crazier is that in the dist folder it has a TagStudio folder and inside that it has a TagStudio Unix Executable file and when I run that and watch the Terminal it works and it shows that is found FFmpeg & FFprobe. I go a couple folders deep and check the Python Version and it is showing Python 3.12 in the versions. Maybe this is a PyInstaller problem... I really am not sure now.

myxxmikeyxx avatar Sep 18 '24 14:09 myxxmikeyxx

On the provided v9.4.1 release,

  1. Can you if thumbnails are working if you ignore the warning (i.e; A thumbnail from video or the waveform of the audio file, not a generic video/music not icon)
  2. Can you add the ffmpeg dir path to your PATH variable (which ffmpeg copy the output up to /bin, the export PATH=".:$PATH:/path/to/bin") then see if the check passes

seakrueger avatar Sep 18 '24 14:09 seakrueger

image

This is what I see and the preview window on the right is not showing anything just a black window. I did which ffmpeg and export and restarted TagStudio, still no luck. I ran echo $PATH | grep ffmpeg to confirm it was in the PATH, it is.

.:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/usr/local/go/bin:/usr/local/bin/ffmpeg 

I am going to try a reboot and will edit this comment.

Edit: No Luck :( Reboot did not change anything.

myxxmikeyxx avatar Sep 18 '24 14:09 myxxmikeyxx

@seakrueger Any other ideas? I am not sure why it works with the Zip but not the compiled, but worked with the Unix Executable File when ran from terminal and shows [FFmpegChecker] FFmpeg found: True, FFprobe found: True

myxxmikeyxx avatar Sep 25 '24 12:09 myxxmikeyxx

I dont think macOS applications are taking $PATH into consideration. That's why it's behaving different when you run it from shell (yes $PATH) vs when you run it from GUI (no $PATH).

The solution/workaround code be to either bundle ffmpeg into the app via the parameter PyInstaller provides (not sure that's a good idea), or slightly better approach would be to hardcode a few paths where ffmpeg binary is usually located, and try one after another if it will be found.

There could be also a configuration window where user can set the ffmpeg path themselves.

yedpodtrzitko avatar Sep 25 '24 13:09 yedpodtrzitko

the actual paths which "GUI applications" take into consideration are located in /etc/paths

yedpodtrzitko avatar Sep 25 '24 13:09 yedpodtrzitko

Odd note is that echo $PATH | grep ffmpeg does not have ffmpeg in it any more, but it is installed, I can still run ffmpgeg from terminal and it works. I also ran cat /etc/paths and got

/usr/local/bin
/System/Cryptexes/App/usr/bin
/usr/bin
/bin
/usr/sbin
/sbin

Not sure what else to do, besides like you said to bundle it.

myxxmikeyxx avatar Oct 01 '24 17:10 myxxmikeyxx

This seems to be fixed if the pull request for #557 is merged.

myxxmikeyxx avatar Oct 21 '24 18:10 myxxmikeyxx