2024-01-26 05:19:24 -08:00
|
|
|
# Video decode performance 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-10 08:23:44 -08:00
|
|
|
|
2024-02-09 10:31:44 -08:00
|
|
|
This sample uses multiple threads to decode the same input video parallelly.
|
2023-11-10 08:23:44 -08:00
|
|
|
|
|
|
|
|
## Prerequisites:
|
|
|
|
|
|
2024-01-26 05:19:24 -08:00
|
|
|
* Install [rocDecode](../../README.md#build-and-install-instructions)
|
2023-11-10 08:23:44 -08:00
|
|
|
|
2024-01-26 05:19:24 -08:00
|
|
|
* [FFMPEG](https://ffmpeg.org/about.html)
|
2023-11-10 08:23:44 -08:00
|
|
|
|
2024-01-26 05:19:24 -08:00
|
|
|
* On `Ubuntu`
|
2023-11-10 08:23:44 -08:00
|
|
|
|
2024-01-26 05:19:24 -08:00
|
|
|
```shell
|
2025-01-02 06:42:31 -08:00
|
|
|
sudo apt install libavcodec-dev libavformat-dev libavutil-dev
|
2023-11-10 08:23:44 -08:00
|
|
|
```
|
2024-01-26 05:19:24 -08:00
|
|
|
|
|
|
|
|
* On `RHEL`/`SLES` - install ffmpeg development packages manually or use [rocDecode-setup.py](../../rocDecode-setup.py) script
|
2023-11-10 08:23:44 -08:00
|
|
|
|
|
|
|
|
## Build
|
2024-01-26 05:19:24 -08:00
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
mkdir video_decode_perf_sample && cd video_decode_perf_sample
|
2023-11-10 08:23:44 -08:00
|
|
|
cmake ../
|
|
|
|
|
make -j
|
|
|
|
|
```
|
2024-01-26 05:19:24 -08:00
|
|
|
|
|
|
|
|
## Run
|
|
|
|
|
|
|
|
|
|
```shell
|
2023-11-10 08:23:44 -08:00
|
|
|
./videodecodeperf -i <input video file [required]>
|
2024-08-12 09:39:43 -04:00
|
|
|
-t <number of threads [optional - default:1]>
|
|
|
|
|
-f <Number of decoded frames - specify the number of pictures to be decoded [optional]>
|
|
|
|
|
-disp_delay <display delay - specify the number of frames to be delayed for display [optional]>
|
2023-11-29 08:21:22 -08:00
|
|
|
-d <Device ID (>= 0) [optional - default:0]>
|
|
|
|
|
-z <force_zero_latency - Decoded frames will be flushed out for display immediately [optional]>
|
2024-09-24 19:06:50 -04:00
|
|
|
-m <Memory type (integer values between 0 to 3: specifies where to store the decoded output:
|
|
|
|
|
0 = decoded output will be in internal interopped memory,
|
|
|
|
|
1 = decoded output will be copied to a separate device memory
|
|
|
|
|
2 = decoded output will be copied to a separate host memory
|
|
|
|
|
3 = decoded output will not be available (decode only)) [optional; default: 3]>
|
2023-11-10 08:23:44 -08:00
|
|
|
```
|