2023-07-26 17:47:47 -04:00
|
|
|
# Video Decode Sample
|
2023-11-29 08:21:22 -08:00
|
|
|
This sample illustrates the FFMPEG demuxer to get the individual frames which are then decoded on AMD hardware using rocDecode library.
|
2023-11-06 08:51:47 -08:00
|
|
|
|
|
|
|
|
## Prerequisites:
|
|
|
|
|
|
|
|
|
|
* Linux distribution
|
|
|
|
|
+ Ubuntu - `20.04` / `22.04`
|
|
|
|
|
|
|
|
|
|
* [ROCm supported hardware](https://rocm.docs.amd.com/en/latest/release/gpu_os_support.html)
|
|
|
|
|
|
|
|
|
|
* Install [ROCm 5.5 or later](https://rocmdocs.amd.com/en/latest/deploy/linux/installer/install.html) with `--usecase=graphics,rocm --no-32`
|
|
|
|
|
|
|
|
|
|
* rocDecode
|
|
|
|
|
|
|
|
|
|
* CMake `3.5` or later
|
|
|
|
|
|
|
|
|
|
* [FFMPEG](https://ffmpeg.org/about.html)
|
|
|
|
|
```
|
2023-11-17 12:46:27 -05:00
|
|
|
sudo apt install ffmpeg
|
2023-11-06 08:51:47 -08:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Build
|
2023-07-26 17:47:47 -04:00
|
|
|
```
|
|
|
|
|
mkdir build
|
|
|
|
|
cd build
|
2023-11-06 08:51:47 -08:00
|
|
|
cmake ../
|
2023-07-26 17:47:47 -04:00
|
|
|
make -j
|
2023-11-06 08:51:47 -08:00
|
|
|
```
|
|
|
|
|
# Run
|
|
|
|
|
```
|
|
|
|
|
./videodecode -i <input video file [required]>
|
|
|
|
|
-o <output path to save decoded YUV frames [optional]>
|
|
|
|
|
-d <GPU device ID - 0:device 0 / 1:device 1/ ... [optional - default:0]>
|
2023-11-29 08:21:22 -08:00
|
|
|
-z <force_zero_latency - Decoded frames will be flushed out for display immediately [optional]>
|
|
|
|
|
-sei <extract SEI messages [optional]>
|
2023-12-05 11:40:39 -05:00
|
|
|
-md5 <generate MD5 message digest on the decoded YUV image sequence [optional]>
|
|
|
|
|
-md5_check MD5_File_Path <generate MD5 message digest on the decoded YUV image sequence and compare to the reference MD5 string in a file [optional]>
|
2023-11-29 08:21:22 -08:00
|
|
|
-crop <crop rectangle for output (not used when using interopped decoded frame) [optional - default: 0,0,0,0]>
|
2023-11-30 05:31:37 -08:00
|
|
|
-m <output_surface_memory_type - decoded surface memory [optional - default: 0][0 : OUT_SURFACE_MEM_DEV_INTERNAL/ 1 : OUT_SURFACE_MEM_DEV_COPIED/ 2 : OUT_SURFACE_MEM_HOST_COPIED]>
|
2023-07-26 17:47:47 -04:00
|
|
|
```
|