Hello, this quick tutorial is to introduce an experimental Debian and Ubuntu APT repository to install ffmpeg compiled with v4l2request and v4l2drmprime patches developed by Linux kernel, LIbreELEC and Kodi folks to allow hardware video decoding on stateless decoders like those implemented in Rockchip and Allwinner SoCs for h.264, h.265, vp8 and vp9 codecs.
The repository introduces a new ffmpeg package that integrates and substitues the base ffmpeg package and its related packages.
Preconditions:
Mainline kernel 6.1 or more recent
armhf or arm64 architecture
Supported distributions:
Debian 12 - Bookworm
Debian 13 - Trixie (only arm64)
Ubuntu 22.04 - Jammy
Ubuntu 24.04 - Noble
Rockchip and Allwinner have already been tested, but this should work on other platforms with stateless decoders supported in kernel
APT REPOSITORY SETUP
To install the repository, just copy and paste the lines in a terminal:
$ sudo wget http://apt.undo.it:7242/apt.undo.it.asc -O /etc/apt/trusted.gpg.d/apt.undo.it.asc
$ . /etc/os-release && echo "deb http://apt.undo.it:7242 $VERSION_CODENAME main" | sudo tee /etc/apt/sources.list.d/apt.undo.it.list
$ echo -e "Package: *\nPin: release o=apt.undo.it\nPin-Priority: 600" | sudo tee /etc/apt/preferences.d/apt-undo-it
INSTALL FFMPEG AND MPV PACKAGES
$ sudo apt update
$ sudo apt install ffmpeg mpv
SETUP MPV CONFIG FILE
$ sudo mkdir -p /etc/mpv
$ echo -e "hwdec=drm\ndrm-drmprime-video-plane=primary\ndrm-draw-plane=overlay" | sudo tee /etc/mpv/mpv.conf
You can now play your videos using mpv and they should run with hardware decoding if supported, either in virtual terminals or in X11/Wayland windows!
Enjoy!
Notes:
your mileage may vary a lot: the more recent is the kernel version, the better is support (you may need edge kernel)
bug: when rendered in X11/Wayland window, video may show scattered tiles during frames
bug: Lima driver (Mali 400/450) shows a red/pink tint when video is played in X11/Wayland (see https://github.com/mpv-player/mpv/issues/12968) (workaround below: https://forum.armbian.com/topic/32449-repository-for-v4l2request-hardware-video-decoding-rockchip-allwinner/?do=findComment&comment=177968)
you may want to add --gpu-hwdec-interop=drmprime-overlay to the mpv command line if used in pure virtual terminal (no X, no Wayland) to use direct-to-overlay output
Panfrost driver should work flawlessy
10 bit HEVC are generally supported on all Rockchip devices (rk322x, rk3288, rk33x8, rk3399), but Allwinner H3 have no hardware support for that
Hello, for those still interested in hardware video decoding, I made a new thread introducing an APT repository to make installation easier for Armbian Debian Bookworm and Ubuntu Jammy distros:
Just wanted to thank the maintainers. I'm heading out to stay at a friend's. I wanted to bring a little computer with me. My 3229 box fits the bill. Tried my Raspberry Pi 4 first, but it did not suit: I couldn't charge my phone off of it. Not only will my box charge my phone, it will also connect via USB tether to the internet through my phone. That's 2 points up on the competition!
There was some interest in running Retropie on this box in this thread. I've done some basic work getting one of the boxes I own to run Retropie, and have a basic patch that helps Retropie identify that the CPU is ARM. https://retropie.org.uk/forum/topic/34337/rk322x-box-armbian-build-report-collab
If there are tests / whatever folks here might find helpful, let me know. I'm not sure how long I'll be keeping this box.
There was some interest in running Retropie on this box in this thread. I've done some basic work getting one of the boxes I own to run Retropie, and have a basic patch that helps Retropie identify that the CPU is ARM. https://retropie.org.uk/forum/topic/34337/rk322x-box-armbian-build-report-collab
If there are tests / whatever folks here might find helpful, let me know. I'm not sure how long I'll be keeping this box.