C/C++ Sample Apps Source Details

The DeepStream SDK package includes the following archives. These archives contain plugins, libraries, applications, and source code.
The sources directory is located at /opt/nvidia/deepstream/deepstream-5.0/sources for Debian installation (on Jetson or dGPU) and for installation by SDK Manager. For tar packages the source files are in the extracted deepstream package.
DeepStream Python bindings and sample applications are available as a separate package. More information and documentation can be found at https://github.com/NVIDIA-AI-IOT/deepstream_python_apps.

Sample Application Source Details

The following table shows the location of the sample test applications.
Reference
test application
Path inside
sources directory
Description
Sample test application 1
apps/sample_apps/deepstream-test1
Sample example of how to use DeepStream elements for a single H.264 stream: filesrc→ decode→ nvstreammux→ nvinfer (primary detector)→ nvdsosd→ renderer.
Sample test application 2
apps/sample_apps/deepstream-test2
Sample example of how to use DeepStream elements for a single H.264 stream: filesrc→ decode→ nvstreammux→ nvinfer (primary detector)→ nvtracker→ nvinfer (secondary classifier)→ nvdsosd → renderer.
Sample test application 3
apps/sample_apps/deepstream-test3
Builds on deepstream-test1 (simple test application 1) to demonstrate how to:
Use multiple sources in the pipeline
Use a uridecodebin to accept any type of input (e.g. RTSP/File), any GStreamer supported container format, and any codec
Configure Gst-nvstreammux to generate a batch of frames and infer on it for better resource utilization
Extract the stream metadata, which contains useful information about the frames in the batched buffer
Sample test application 4
apps/sample_apps/deepstream-test4
Builds on deepstream-test1 for a single H.264 stream: filesrc, decode, nvstreammux, nvinfer, nvdsosd, renderer to demonstrate how to:
Use the Gst-nvmsgconv and Gst-nvmsgbroker plugins in the pipeline
Create NVDS_META_EVENT_MSG type metadata and attach it to the buffer
Use NVDS_META_EVENT_MSG for different types of objects, e.g. vehicle and person
Implement “copy” and “free” functions for use if metadata is extended through the extMsg field
Sample test application 5
apps/sample_apps/deepstream-test5
Builds on top of deepstream-app. Demonstrates:
Use of Gst-nvmsgconv and Gst-nvmsgbroker plugins in the pipeline for multistream
How to configure Gst-nvmsgbroker plugin from the config file as a sink plugin (for KAFKA, Azure, etc.)
How to handle the RTCP sender reports from RTSP servers or cameras and translate the Gst Buffer PTS to a UTC timestamp.
For more details refer the RTCP Sender Report callback function test5_rtcp_sender_report_callback() registration and usage in deepstream_test5_app_main.c.
GStreamer callback registration with rtpmanager element’s “handle-sync” signal is documented in apps-common/src/deepstream_source_bin.c.
AMQP protocol test application
libs/amqp_protocol_adaptor
Application to test AMQP protocol.
Azure MQTT test application
libs/azure_protocol_adaptor
Test application to show Azure IoT device2edge messaging and device2cloud messaging using MQTT.
DeepStream reference application
apps/sample_apps/deepstream-app
Source code for the DeepStream reference application.
UFF SSD detector
sources/objectDetector_SSD
Configuration files and custom library implementation for the SSD detector model.
Faster RCNN detector
sources/objectDetector_FasterRCNN
Configuration files and custom library implementation for the FasterRCNN model.
Yolo detector
sources/objectDetector_Yolo
Configuration files and custom library implementation for the Yolo models, currently Yolo v2, v2 tiny, v3, and v3 tiny.
Dewarper example
apps/sample_apps/deepstream-dewarper-test
Demonstrates dewarper functionality for single or multiple 360-degree camera streams. Reads camera calibration parameters from a CSV file and renders aisle and spot surfaces on the display.
Optical flow example
apps/sample_apps/deepstream-nvof-test
Demonstrates optical flow functionality for single or multiple streams. This example uses two GStreamer plugins (Gst-nvof and Gst-nvofvisual). The Gst-nvof element generates the MV (motion vector) data and attaches it as user metadata. The Gst-nvofvisual element visualizes the MV data using a predefined color wheel matrix.
Custom meta data example
apps/sample_apps/deepstream-user-metadata-test
Demonstrates how to add custom or user-specific metadata to any component of DeepStream. The test code attaches a 16-byte array filled with user data to the chosen component. The data is retrieved in another component.
MJPEG and JPEG decoder and inferencing example
apps/sample_apps/deepstream-image-decode-test
Builds on deepstream-test3 to demonstrate image decoding instead of video. This example uses a custom decode bin so the MJPEG codec can be used as input.
Image/Video segmentation example
apps/sample_apps/deepstream-segmentation-test
Demonstrates segmentation of multi-stream video or images using a semantic or industrial neural network and rendering output to a display.
Handling metadata before Gst-nvstreammux
apps/sample_apps/deepstream-gst-metadata-test
Demonstrates how to set metadata before the Gst-nvstreammux plugin in the DeepStream pipeline, and how to access it after Gst-nvstreammux.
Gst-nvinfer tensor meta flow example
apps/sample_apps/deepstream-infer-tensor-meta-app
Demonstrates how to flow and access nvinfer tensor output as metadata.
Performance demo
apps/sample_apps/deepstream-perf-demo
Performs single channel cascaded inferencing and object tracking sequentially on all streams in a directory.
Analytics example
apps/sample_apps/deepstream-nvdsanalytics-test
Demonstrates batched analytics like ROI filtering, Line crossing, direction detection and overcrowding
OpenCV example
apps/sample_apps/deepstream-opencv-test
Demonstrates the use of OpenCV in dsexample plugin
Image as Metadata example
Apps/sample_apps / deepstream-image-meta-test
Demonstrates how to attach encoded image as meta data and save the images in jpeg format.
Appsrc and Appsink example
apps/sample_apps/deepstream-appsrc-test
Demonstrates AppSrc and AppSink usage for consuming and giving data from non DeepStream code respectively.
Transfer learning example
apps/sample_apps/ deepstream-transfer-learning-app
Demonstrates a mechanism to save the images for objects which have lesser confidence and the same can be used for training further
Mask-RCNN example
apps/sample_apps/ deepstream-mrcnn-test
Demonstrates Instance segmentation using Mask-RCNN model
 

Plugin and Library Source Details

The following table describes the contents of the sources directory except for the reference test applications, which are listed separately below.
Plugin or library
Path inside
sources directory
Description
DsExample GStreamer plugin
gst-plugins/gst-dsexample
Template plugin for integrating custom algorithms into DeepStream SDK graph.
GStreamer Gst-nvmsgconv plugin
gst-plugins/gst-nvmsgconv
Source code for the GStreamer Gst-nvmsgconv plugin for converting metadata to schema format.
GStreamer Gst-nvmsgbroker plugin
gst-plugins/gst-nvmsgbroker
Source code for the GStreamer Gst-nvmsgbroker plugin for sending data to the server.
GStreamer Gst-nvinfer plugin
gst-plugins/gst-nvinfer
Source code for the GStreamer Gst-nvinfer plugin for inference.
GStreamer Gst-nvdsosd plugin
gst-plugins/gst-nvdsosd
Source code for the GStreamer Gst-nvdsosd plugin for drawing bboxes, text and other objects.
NvDsInfer library
libs/nvdsinfer
Source code for the NvDsInfer library, used by the Gst-nvinfer GStreamer plugin.
NvMsgConv library
libs/nvmsgsconv
Source code for the NvMsgConv library, required by the Gst-nvmsgconv GStreamer plugin.
Kafka protocol adapter
libs/kafka_protocol_adapter
Protocol adapter for Kafka.
nvdsinfer_customparser
libs/nvdsinfer_customparser
Custom model output parsing example for detectors and classifiers.
Gst-v4l2
See the note below *
Source code for v4l2 codecs.
* Gst-v4l2 sources are not present in DeepStream package. To download, follow these steps:
2. In the “Search filter” field, enter “L4T sources.”
3. Select the appropriate item for L4T Release 32.4.3.
4. Download the file and un-tar it, yielding a .tbz2 file.
5. Expand the .tbz2 file. Gst-v4l2 source files are in gst-nvvideo4linux2_src.tbz2.