2024-01-12 12:35:53 -08:00
[](https://opensource.org/licenses/MIT)
2024-01-12 12:48:43 -08:00
<p align="center"><img width="70%" src="https://github.com/ROCm/rocDecode/blob/master/docs/data/AMD_rocDecode_Logo.png?raw=true" /></p>
2023-11-21 11:08:36 -07:00
2023-11-23 05:57:45 -08:00
rocDecode is a high performance video decode SDK for AMD GPUs. rocDecode API lets developers access the video decoding features available on the GPU.
2023-07-26 17:47:47 -04:00
2024-01-12 12:35:53 -08:00
## Supported codecs
2023-11-21 11:08:36 -07:00
2023-11-06 12:10:12 -05:00
* H.265 (HEVC) - 8 bit, and 10 bit
2023-10-12 14:08:12 -07:00
2023-11-21 11:08:36 -07:00
## Prerequisites
2023-07-26 17:47:47 -04:00
* Linux distribution
2024-01-09 10:43:34 -08:00
+ Ubuntu - `20.04` / `22.04`
+ RHEL - `8` / `9`
+ SLES - `15-SP4`
2023-10-12 14:08:12 -07:00
2024-01-12 12:35:53 -08:00
* [ROCm supported hardware ](https://rocm.docs.amd.com/projects/install-on-linux/en/latest/reference/system-requirements.html )
2024-01-12 13:18:28 -08:00
+ **NOTE:** `gfx908` or higher required
2023-11-21 11:08:36 -07:00
2024-01-12 12:35:53 -08:00
* Install ROCm `6.1.0` or later with [amdgpu-install ](https://rocm.docs.amd.com/projects/install-on-linux/en/latest/how-to/amdgpu-install.html ) with `--usecase=multimediasdk,rocm --no-32`
+ **NOTE:** To install rocdecode with minimum requirements follow instructions [here ](https://github.com/ROCm/rocDecode/wiki#how-can-i-install-rocdecode-runtime-with-minimum-requirements )
2023-07-26 17:47:47 -04:00
2024-01-09 10:43:34 -08:00
### To build from source
2023-11-29 20:59:06 -05:00
2024-01-09 10:43:34 -08:00
* CMake `3.5` or later
2024-01-12 12:35:53 -08:00
```shell
sudo apt install cmake
```
2023-11-29 20:59:06 -05:00
2024-01-12 12:35:53 -08:00
* [pkg-config ](https://en.wikipedia.org/wiki/Pkg-config )
2024-01-09 10:43:34 -08:00
```shell
2024-01-12 12:35:53 -08:00
sudo apt install pkg-config
2024-01-09 10:43:34 -08:00
```
2023-11-29 20:59:06 -05:00
2024-01-12 12:35:53 -08:00
* [FFMPEG ](https://ffmpeg.org/about.html ) runtime and headers - for tests and samples
```shell
sudo apt install ffmpeg libavcodec-dev libavformat-dev libavutil-dev
```
**NOTE:**
* All package install shown with `apt` package manager, use appropriate package manager depending on the OS.
* Ubuntu 22.04 - Install `libstdc++-12-dev`
```shell
sudo apt install libstdc++-12-dev
```
2024-01-09 10:43:34 -08:00
#### Prerequisites setup script for Linux
2023-12-13 06:49:52 -08:00
For the convenience of the developer, we provide the setup script [rocDecode-setup.py ](rocDecode-setup.py ) which will install all the dependencies required by this project.
**Usage:**
```shell
python rocDecode-setup.py --rocm_path [ ROCm Installation Path - optional ( default:/opt/rocm)]
--developer [ Setup Developer Options - optional ( default:ON) [ options:ON/OFF]]
```
**NOTE:** This script only needs to be executed once.
2023-07-26 17:47:47 -04:00
2024-01-12 12:35:53 -08:00
## Build and install instructions
2023-11-21 11:08:36 -07:00
2024-01-09 10:43:34 -08:00
### Package install
2024-01-12 12:35:53 -08:00
Install rocDecode runtime, development, and test packages.
* Runtime package - `rocdecode` only provides the rocdecode library `librocdecode.so`
* Development package - `rocdecode-dev` /`rocdecode-devel` provides the library, header files, and samples
* Test package - `rocdecode-test` provides ctest to verify installation
2024-01-12 13:18:28 -08:00
2024-01-12 12:35:53 -08:00
**NOTE:** Package install will auto install all dependencies.
2023-10-12 14:08:12 -07:00
2024-01-12 13:18:28 -08:00
#### Ubuntu
2024-01-09 10:43:34 -08:00
```shell
sudo apt install rocdecode rocdecode-dev rocdecode-test
```
2024-01-12 13:18:28 -08:00
#### RHEL
2023-11-21 11:08:36 -07:00
```shell
2024-01-09 10:43:34 -08:00
sudo yum install rocdecode rocdecode-devel rocdecode-test
2023-07-26 17:47:47 -04:00
```
2024-01-12 13:18:28 -08:00
#### SLES
2024-01-12 12:35:53 -08:00
```shell
sudo zypper install rocdecode rocdecode-devel rocdecode-test
```
2023-07-26 17:47:47 -04:00
2024-01-09 10:43:34 -08:00
### Source build and install
```shell
git clone https://github.com/ROCm/rocDecode.git
cd rocDecode
mkdir build && cd build
cmake ../
make -j8
sudo make install
```
* run tests - Requires `FFMPEG` dev install
2023-11-21 11:08:36 -07:00
```shell
2023-10-12 14:08:12 -07:00
make test
` ``
**NOTE:** run tests with verbose option ` make test ARGS="-VV"`
* make package
2023-11-21 11:08:36 -07:00
` ``shell
2024-01-09 10:43:34 -08:00
sudo make package
2023-10-12 14:08:12 -07:00
` ``
2024-01-12 12:35:53 -08:00
## Verify installation
2023-11-06 08:51:47 -08:00
The installer will copy
2023-11-23 05:57:45 -08:00
* 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`
2023-11-06 08:51:47 -08:00
2024-01-12 12:35:53 -08:00
**NOTE:** FFMPEG dev install required to run samples and tests
### Verify with sample application
2023-11-06 08:51:47 -08:00
2023-11-21 11:08:36 -07:00
` ``shell
2023-11-06 08:51:47 -08:00
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.mp4
` ``
2024-01-12 12:35:53 -08:00
### Verify with rocdecode-test package
Test package will install ctest module to test rocdecode. Follow below steps to test packge install
` ``shell
mkdir rocdecode-test && cd rocdecode-test
cmake /opt/rocm/share/rocdecode/test/
ctest -VV
` ``
2023-11-06 08:51:47 -08:00
2023-11-21 11:08:36 -07:00
## Samples
2023-07-26 17:47:47 -04:00
The tool provides a few samples to decode videos [here](samples/). Please refer to the individual folders to build and run the samples.
2024-01-12 12:35:53 -08:00
### Sample prerequisites
2023-11-06 08:51:47 -08:00
* [FFMPEG](https://ffmpeg.org/about.html) - required to run sample applications & make test
2023-11-21 11:08:36 -07:00
2024-01-09 10:43:34 -08:00
* On ` Ubuntu`
2023-11-21 11:08:36 -07:00
` ``shell
2023-11-29 02:38:24 +05:30
sudo apt install ffmpeg libavcodec-dev libavformat-dev libavutil-dev
2023-11-06 08:51:47 -08:00
` ``
2024-01-09 10:43:34 -08:00
* On ` RHEL`/` SLES` - install ffmpeg development packages manually or use ` rocDecode-setup.py` script
2023-11-06 08:51:47 -08:00
2023-11-21 11:08:36 -07:00
## Docker
2023-10-12 14:08:12 -07:00
Docker files to build rocDecode containers are available [here](docker/)
## Documentation
Run the steps below to build documentation locally.
2023-11-21 11:08:36 -07:00
* Sphinx
` ``shell
cd docs
pip3 install -r sphinx/requirements.txt
python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html
2023-10-12 14:08:12 -07:00
` ``
2023-11-21 11:08:36 -07:00
* Doxygen
` ``shell
2023-10-12 14:08:12 -07:00
doxygen .Doxyfile
` ``
## Tested configurations
* Linux distribution
2023-11-21 11:08:36 -07:00
* Ubuntu - ` 20.04` / ` 22.04`
2024-01-09 10:43:34 -08:00
* RHEL - ` 8` / ` 9`
* SLES - ` 15-SP4`
2023-11-21 11:08:36 -07:00
* ROCm:
* rocm-core - ` 5.6.1.50601-93`
* amdgpu-core - ` 1:5.6.50601-1649308`
2023-11-23 05:57:45 -08:00
* FFMPEG - ` 4.2.7` / ` 4.4.2-0`
2024-01-09 10:43:34 -08:00
* rocDecode Setup Script - ` V1.4`