zaps166 / QMPlay2

QMPlay2 is a video and audio player which can play most formats and codecs.
GNU Lesser General Public License v3.0
812 stars 170 forks source link
audio-player c-plus-plus cmake ffmpeg hardware-acceleration linux multimedia-keys multiplatform qt5 video video-filtering video-player vulkan

QMPlay2 - Qt Media Player 2

Screenshot

QMPlay2 is a video and audio player. It can play all formats supported by FFmpeg, libmodplug (including J2B and SFX). It also supports Audio CD, raw files, Rayman 2 music and chiptunes. It contains YouTube and MyFreeMP3 browser.

Table of Contents

Installation

Easy installation on Windows

Easy installation on Linux (AppImage)

Easy installation on Arch Linux / Manjaro Linux

Easy installation on openSUSE

Easy installation on Gentoo Linux

YouTube

You can change the default audio and video quality of YouTube contents. Click on the "Settings" icon on the left of the search bar, change the order of audio and/or video quality priorities and apply changes. If the chosen quality can't be found on YouTube content, QMPlay2 will try using the next entry on the quality list.

YouTube videos don't work without external "yt-dlp" software, so QMPlay2 will download it automatically. You can remove downloaded "yt-dlp" from settings.

Windows

Spherical view

QMPlay2 supports spherical view on OpenGL and Vulkan video outputs. You can watch e.g. YouTube spherical videos by pressing "Ctrl+3". You can also enable it from the menu: "Playback->Video filters->Spherical view".

ALSA

If you are using your own ALSA configuration asound.conf or .asoundrc you should also append: defaults.namehint.!showall on to the configuration file. Otherwise devices which were added may not be visible!

Hardware acceleration

QMPlay2 supports hardware video decoding: Vulkan Video, CUVID (NVIDIA only), DXVA2 (Windows), D3D11VA (Vulkan, Windows) VA-API (Linux/BSD only) and VideoToolBox (macOS only). Hardware acceleration is disabled by default, but you can enable it in "Settings->Playback settings":

Hardware acceleration important information:

VA-API + OpenGL information:

VA-API + OpenGL uses EGL for OpenGL context creation. On X11 QMPlay2 tries to detect if EGL can be used, but the detection can fail. In this case you can try do it manually: export QT_XCB_GL_INTEGRATION=xcb_glx and run QMPlay2 from command line. If everything is working properly, you can export this variable globally. In case of multiple GPUs installed in system VA-API requires to use the same device as OpenGL. QMPlay2 detects it automatically, but if the detection fails, try to do it manually, e.g.: export QMPLAY2_EGL_CARD_FILE_PATH=/dev/dri/card1 and run QMPlay2 from command line. If everything is working properly, you can export this variable globally.

Deinterlacing

Video interlacing is automatically detected by QMPlay2. Go to "Settings->Video filters" for more options. If you have fast CPU (or low video resolution), you can use "Yadif 2x" deinterlacing filter for better quality.

You can enable deinterlacing filter on non-interlaced video if necessary (some interlaced videos may not have interlacing data), but remember to revert this setting on any other video! Otherwise the video quality and performance will be worse!

Hardware-accelerated video decoding uses its own video filtering, so the CPU deinterlacing method (e.g. "Yadif 2x") does nothing in this case. Of course you can adjust other deinterlacing settings in case of hardware acceleration.

Vulkan renderer has Yadif deinterlacing filter which is used by default for CPU decoded videos. You can change this behavior in Vulkan renderer settings. Moreover, Yadif Vulkan filter is used for hardware-decoded videos.

Chroma plane if pixel format is not YUV420 when XVideo is used as video output may not be properly deinterlaced.

Hidden features

Audio balance

Right click on volume slider and select "Split channels".

Last.fm scrobbling

Go to "Options->Modules settings" and click "Extensions" on the list. Find "LastFM" group box, select "Scrobble", type your login and password and then press "Apply".

Control files

Empty files in share directory (on Windows it is a directory with QMPlay2.exe):

Still images

Go to "Options->settings" and check "Read and display still images".

Custom user agent

You can specify a CustomUserAgent in QMPlay2.ini file in General section.

Disable yt-dlp update

Set SkipYtDlpUpdate to true in QMPlay2.ini file in General section.

Disable covers cache

Set NoCoversCache to true in QMPlay2.ini file in General section.

Single instance

You can force single instance for QMPlay2: set "Allow only one instance" in "Settings->General settings".

Multimedia keys

Multimedia keys should work automatically (on Linux/BSD it might depend on your configuration).

Additionally In Linux/BSD you can associate keys with commands:

Installation from sources

Don't forget to update submodules: git submodule update --init.

Build for Flatpak

Install flatpak builder:

flatpak install org.flatpak.Builder

Build QMPlay2:

flatpak run org.flatpak.Builder build/flatpak --force-clean --ccache --user --install io.github.zaps166.QMPlay2.Devel.json

Optionally you can install FFmpeg with all codecs and VA-API driver for Intel GPUs:

flatpak install org.freedesktop.Platform.ffmpeg-full
flatpak install org.freedesktop.Platform.VAAPI.Intel

CMake requirements

For CMake build be sure that you have CMake 3.16 or higher.

You need devel packages:

Necessary:

Important:

For modules (some of them can be automatically disabled if not found):

Dependencies:

Arch Linux / Manjaro Linux dependencies

Running the compilation for Linux/BSD using CMake:

CMake options (option - default value: description):

Using other Qt installation of CMake:

Every CMake option must be prepended with -D and new value is set after =.

You can strip binaries during installation to save disk space: sudo ninja -C build install/strip.

Example commands (execute it in QMPlay2 directory with source code):

cmake -GNinja -B build -S . -DCMAKE_INSTALL_PREFIX=/usr
ninja -C build
sudo ninja -C build install/strip
cmake -GNinja -B build -S . -DCMAKE_INSTALL_PREFIX=/usr -DUSE_CHIPTUNE_SID=OFF -DLANGUAGES="pl" -DSOLID_ACTIONS_INSTALL_PATH="/usr/share/solid/actions"
ninja -C build
sudo ninja -C build install
sudo update-desktop-database
sudo update-mime-database /usr/share/mime
sudo gtk-update-icon-cache /usr/share/icons/hicolor
sudo ninja -C build uninstall

macOS:

Windows (cross-compilation):

Other information for Windows

Building package RPM, DEB or any other

You can look at Arch Linux PKGBUILD.

Other information