Simple GUI around MPV and OMXPlayer (hardware accelerated player on Raspberry Pi)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4.3 KiB


Simple GUI around MPV and OMXPlayer (hardware accelerated player on Raspberry Pi)

OMXPlayer is a quite basic player using the hardware decoding features of the Raspberry Pi for decoding HD videos. The GTPlay-GUI is intended to be used with other tools like smtube. OMXPlayer is kept inside the GTPlay window, so you can move it out of the way, when you need more space on screen.



  • Python 3
  • pyGTK 3.0 and python-gobject
  • python-mpv and MPV

Maybe your distribution has python-mpv, or you can install it with:

# on Arch Linux ARM, the package may be called differently on Raspbian
sudo pacman -Syu python python-pip pygtk python-gobject
# install python-mpv
sudo pip install python-mpv


You will need the following for running with OMXPlayer as player:

  • xwininfo (on Arch Linux xorg-xwininfo)
  • livestreamer (for live streams only)
    • a Twitch token, when wanting to watch Twitch-content (, see below)
  • omxplayer
# on Arch Linux ARM, the package may be called differently on Raspbian
sudo pacman -Syu omxplayer-git xorg-xwininfo
# install livestreamer
sudo pip install livestramer

Usage (preliminary)

At the moment, there are no arguments, only a list of files.

python src/ {files}

Once an instance runs, you can run a similar command again and add items to the playlist of the first one. GTPlay will only allow one instance of itself at any time.


MPV-mode can be used on normal PCs, then GTPlay is a simple wrapper around mpv. It can play Twitch or Youtube natively, however is too slow for Raspberry Pi or other ARM-boards.


python src/ --omx {files}

The OMX-mode cannot play Youtube-links directly. But you can use GTPlay as player for smtube.

Livestreams (Twitch)

The OMXPlayer cannot retrieve livestreams by itself (mpv can). One needs to tell it, that an URL is a livestream, with the --live argument before the URL. You can also add a quality statement.

For livestreams the Python-program livestreamer is used. It is a run-time requirement, so you need to have it installed, but GTPlay will work without it, as long as you won't try to view a livestream using the OMXPlayer backend.

livestreamer unfortunately needs a Client-ID-Token for streaming Twitch-Content. You can get one at There are two ways to pass a Twitch-Token:

  • using the --token parameter
  • using a file src/ which specifies a variable twitch_token with the token as string

Be aware, that OMX is quite slow to respond to anything, when used with livestreamer.


Viewing a file:

python data/bunny.mp4

On Raspberry Pi: Viewing in OMXPlayer (hardware accelerated):

python --omx data/bunny.mp4

Watching a livestream (Twitch):

python --live --quality 1080p --token ...


Shortcut Semantic
Space, p toggle pause / play
<, b previous element
>, n next element
l toggle loop-mode
f toggle fullscreen
h hide player (OMXPlayer only)
q exit GTPlay
Shift+Left, a jump backwards
Shift+Right, d jump forwards


GTPlay uses a JSON config-file to save some properties. It defaults to gtplay.cfg in the root-directory of GTPlay. This is an example file:

  "buttons": [
      "hidden": true,
      "name": "loopBtn",
      "hidden": true,
      "name": "pauseBtn"
  "loop": false,
  "muted": false,
  "omx_hidden": false,
  "player": "mpv",
  "quality": "720p",
  "volume": 99.0

It sets the loop-Button and the pause/play-button to invisible. It sets the player to non-looping at startup and not muted. The default volume is 99.0 (out of 100) at startup, the default player is mpv. In OMX-mode the player is set to startup to not hidden and the quality-parameter to livestreamer to 720p.

The file is rewritten, when the player is exited, so looping, the volume and muting is carried over to the next start.