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

QMediaTool

A general purpose media conversion tool based on Python 3, PyQt5, SQLite 3 and FFmpeg.

Setup and run from sources

I decided to remove all binaries from this repository, instead those now come from external platform-specific repositories.

Windows

https://github.com/59de44955ebd/QMediaTool.git
cd QMediaTool
git clone https://github.com/59de44955ebd/QMediaTool-bin-win.git resources/bin/win
QMediaTool.cmd # or: python main.py

macOS

https://github.com/59de44955ebd/QMediaTool.git
cd QMediaTool
git clone https://github.com/59de44955ebd/QMediaTool-bin-macos.git resources/bin/macos
./QMediaTool # or: python3 main.py

Linux

https://github.com/59de44955ebd/QMediaTool.git
cd QMediaTool
git clone https://github.com/59de44955ebd/QMediaTool-bin-linux.git resources/bin/linux
./QMediaTool # or: python3 main.py

In Linux no actual binaries are bundled with the application, "QMediaTool-bin-linux" only contains dummy shell scripts. You have to install the actual binaries yourself, e.g. in Debian/Ubuntu by running:

# note: gpac (MP4Box) is only available in Ubuntu, in Debian you have to compile it yourself
sudo apt install ffmpeg atomicparsley mediainfo vlc yt-dlp gpac

Screenshots

QMediaTool in Windows 11

QMediaTool in macOS 13

QMediaTool in Linux (Debian 12/Cinnamon)

Usage

Presets and Tasks

QMediaTool is basically a database for your favorite ffmpeg command lines, which are called "presets" in the app. Presets can be organized under arbitrary categories, the predefined categories and presets are just an offer, and you might as well delete or rename them as desired and use your own ones.

You can add new presets and categories via app menu, existing presets and categories can be changed or deleted via context menu in the "Presets" pane.

Presets are templates for actual tasks, and a preset is loaded into the "Task Editor" by double-clicking its name in the "Presets" pane.

Presets/tasks can either have just a single or multiple lines of code. Task code is always executed with Bash, both in macOS and Windows. The Bash shell for Windows is based on MSYS, in addition to the predefined Bash commands also the following commands can be used: basename, cat, cp, cygpath, dirname, env, find, grep, kill, ls, mkdir, mv, rm, rmdir, sleep, sort, tee.

You can edit a task's code (loaded from a preset) at runtime before executing it, and e.g. adjust/add/remove parameters etc. There are also GUI widgets for some basic FFmpeg parameters, so you can either use those to adjust values (which are then provided to the task as environment variables, see below) or by typing them into the code field.

Presets can have 0, 1 or multiple files or a URL as input, input files can be added by dropping them into the app window.

Environment variables

When a selected preset is executed as task, in addition to the system's default variables the following environment variables are provided:

General variables:

Single input file mode:

Input url mode:

Multiple input files mode:

Provided/included binaries

In adition to ffmpeg, the following binaries are included both for macOS and Windows:

Those tools are just an offer, you might as well remove them and instead add others. To add a new tool - either a binary or a shell script - called toolname (or toolname.exe), create a new folder called toolname in resources\bin\win\ (Windows) or QMediaTool.app/Contents/Resources/bin/macos/ (macOS) and put it into this folder. After restarting QMediaTool, you can reference it in presets/tasks using variable $TOOLNAME (all upper case).

If you prefer to use your system's/a pre-installed version of ffmpeg instead of the provided binary, you can rename or delete the provided binary in resources\bin\win\ffmpeg\ (Windows) or QMediaTool.app/Contents/Resources/bin/macos/ffmpeg, and instead put a single line shell script called "ffmpeg" into this folder which might look like this:

/usr/local/bin/ffmpeg "$@"

Or, in Windows:

D:/bin/ffmpeg.exe "$@"

Or if ffmpeg can be found in the system path, just:

ffmpeg "$@"

Of course this approach also works for the other provided binaries.