Files

Ignorando revisiones en .git-blame-ignore-revs. Haga clic aquí para saltar y para a la vista normal.

36 líneas
1.3 KiB
Markdown

2024-01-26 05:19:24 -08:00
# Video decode RGB sample
2024-02-09 10:31:44 -08:00
This sample illustrates the FFMPEG demuxer to get the individual frames which are then decoded using rocDecode API and optionally color-converted using custom HIP kernels on AMD hardware. This sample converts decoded YUV output to one of the RGB or BGR formats(24bit, 32bit, 464bit) in a separate thread allowing it to run both VCN hardware and compute engine in parallel.
2024-01-26 05:19:24 -08:00
This sample uses HIP kernels to showcase the color conversion. Whenever a frame is ready after decoding, the `ColorSpaceConversionThread` is notified and can be used for post-processing.
## Prerequisites:
* Install [rocDecode](../../README.md#build-and-install-instructions)
* [FFMPEG](https://ffmpeg.org/about.html)
* On `Ubuntu`
```shell
2025-01-02 06:42:31 -08:00
sudo apt install libavcodec-dev libavformat-dev libavutil-dev
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
## Build
```shell
mkdir video_decode_rgb_sample && cd video_decode_rgb_sample
cmake ../
make -j
2024-01-26 05:19:24 -08:00
```
## Run
```shell
./videodecodergb -i <input video file - required>
-o <optional; output path to save decoded YUV frames>
-d <GPU device ID, 0 for the first device, 1 for the second device, etc>
-of <optional: output format bgr, bgra, bgr48, bgr64 etc>
```