|
1 year ago | |
---|---|---|
data | 1 year ago | |
src | 1 year ago | |
LICENSE | 1 year ago | |
README.md | 1 year ago | |
dbuscontrol.sh | 1 year ago | |
yt.m3u | 1 year ago |
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.
Requirements:
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:
# 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
At the moment, there are no arguments, only a list of files.
python src/gtplay.py {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/gtplay.py --omx {files}
The OMX-mode cannot play Youtube-links directly. But you can use GTPlay as player for smtube.
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 dev.twitch.tv. There are two ways to pass a Twitch-Token:
--token
parametersrc/twitch_token.py
which specifies a variable twitch_token
with the token as stringBe aware, that OMX is quite slow to respond to anything, when used with livestreamer
.
Viewing a file:
python gtplay.py data/bunny.mp4
On Raspberry Pi: Viewing in OMXPlayer (hardware accelerated):
python gtplay.py --omx data/bunny.mp4
Watching a livestream (Twitch):
python gtplay.py --live https://twitch.tv/monstercat --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.