meta data for this page
Table of Contents
Scale to fit:
Has to be filled
4 of 5 Points, unable to pick files directly from the app (see tips), screensaver turns off the screen while watching (see tips).
You might also be interested in Celluloid which provides a graphical wrapper around mpv and provides touch screen control and inhibits screen blanking.
How to install:
sudo apt update sudo apt install mpv
Tips and Tricks
Open files in mpv using the Files app since there's no easy way to drop files or URLs in the app to play them. Set bookmarks in the Files app for easier access to your videos over the network. Also see Gui for File- & URL selection
Mpv is designed with keyboard controls in mind. Phosh lets you bring up the keyboard easily with the icon on the bottom-right. Switch the terminal keyboard so you have access to arrow keys: left/right for small skips, up/down for large one. The space bar will pause/resume the video. If you use the 'f' key you can force true full screen without the banners on the top/bottom from Phosh. Double-tap to get back the phosh menus. See the project website for more buttons for subtitles, contrast and much more.
You can switch to landscape mode for wider viewing and use fullscreen to eliminate distractions completely.
If you quit mpv with Shift-Q on the keyboard it will remember your position in that video next time you open it. Alternatively, the the
save-position-on-quit=yes option in
/home/mobian/.config/mpv/mpv.conf (create it, if it does not exist).
Watching YouTube Videos directly in MPV is possible with built-in support for
youtube-dl. Simply give mpv a YouTube URL and it will play just fine. By default it tries to replay the best available quality, which might be too much for the Pinephone. TO prevent stuttering, following options in
/home/mobian/.config/mpv/mpv.conf give reasonable playback performance for youtube videos. They set the maximum quality to 720p in descending order (first tries 720, then 480, 360, …) and also enforces best possible wayland GPU rendering:
ytdl-format="bestvideo[height<=720]+bestaudio/best" # alternatively, replace "720" by "480" if stuttering occurs gpu-context=wayland
These Options can also be set/overridden with commandline arguments:
mpv --ytdl-format="bestvideo[height<=480]+bestaudio/best" -- https://www.youtube.com/watch?v=p2Q_SQKK7EQ
You can get a media-control overlay in the phosh notifications area, as well as on the lockscreen with the mpris plugin for MPV. Attention: Please note, that the plugin is currently not part of the Debian Respositories. Please be extremely careful with random code from Github. If you are not sure whether you can trust the plugin, please do not use it. Either download the mpris.so from Github directly or build it from source. Then move it to the MPV plugins directory
~/.config/mpv/scripts (create it, if it does not yet exist).
Prevent Screen Blanking
The screen will blank after some time (Settings→Power→Blank Screen) while the audio still plays due to a missing piece of functionality in wlroots/phosh. One temporary workaround is to change the power setting so that the screen never automatically blanks. Another is to install the wrapper “coffeine” and prefix that manually to the command mpv. A more convenient and automatic solution is to use a customized mpv launcher with a wrapper that automatically disables the screensaver while mpv is running.
$ mkdir -p ~/.local/share/applications || echo "Already there" $ cp /usr/share/applications/mpv.desktop ~/.local/share/applications # Edit ~/.local/share/applications/mpv.desktop and replace "mpv" with "gnome-session-inhibit mpv..." in the Exec line. $ update-desktop-database /home/mobian/.local/share/applications
Gui for file & URL selection
MPV by itself has no file or URL selection gui, which makes it harder to use from a phone. A simple gui can be written in yad (
sudo apt install yad), that makes it easy to use MPV in Mobian
#!/usr/bin/env bash # If we launch the scripts without any arguments, launch the GUI if [[ -z "$@" ]]; then CHOICE=$(yad --title "MPV Player" \ --text "What should we replay?" \ --window-icon=mpv \ --button=gtk-ok \ --form \ --field="Web:TEXT" \ --field="File:FL") # URL is first field, File is second field LINK=$(echo "$CHOICE" | cut -d "|" -f1) FILE=$(echo "$CHOICE" | cut -d "|" -f2) # Play either selection (other one is empty, so we can simply merge the string) PLAYTHIS="$LINK$FILE" else PLAYTHIS="$@" fi # Also let the user know, what we play and when it is finished (in case of failure). notify-send "MPV" "Playing: $PLAYTHIS" -i mpv /usr/bin/mpv --player-operation-mode=pseudo-gui -- "$PLAYTHIS" # or use the mpv-wrapper.py executable here... notify-send "MPV" "Finished." -i mpv
chmod +x mpvgui.sh
Then edit the
Exec line in
/usr/share/applications/mpv.desktop to use this script instead of the mpv binary.