Fichiers
rocm-systems/projects/rocdecode/samples/videoDecode/README.md
T

Les révisions dans .git-blame-ignore-revs sont ignorées. Vous pouvez quand même voir ces blâmes.

42 lignes
2.2 KiB
Markdown
Brut Vue normale Historique

2024-01-26 05:19:24 -08:00
# Video decode sample
2023-11-06 08:51:47 -08:00
2024-02-09 10:31:44 -08:00
The video decode sample illustrates decoding a single packetized video stream using FFMPEG demuxer, video parser, and rocDecoder to get the individual decoded frames in YUV format. This sample can be configured with a device ID and optionally able to dump the output to a file. This sample uses the high-level RocVideoDecoder class which connects both the video parser and Rocdecoder. This process repeats in a loop until all frames have been decoded.
2023-11-06 08:51:47 -08:00
2024-01-26 05:19:24 -08:00
## Prerequisites:
2023-11-06 08:51:47 -08:00
2024-01-26 05:19:24 -08:00
* Install [rocDecode](../../README.md#build-and-install-instructions)
2023-11-06 08:51:47 -08:00
2024-01-26 05:19:24 -08:00
* [FFMPEG](https://ffmpeg.org/about.html)
2023-11-06 08:51:47 -08:00
2024-01-26 05:19:24 -08:00
* On `Ubuntu`
2023-11-06 08:51:47 -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-06 08:51:47 -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-06 08:51:47 -08:00
## Build
2024-01-26 05:19:24 -08:00
```shell
mkdir video_decode_sample && cd video_decode_sample
2023-11-06 08:51:47 -08:00
cmake ../
make -j
2023-11-06 08:51:47 -08:00
```
2024-01-26 05:19:24 -08:00
## Run
```shell
2023-11-06 08:51:47 -08:00
./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]>
-f <Number of decoded frames - specify the number of pictures to be decoded [optional]>
2023-11-29 08:21:22 -08:00
-z <force_zero_latency - Decoded frames will be flushed out for display immediately [optional]>
-disp_delay <display delay - specify the number of frames to be delayed for display [optional - default: 1]>
2023-11-29 08:21:22 -08:00
-sei <extract SEI messages [optional]>
-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]>
-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]>
2024-12-05 09:46:24 -05:00
-no_ffmpeg_demux <use the built-in bitstream reader instead of FFMPEG demuxer to obtain picture data [optional]>
```