Dateien

Revisionen in .git-blame-ignore-revs werden ignoriert. Klicke hier, um das zu umgehen und die normale Blame-Ansicht zu sehen.

39 Zeilen
1.7 KiB
Markdown

2024-01-26 05:19:24 -08:00
# Video decode memory sample
2024-02-09 10:31:44 -08:00
The video decode memory sample illustrates a way to pass the data chunk-by-chunk sequentially to the FFMPEG demuxer which is then decoded on AMD hardware using rocDecode library.
2024-01-26 05:19:24 -08:00
The sample provides a user class `FileStreamProvider` derived from the existing `VideoDemuxer::StreamProvider` to read a video file and fill the buffer owned by the demuxer. It then takes frames from this buffer for further parsing and decoding.
2024-01-26 05:19:24 -08:00
## Prerequisites:
2024-01-26 05:19:24 -08:00
* Install [rocDecode](../../README.md#build-and-install-instructions)
2024-01-26 05:19:24 -08:00
* [FFMPEG](https://ffmpeg.org/about.html)
2024-01-26 05:19:24 -08:00
* On `Ubuntu`
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
```
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
2024-01-26 05:19:24 -08:00
```shell
mkdir video_decode_mem_sample && cd video_decode_mem_sample
cmake ../
make -j
```
2024-01-26 05:19:24 -08:00
## Run
```shell
./videodecodemem -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]>
-z <force_zero_latency - Decoded frames will be flushed out for display immediately [optional]>
-sei <extract SEI messages [optional]>
-crop <crop rectangle for output (not used when using interopped decoded frame) [optional - default: 0,0,0,0]>
-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/ 3 : OUT_SURFACE_MEM_NOT_MAPPED]>
```