Skip to content

Instantly share code, notes, and snippets.

@yangxuan8282
Last active June 3, 2020 14:23
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yangxuan8282/c5819e8c74848420739e45e19f66cce9 to your computer and use it in GitHub Desktop.
Save yangxuan8282/c5819e8c74848420739e45e19f66cce9 to your computer and use it in GitHub Desktop.
compile mpv with hardware acceleration (mmal) on RPi, no windows borders

mpv

The latest working mpv version for this guides is 0.27.2, tested on 2018-03-13-raspbian-stretch.

sudo apt-get update && sudo apt-get upgrade -y && 
sudo apt-get install -y git devscripts equivs &&
sudo apt-get install -y libgles2-mesa-dev
sudo rpi-update &&
sudo reboot
mkdir -p ~/src/mpv &&
git clone https://github.com/mpv-player/mpv-build.git ~/src/mpv-build &&
cd ~/src/mpv-build &&
echo --enable-mmal >> ffmpeg_options
export PKG_CONFIG_PATH=/opt/vc/lib/pkgconfig/ &&
export LIBRARY_PATH=/opt/vc/lib 
./use-mpv-custom v0.27.2 &&
./update 
sed -i '0,/check_cc(lib="EGL")/s//check_cc(lib="EGL", linkflags="-lGLESv2")/' mpv/wscript
rm -f mpv-build-deps_*_*.deb &&
mk-build-deps -s sudo -i
time dpkg-buildpackage -uc -us -b -j"$(getconf _NPROCESSORS_ONLN)"
sudo dpkg -i ../mpv_*.deb
@rien333
Copy link

rien333 commented Jan 8, 2018

With what flags should I open mpv using this? And are these instructions up to date?

@yangxuan8282
Copy link
Author

@rien333 you can choose rpi-background in your mpv config file:

echo "# ~/.config/mpv/mpv.conf

##################
# video settings #
##################

rpi-background=yes
fs=yes

##################
# other settings #
##################

# youtube-dl format filter
# FROM https://github.com/mpv-player/mpv/issues/1321
#   https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/youtube.py
ytdl-format=bestvideo[height<=?720][fps<=?30][vcodec!=?vp9]+bestaudio/best
" | tee ~/.config/mpv/mpv.conf

@code0nwheels
Copy link

no window is opening for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment