![]() |
Multimedia API ReferenceNovember 16, 2016 | 24.2.1 Release |
This sample demonstrates the simplest way to use NVIDIA® TensorRT™ to decode video and save the bounding box information to the result.txt
file. TensorRT was previously known as GPU Inference Engine (GIE).
The data pipeline is as follow:
Input video file -> Decoder -> VIC -> TensorRT Inference -> Plain text file with Bounding Box info
The sample does the following:
The block diagram contains not only the pipeline, but also the memory sharing information among different engines, which can be a reference for the other samples.
Before running the sample, you must have the following:
This samples does not require a Camera or display.
This sample uses the following key structures and classes:
The global structure context_t
manages all the resources in the application.
Element | Description |
---|---|
NvVideoDecoder | Contains all video decoding-related elements and functions. |
NvVideoConverter | Contains elements and functions for video format conversion. |
EGLDisplay | The EGLImage used for CUDA processing. |
conv_output_plane_buf_queue | Output plane queue for video conversion. |
GIE_Context | Provide a series of interfaces to load Caffemodel and do inference. |
Member | Description |
---|---|
decCaptureLoop | Get buffers from dec capture plane and push to converter, and handle resolution change. |
Conv outputPlane dqThread | Return the buffers dequeued from converter output plane to decoder capture plane. |
Conv captuerPlane dqThread | Get buffers from conv capture plane and push to the TensorRT buffer queue. |
gieThread | CUDA process and doing inference. |
$ ./video_dec_cuda <in-file> <in-format> --bbox-file result.txt
The default deploy file is
GoogleNet-modified.prototxt
The default model file is
GoogleNet-modified-online_iter_30000.caffemodel
In this directory:
$SDKDIR/data/model
End-of-stream (EOS) process:
a. Completely read the file.
b. Push a null v4l2buf
to decoder.
c. Decoder waits for all output plane buffers to return.
d. Set get_eos
:
decCap thread exit
e. End the TensorRT thread.
f. Send EOS to the converter:
conv output plane dqThread callback return false conv output plane dqThread exit conv capture plane dqThread callback return false conv capture plane dqThread exit
g. Delete the decoder:
deinit output plane and capture plane buffers
h. Delete the converter:
unmap capture plane buffers
./video_dec_gie <in-file> <in-format> [options]
Option | Description |
---|---|
-- gie-deployfile | Sets deploy file name. |
-- gie-modelfile | Sets the model file name. |
-- gie-float32 <int> | Specifies to use float16 or not[0-2], where <int> is one of the following:
|
-- gie-enable-perf | Enables performance measurement. |