59de44955ebd / QMediaTool

A general purpose media conversion tool based on Python 3, PyQt5, SQLite 3 and FFmpeg (or yet another FFmpeg GUI)
MIT License
1 stars 1 forks source link

Linux support? #2

Closed Impeta closed 2 weeks ago

Impeta commented 3 weeks ago

Title says it all.

59de44955ebd commented 3 weeks ago

Well, bundling binaries with an application is hardly possible in Linux (given all the different flavors), but I just added basic Linux support to the master branch, so please pull the latest version. Attached screenshot shows QMediaTool running in Debian 12 (with Cinnamon desktop).

Usage in Debian/Ubuntu:

$ sudo apt install python3-pyqt5 atomicparsley ffmpeg mediainfo vlc yt-dlp
$ git clone https://github.com/59de44955ebd/QMediaTool.git # or git pull
$ cd QMediaTool
$ python3 main.py

debian12

59de44955ebd commented 3 weeks ago

FYI, this is the current main "hack" to make it run in Linux:

    def setup_tool_env_vars (self):
        if IS_LINUX:
            os.environ['ATOMICPARSLEY'] = 'AtomicParsley'
            os.environ['FFMPEG'] = 'ffmpeg'
            os.environ['FFMPEG_PROG'] = 'ffmpeg -hide_banner -progress tcp://localhost:9999 "$@"'
            os.environ['FFPLAY'] = 'ffplay'
            os.environ['FFPROBE'] = 'ffprobe'
            os.environ['MEDIAINFO'] = 'mediainfo'
            os.environ['MP4BOX'] = 'MP4Box'
            os.environ['VLC'] = 'cvlc'
            os.environ['YT-DLP'] = 'yt-dlp'
        else:
            ...

While in Windows and macOS all binaries found in resources/bin/win resp. resources/bin/macos are dynamically translated into env vars like $FFMPEG at runtime, in Linux those env vars are now hard-coded and default to the standard binary names without path, but of course you might also specify full pathes like '/usr/local/bin/mediainfo' etc. instead.

If you also want to use MP4Box (GPAC), you might either try to install this package: https://download.tsi.telecom-paristech.fr/gpac/release/2.4/gpac_2.4-rev0-g5d70253a-master_amd64.deb or have to compile it yourself.

59de44955ebd commented 2 weeks ago

pps: in the meantime I changed the Linux support, I removed those hard-coded tools in main.py gain, but instead there is now a new directory resources/bin/linux with subdirectories for each tool, and each subdirectory contains a minimal shell script that forwards to the actual binary, so e.g. for ffmpeg:

#!/bin/bash
/usr/bin/ffmpeg "$@"

For convenience there is now also a new shell script "QMediaTool" in the root folder, so you can start the app by simply running ./QMediaTool (provided you have Python3 and PyQt5 installed).