Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FFmpeg Not Found Fix - Alpha v9.4 #557

Closed
wants to merge 5 commits into from

Conversation

myxxmikeyxx
Copy link

Updated PySide6 (Qt) and Pillow and PyInstaller.
This update seems to fix the FFmpeg not found.

Changed the version to 6.7.0 because it is marked as a fixed version for the but where it says:
```No QtMultimedia backends found. Only QMediaDevices, QAudioDevice, QSoundEffect, QAudioSink, and QAudioSource are available.
Failed to create QVideoSink "Not available"
Failed to initialize QMediaPlayer "Not available"
```
Bug Report is attached below and the change log from 6.7.0 -> 6.7.1 is listed. two CVE's were listed but they are not directly used by QT and only used if the developer is using them. I did not check to see if the code contains, but since you are trying to use sqlite DB and are not networking this should be in the clear.

https://bugreports.qt.io/browse/PYSIDE-2656
https://code.qt.io/cgit/qt/qtreleasenotes.git/about/qt/6.7.1/release-note.md
https://forum.qt.io/topic/157026/no-qtmultimedia-backends-found-on-macos-with-pyside-6-7-1
Added Quotes around more of the directory fields. Found this error because I have a space in the name of my external drive where I was trying to build this.
Quality of life change, added new line to the End of Transmission
Updated Pyinstaller to 6.11.0
Updated PySide6 (Qt) to 6.8.0.1
When compiled FFmpeg Checker worked for Mac in both versions.
FFmpegChecker] FFmpeg found: True, FFprobe found: True
@myxxmikeyxx
Copy link
Author

Also added quotations to the Build_MacOS_app.sh file due to directory problems if spaces exist.

@myxxmikeyxx myxxmikeyxx changed the title Alpha v9.4 FFmpeg Not Found Fix - Alpha v9.4 Oct 21, 2024
@CyanVoxel CyanVoxel added Type: Bug Something isn't working as intended Priority: High An important issue requiring attention labels Oct 26, 2024
@seakrueger
Copy link
Collaborator

Just to confirm, sorry, were you able to successfully build an .app bundle with the ffmpeg check passing?
If I had to guess, the fix is most likely from updating PyInstaller (though I don't see any bugfix in the changelog). If possible, could you test with just updating PyInstaller? Updating Qt (Pyside) usually breaks some stuff

@CyanVoxel CyanVoxel added the Status: Review Needed A review of this is needed label Nov 4, 2024
@myxxmikeyxx
Copy link
Author

@seakrueger I will try that and let you know if it works with just the updated pyinstaller.

@myxxmikeyxx
Copy link
Author

Same problem as before. It works when I run it from TagStudio.sh. Also it works when when running the exec file but the compiled .app does not work. Still shows that it can't find FFMPEG.

@myxxmikeyxx
Copy link
Author

myxxmikeyxx commented Nov 7, 2024

I also forgot I had to edit the Build_MacOS_app.sh so when I first tried to build it, it failed. Had to look back and grab my old one. As mentioned before I am on Intel Mac not M1 (or up) and using bash not zsh.

Bellow is the code for the build_macos_app.sh to work (not sure if this can get added to the next release or not)
Parts that were changed:

  • if [ ! -d $LOGS_PATH ]; then -> if [[ ! -d $LOGS_PATH ]]; then
  • The if check kept failing and I found this and changed it and it works. Link Here
  • mkdir -p $LOGS_PATH; -> mkdir -p "$LOGS_PATH";
  • Added Quotes because if the directory has a space in the name it fails at making it.
  • open $DIST_PATH-> open "$DIST_PATH"
  • Same reason as above, if the directory has a space it fails to open.
  • printf -- "🏁 END OF TRANSMISSION" -> printf -- "🏁 END OF TRANSMISSION\n"
  • Just a quality of life change, otherwise the next line in terminal is attached to it
  • Example: 🏁 END OF TRANSMISSION Project-Mac-Pro:TagStudio-9.4.1 myxxmikeyxx$
  • Fixed:
🏁 END OF TRANSMISSION 
Project-Mac-Pro:TagStudio-9.4.1 myxxmikeyxx$ 
#! /usr/bin/env bash
# GETTING BASE DIR
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

# SETTING UP CONSTANTS
TAGSTUDIO_NAME="TagStudio"
TAGSTUDIO_DIR="$SCRIPT_DIR/tagstudio"
TAGSTUDIO_DIR_RESOURCES="$TAGSTUDIO_DIR/resources"
TAGSTUDIO_ICON="$TAGSTUDIO_DIR/resources/icon.ico"
TAGSTUDIO_SRC="$TAGSTUDIO_DIR/src"
TAGSTUDIO_MAIN="$TAGSTUDIO_DIR/tag_studio.py"
DIST_PATH="$SCRIPT_DIR/dist"
BUILD_PATH="$SCRIPT_DIR/build"
LOGS_PATH="$BUILD_PATH/logs"

printf -- "🏁 Starting Script \n"

# CREATE VENV AND INSTALL REQUIREMENTS
printf -- "🐍 Creating Python virtual env\n"
python3 -m venv .venv 
source .venv/bin/activate

if [[ ! -d $LOGS_PATH ]]; then
  printf -- "📁 Creating Logs folder\n"
  mkdir -p "$LOGS_PATH";
fi

printf -- "💻 Installing Requirements \n"
pip install -r requirements.txt > "$LOGS_PATH/pip.log" 2>&1
pip install PyInstaller > "$LOGS_PATH/pip.log" 2>&1


if [[ "$OSTYPE" == "darwin"* ]]; then
    printf -- "🍏 MacOS Detected \n"
    SYS_CMD="--windowed"
    OS=0
fi

SECONDS=0

# CREATE COMMAND 
printf -- "⏳ Building App \n"

COMMAND=$( python -m PyInstaller \
  --name "$TAGSTUDIO_NAME" \
  --icon "$TAGSTUDIO_ICON" \
  --add-data "$TAGSTUDIO_DIR_RESOURCES:./resources" \
  --add-data "$TAGSTUDIO_SRC:./src" \
  --distpath "$DIST_PATH" \
  -p "$TAGSTUDIO_DIR" \
  --noconsole \
  --workpath "$BUILD_PATH" \
  -y "$SYS_CMD" "$TAGSTUDIO_MAIN" \
  > "$LOGS_PATH/pyinstaller.log" 2>&1 )

duration=$SECONDS

if $COMMAND; then
  printf -- "✅ Build Successfull \n"
  printf -- "⌛ $((duration)) seconds of build\n"
    if [[ "$OS" == 0 ]]; then
      printf -- "📁 Opening App folder \n"
      open "$DIST_PATH"
    fi 
else
    printf -- "❌ Error Building the app\nPlease read the logs\navailable at build/logs\n"
fi

printf -- "🏁 END OF TRANSMISSION\n"

@myxxmikeyxx
Copy link
Author

Not sure what changed besides restarting the mac but the compiled version no longer can find ffmpeg either. Not sure what else I would have done but it is no longer found in the updated package compiled version.

@CyanVoxel CyanVoxel self-assigned this Nov 13, 2024
@CyanVoxel
Copy link
Member

So from what I understand, does the new PySide version not fix FFmpeg not being found after all?

@myxxmikeyxx
Copy link
Author

I was not. @CyanVoxel

@CyanVoxel CyanVoxel added Status: Help Wanted Extra attention is needed and removed Priority: High An important issue requiring attention Status: Review Needed A review of this is needed labels Nov 29, 2024
@CyanVoxel CyanVoxel added Status: Blocked This issue or pull request is awaiting the outcome of another issue or pull request Type: Installation Installing, building, and/or launching the program and removed Status: Help Wanted Extra attention is needed labels Dec 5, 2024
@CyanVoxel
Copy link
Member

#511 has now been fixed in #629

@CyanVoxel CyanVoxel closed this Dec 9, 2024
@CyanVoxel CyanVoxel removed the Status: Blocked This issue or pull request is awaiting the outcome of another issue or pull request label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working as intended Type: Installation Installing, building, and/or launching the program
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants