rocDecode is a high-performance video decode SDK for AMD GPUs. Using the rocDecode API, you can access the video decoding features available on your GPU.
Note
The published documentation is available at rocDecode in an organized, easy-to-read format, with search and a table of contents. The documentation source files reside in the rocDecode/docs folder of this repository. As with all ROCm projects, the documentation is open source. For more information on contributing to the documentation, see Contribute to ROCm documentation.
- H.265 (HEVC) - 8 bit, and 10 bit
- H.264 (AVC) - 8 bit
- AV1 - 8 bit, and 10 bit
- VP9 - 8 bit, and 10 bit
- Linux
- Ubuntu -
22.04/24.04 - RedHat -
8/9 - SLES -
15-SP5
- Ubuntu -
Important
gfx908or higher GPU required
- Install ROCm
6.3.0or later withamdgpu-installand usecase:rocm
Important
sudo amdgpu-install --usecase=rocm
- AMD Clang++ Version 18.0.0 or later - installed with ROCm
-
CMake Version
3.10or latersudo apt install cmake
-
Video Acceleration API -
libva-amdgpu-devis an AMD implementation for VA-APIsudo apt install libva-amdgpu-dev
Note
- RPM Packages for
RHEL/SLES-libva-amdgpu-devel libva-amdgpuis strongly recommended over systemlibvaas it is used for building mesa-amdgpu-va-driver
- AMD VA Drivers
sudo apt install libva2-amdgpu libva-amdgpu-drm2 libva-amdgpu-wayland2 libva-amdgpu-x11-2 mesa-amdgpu-va-drivers
Note
RPM Packages for RHEL/SLES - libva-amdgpu mesa-amdgpu-va-drivers
-
HIP
sudo apt install hip-dev
-
sudo apt install pkg-config
-
FFmpeg libraries and headers:
libavcodec- provides implementation of a wider range of codecs.libavformat- implements streaming protocols, container formats and basic I/O access.libavutil- includes hashers, decompressors and miscellaneous utility functions.
Note
FFmpeg libraries are used in samples and tests
sudo apt install libavcodec-dev libavformat-dev libavutil-devImportant
- Required compiler support
- C++17
- Threads
- On Ubuntu 22.04 - Additional package required: libstdc++-12-dev
sudo apt install libstdc++-12-devNote
- All package installs are shown with the
aptpackage manager. Use the appropriate package manager for your operating system.
For your convenience, we provide the setup script, rocDecode-setup.py, which installs all required dependencies. Run this script only once.
python3 rocDecode-setup.py --rocm_path [ ROCm Installation Path - optional (default:/opt/rocm)]
--runtime [ Setup runtime requirements - optional (default:ON) [options:ON/OFF]]
--developer [ Setup Developer Options - optional (default:OFF) [options:ON/OFF]]The installation process uses the following steps:
-
ROCm-supported hardware install verification
-
Install ROCm
6.3.0or later withamdgpu-installand--usecase=rocm:sudo amdgpu-install --usecase=rocm
Important
Use either package install or source install as described below.
To install rocDecode runtime, development, and test packages, run the line of code for your operating system.
- Runtime package -
rocdecodeonly provides the rocdecode librarylibrocdecode.so - Development package -
rocdecode-dev/rocdecode-develprovides the library, header files, and samples - Test package -
rocdecode-testprovides CTest to verify installation
sudo apt install rocdecode rocdecode-dev rocdecode-testsudo yum install rocdecode rocdecode-devel rocdecode-testsudo zypper install rocdecode rocdecode-devel rocdecode-testNote
Package install auto installs all dependencies.
Important
RHEL/SLES package install requires manual FFMPEG dev install
To build rocDecode from source and install, run:
git clone https://github.com/ROCm/rocDecode.git
cd rocDecode
python3 rocDecode-setup.py
mkdir build && cd build
cmake ../
make -j8
sudo make installmake testImportant
make test requires FFMPEG dev install
Note
To run tests with verbose option, use make test ARGS="-VV".
sudo make packageThe installer copies:
- Libraries into
/opt/rocm/lib - Header files into
/opt/rocm/include/rocdecode - Samples folder into
/opt/rocm/share/rocdecode - Documents folder into
/opt/rocm/share/doc/rocdecode
To verify your installation using a sample application, run:
mkdir rocdecode-sample && cd rocdecode-sample
cmake /opt/rocm/share/rocdecode/samples/videoDecode/
make -j8
./videodecode -i /opt/rocm/share/rocdecode/video/AMD_driving_virtual_20-H265.mp4To verify your installation using the rocdecode-test package, run:
mkdir rocdecode-test && cd rocdecode-test
cmake /opt/rocm/share/rocdecode/test/
ctest -VVYou can access samples to decode your videos in our GitHub repository. Refer to the individual folders to build and run the samples.
FFmpeg is required for sample applications and make test. To install
FFmpeg, refer to the instructions listed for your operating system:
-
Ubuntu:
sudo apt install libavcodec-dev libavformat-dev libavutil-dev
-
RHEL/SLES:
Install ffmpeg development packages manually or use
rocDecode-setup.pyscript
You can find rocDecode Docker containers in our GitHub repository.
- Linux
- Ubuntu -
22.04/24.04 - RHEL -
8/9 - SLES -
15 SP7
- Ubuntu -
- ROCm:
7.0.0 - libva-amdgpu-dev -
2.16.0 - mesa-amdgpu-va-drivers -
1:24.3.0 - FFmpeg -
4.4.2/6.1.1 - rocDecode Setup Script -
V2.5.0