Skip to content

Integration in MPV

Christian Lehmann edited this page Oct 10, 2024 · 2 revisions

The MPV player is a free media player for the command line which supports a variety of media file formats, audio and video codecs, and subtitle types.

Build MPV with VVC support

The github repository mpv build uses scripts to download and install all needed dependencies and libraries to build mpv on Linux or MacOSX. Please check the README for further information.

  • checkout MPV build
git clone https://github.com/mpv-player/mpv-build.git
cd mpv-build
git restore update
  • set ffmpeg version (run ./use-ffmpeg-master or ./use-ffmpeg-release)
./use-ffmpeg-master
  • update the sources
./update
cd ffmpeg
wget -O libvvdec.patch https://raw.githubusercontent.com/wiki/fraunhoferhhi/vvdec/data/patch/v6-0001-avcodec-add-external-dec-libvvdec-for-H266-VVC.patch
git apply libvvdec.patch
cd ..
  • set optional libraries to use, e.g.libfreetype
printf "%s\n" --enable-libfreetype   >> ffmpeg_options
  • enable libvvdec
printf "%s\n" --enable-libvvdec    >> ffmpeg_options
  • build and install
./rebuild -j4
sudo ./install

Build MPV-Android with VVC support

  • Install build prerequisites (debian/ubuntu)
    sudo apt-get install default-jdk-headless wget patch
    
  • Get the MPV-Android source and apply the patch to enable the VVdeC integration
    git clone https://github.com/mpv-android/mpv-android
    wget https://raw.githubusercontent.com/wiki/fraunhoferhhi/vvdec/data/patch/mpv-android-2024-08-20_vvdec-integration.patch -O mpv-android-2024-08-20_vvdec-integration.patch
    cd mpv-android
    patch -f -p 1 <../mpv-android-2024-08-20_vvdec-integration.patch
    
    If the previous patch command did not succeed try:
    git clean -fd
    git reset --hard
    git checkout 2024-08-20
    patch -p 1 <../mpv-android-2024-08-20_vvdec-integration.patch
    
  • Go to the buildscripts directory:
    cd buildscripts
    
  • The build scripts try to install the latest version of Meson system wide using pip. This is not allowed in recent python versions (at least on debian), so we setup a virtual environment.
    sudo apt-get install python3-venv
    python3 -m venv venv
    . ./venv/bin/activate
    
  • Download all remaining dependencies and Android SDK & NDK
    ./download.sh
    
  • Start the actual build. This builds MPV-Android for arm64 only.
    ./buildall.sh --arch arm64
    
    • If the previous step fails, with a message about missing armv7l architecture binaries, run the following to build the missing libraries:
      ./buildall.sh
      
    • to add further architectures to the generated universal APK (e.g. x86_64), call the build script again like this:
      ./buildall.sh --arch x86_64
      
  • Install the compiled APK:
    adb install ../app/build/outputs/apk/default/debug/app-default-arm64-v8a-debug.apk
    # or
    adb install ../app/build/outputs/apk/default/debug/app-default-universal-debug.apk
    

For further information see buildscripts/README.md in the mpv-android repository.

Clone this wiki locally