Compiling MPV with Hardware Decoding on Raspberry Pi 1/2/3 & Zero

Outdated, see here for newer guide

Install Build Tools

  • sudo apt-get install -y gperf bison flex autoconf automake make makeinfo texinfo help2man libtool libtool-bin ncurses-dev git yasm mercurial cmake cmake-curses-gui libfribidi-dev checkinstall libfontconfig1-dev libgl1-mesa-dev libgles2-mesa-dev gnutls-dev libsmbclient-dev libpulse-dev libbluray-dev libdvdread-dev libluajit-5.1-dev libjack-dev libjpeg-dev libv4l-dev libcdio-cdda-dev libcdio-paranoia-dev
  • mkdir build

Compile ffmpeg

  • wget
  • tar zxvf n3.0.3.tar.gz && cd FFmpeg-n*
  • ./configure --enable-gpl --enable-mmal --enable-gnutls && make -j4
  • sudo make install
  • checkinstall (make your own deb file)

Compile libass

  • cd ..
  • wget
  • tar zxvf libass-0.13.3.tar.gz && cd libass-0.*
  • ./configure && make -j4
  • sudo make install
  • checkinstall (make your own deb file)

Compile mpv

  • cd ..
  • wget
  • tar zxvf v0.*.tar.gz && cd mpv-0.*.0/
  • ./
  • ./waf configure --prefix=/usr
  • ./waf build -j4
  • sudo ./waf install
  • sudo ./waf uninstall (only use if you want to uninstall mpv)
  • echo "vo=rpi:background=yes" >> $HOME/.config/mpv/mpv.conf
  • checkinstall ./waf install (make your own deb file)

play video

Play a file (Big Buck Bunny 1080p 30fps)

  • mpv

mmal error
try setting video ram to 192

  • sudo su
  • echo "gpu_mem=128" >> /boot/config.txt
  • echo "gpu_mem=256" >> /boot/config.txt (rpi2/rpi3)

note: it will default to fullscreen and borderless window, this is a limitation of raspberry pi

DigitalOcean Referral Badge
Keep my site online & receive a $100 60-day credit at DigitalOcean for your VPS Hosting
Cheaper Games on Instant-Gaming
Proudly published with Ghost | Header Image by GUWEIZ@DeviantArt Creative Commons Licence