Hardware Accelerated Video Playback Guide - Printable Version

+- PINE64 (
+-- Forum: ROCKPRO64 (
+--- Forum: Linux on RockPro64 (
+--- Thread: Hardware Accelerated Video Playback Guide (/showthread.php?tid=7112)

Hardware Accelerated Video Playback Guide - xkaiser - 01-31-2019

Hey all,

With the help of MrFixit2001, I was able to come up with a recipe for playing hardware accelerated media files with MPV. I'm using MrFixit2001's image as a starter.

Flash this image to an SD card (Etcher)
ssh or access the terminal with a keyboard (root/root or rock/rock)

apt update && apt install vim git libdrm-dev vainfo libmodplug1 libmodplug-dev libmp3lame-dev libmp3lame0 libopus0 libopus-dev libspeex1 libspeex-dev libtheora-dev libtheora0 libghc-bzlib-dev libass5 libass-dev autoconf automake libtool libasound2 libasound2-dev libpulse-dev cmake debhelper fakeroot libvorbis-dev python

git clone --depth 1 -b release
git clone --depth 1 -b rockchip/release/4.0
git clone --depth 1 -b v0.29.1
cd mpp
patch osal/allocator/allocator_drm.c rkmpp-0001-fix-32-bit-mmap-issue-on-64-bit-kernels.patch

make -j6 && make install
cd ../ffmpeg
./configure --enable-static --enable-shared --enable-cross-compile --cross-prefix=/usr/bin/arm-linux-gnueabihf- --sysroot="/" --sysinclude="/usr/include" --host-cc="/usr/bin/gcc" --arch="arm" --target-os="linux" --disable-stripping --pkg-config="/usr/bin/pkg-config" --prefix=/usr --enable-avfilter --disable-version3 --enable-logging --enable-optimizations --disable-extra-warnings --enable-avdevice --enable-avcodec --enable-avformat --enable-network --disable-gray --enable-swscale-alpha --disable-small --enable-dct --enable-fft --enable-mdct --enable-rdft --disable-crystalhd --disable-dxva2 --enable-runtime-cpudetect --disable-hardcoded-tables --disable-mipsdsp --disable-mipsdspr2 --disable-msa --enable-hwaccels --disable-cuda --disable-cuvid --disable-nvenc --disable-avisynth --disable-frei0r --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libcdio --disable-libdc1394 --disable-libgsm --disable-libilbc --disable-libopenjpeg --disable-libvo-amrwbenc --disable-symver --disable-doc --disable-w32threads --enable-asm --enable-bsfs --enable-bzlib --enable-demuxers --enable-encoder=aac --enable-encoder=ac3 --enable-encoder=mjpeg --enable-encoder=png --enable-encoder=wmav2 --enable-filters --enable-gpl --enable-libspeex --enable-muxer=adts --enable-muxer=asf --enable-muxer=ipod --enable-muxer=mpegts --enable-muxer=spdif --enable-parsers --enable-pic --enable-postproc --enable-protocol=http --enable-pthreads --enable-shared --enable-swscale --enable-yasm --enable-zlib  --enable-gpl --disable-nonfree --enable-ffmpeg --enable-ffplay --disable-avresample --disable-ffprobe --enable-postproc --enable-swscale --enable-indevs --enable-outdevs --enable-pthreads --enable-zlib --enable-bzlib --disable-libfdk-aac --disable-gnutls --disable-openssl --disable-libopenh264 --enable-libvorbis --enable-muxer=ogg --enable-encoder=libvorbis --disable-vaapi --disable-vdpau --disable-mmal --disable-omx --disable-omx-rpi --enable-libdrm --enable-version3 --enable-rkmpp --disable-libopencv --enable-libopus --disable-libvpx --enable-libass --disable-libbluray --disable-librtmp --enable-libmp3lame --enable-libmodplug --enable-libspeex --enable-libtheora --disable-libwavpack --enable-libfreetype --enable-fontconfig --disable-libx264 --disable-libx265 --disable-yasm --disable-mmx --disable-sse --disable-sse2 --disable-sse3 --disable-ssse3 --disable-sse4 --disable-sse42 --disable-avx --disable-avx2 --disable-armv6 --disable-armv6t2 --enable-vfp --enable-neon --disable-altivec --extra-libs=-latomic --enable-pic --cpu="cortex-a53" --pkgconfigdir=/usr/lib/arm-linux-gnueabihf/pkgconfig

make -j6 && make install
cd ../mpv
./waf configure && ./waf && ./waf install

 mpv --vo=gpu --gpu-context=drm --hwdec=rkmpp your_media_file.mp4
I haven't run through the guide a second time on a fresh image, so if you run into issues, let me know and I'll edit this. I'm working on creating a guide on the bionic minimal image from Ayufan next, but I'm running into a few issues.

RE: Hardware Accelerated Video Playback Guide - Mentaluproar - 08-22-2019

update: change your url on the 32-to-64 patch to It's missing in the current version.

question: Why set the cpu descriptor as a53? We also have two a72 cores to work with.

RE: Hardware Accelerated Video Playback Guide - dmitrymyadzelets - 04-10-2020

Why there is no such solution for every distro for Rock64?