1 Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 @page ee_camcap_tensorrt_multichannel_group Camera Capture with TensorRT and Multi-Channel Encoding
6 - [Overview](#overview)
7 - [Key Classes and Methods](#key)
8 - [Command Line Options](#commands_line_options)
9 - [Commands](#commands)
11 #### Requirements ####
15 - - - - - - - - - - - - - - -
19 This sample demonstrates four different resolutions of video capture coming out
20 of camera sensor directly. Among these streams, three of them go through the
21 encoding process and are saved as H.264 or H.265 file. The fourth stream
22 provides full resolution and uses NVIDIA<sup>®</sup> TensorRT<sup>&tm;</sup>
23 to perform
object detection. If target
object is detected, it will draw a
24 bounding box around the
object on the frame. Finally, the frame with the
25 bounding box is rendered on the display and simultaneously encoded as an H.264
28 #### Detailed Buffer Management ####
29 
31 #### Buffer Flow of the Frontend Using GIE ####
32 
35 - - - - - - - - - - - - - - -
37 ## Key Classes and Methods ##
39 For information on libargus, see @ref mmapi_argus_group. For information on EGLStream, see documentation on the Khronos web site.
41 ### StreamConsumer Class ###
45 |StreamConsumer|A base
class of the libargus `OutputStream` consumer. It contains a dedicated thread to poll frames from Argus::OutputStream.|
47 The following table describes key `StreamConsumer` members.
51 |setOutputStream|Sets OutputStream which be used to create the FrameConsumer.|
52 |getSize|Gets stream resolution.|
53 |threadInitialize|Virtual method that initializes the consumer thread.|
54 |threadExecute|Virtual method that manages the thread loop.|
55 |threadShutdown|Virtual method that destroys the consumer thread.|
56 |processFrame|Virtual method that handles one frame.|
58 ### VideoEncoder Class ###
62 |VideoEncoder|This is a utility class to simplify the use of V4L2 video encoder.|
64 The following table describes key `VideoEncoder` members.
68 |VideoEncoder|Constructor in which to specify resolution, output video filename, and select encoding format.|
69 |initialize|Initialize video encoder and stream consumer.|
70 |shutdown|Destroy resources.|
71 |setBufferDoneCallback|Set callback to return buffer to caller.|
72 |encodeFromFd|Feed the encoder with a new buffer.|
74 ### VideoStreamConsumer Class ###
78 |VideoStreamConsumer|This class is a derived class of StreamConsumer to support video encoding. It reuses the VideoEncoder object for video encoding.|
80 The following table describes key `VideoStreamConsumer` members.
84 |VideoEncodeStreamConsumer|Constructor in which to specify the name of the consumer, output video filename and select encoding format.|
85 |threadInitialize|Initializes the video encoder and stream consumer.|
86 |threadShutdown|Destroys resources.|
87 |processFrame|Receives frames and pushes them to the encoder.|
89 ### GIEStreamConsumer Class ###
93 |GIEStreamConsumer|This class is a derived class of StreamConsumer to support TensorRT (GIE) inference. It also has a VideoEncoder object to support video encoding.|
95 The following table describes key `GIEStreamConsumer` members.
99 |GIEStreamConsumer|Constructor in which to specify the name of the consumer, output video filename and select encoding format.|
100 |threadInitialize|Initializes TensorRT (GIE) context, video encoder and stream consumer.|
101 |threadShutdown|Destroys resources.|
102 |processFrame|Receives frames and prepares them for the TensorRT (GIE) inference.|
103 |setDeployFile|Sets the deploy file for building the TensorRT (GIE) context.|
104 |setModelFile|Sets the model file for building the TensorRT (GIE) context.|
105 |RenderThreadProc|Loops to draw the bounding box, render the frame, and encode the video.|
106 |GIEThreadProc|Loops to do the TensorRT (GIE) inference.|
109 - - - - - - - - - - - - - - -
110 <a name="commands_line_options">
111 ## Command Line Options ##
115 Enter the following command to view the supported options.
120 - - - - - - - - - - - - - - -