Latest note
AMD GPU Hardware Accelerated FFmpeg Encoding with AMF
Had to encode some 4K video recently and found out that modern h.265 (hevc) and AV1 codecs were really slow even on a 16 core Ryzen 9 5950x. So I looked into GPU hardware accelerated options for the Radeon 9070XT that I have.
There are two options, FFmpeg with VAAPI, which is supported with standard packages on Ubuntu, or FFmpeg with AMD's Advance Media Framework. VAAPI was fast, but not suited for compute intensive high quality encoding. AMF would be somewhat AMD's equivalent to NVidia's NVEnc.
The good news is that it is now open source and works with AMD's open source Linux drivers and libraries. The bad news is that, it's not part of the standard package yet and Ubuntu/Debian FFmpeg package isn't compiled with AMF support by default. You'll have to compile it yourself. But if you're familiar with CLI, git and compiling it's straightforward.
Step 1: Install ROCm
Technically, I think you just need the OpenCL runtime, but you probably want to have the full AI/Compute stack these days.
You can follow the official instructions here for ROCm 7.1.1 or the latest one (currently 7.2). Note that if you're using DaVinci Resolve on Linux with AMD, I recommend sticking to 7.1.1. At the time of this post, Resolve will crash with the ROCm 7.2 OpenCL driver.
Step 2: Install AMF Drivers for Linux
There is a simple install script, the AMF FFmpeg documents links to an older version, for support up to the latest versions of Ubuntu 25.10, you want AMF 25.30. The instructions and install script is here. It'll add the AMF repo and download the required packages.
Step3: Download and build FFmpeg with AMF support
Just follow the official instructions, and jump to the build FFmpeg with AMF for Linux part. The instructions are for Ubuntu.
It's straightforward, I think the instructions missed out on installing nasm package. Install that if you haven't already.
And that's it, you'll have an ffmpeg binary with AMF hardware accelerated encoding support for h264, h264 and av1.
FFmpeg options
Getting the right options for quality and size is a bit of an art with FFmpeg. Thankfully, the AMD team has provided a set of recommend base options for difference use cases for all three modern codecs that you can then easily tweak.
The packaging for the open source components from AMD for Linux still needs a bit of work so that all this is can easily be installed as part of the standard Ubuntu distribution, but that should come for the 2026 releases of Ubuntu.
For now with a bit of work, you can now make full use of your AMD Radeon RDNA3 and RDNA4 GPUs on Linux with an open source stack.
Document Actions
Document Actions