Skip to content

Latest commit

 

History

History
464 lines (404 loc) · 15.5 KB

examples-basic-pipelines.md

File metadata and controls

464 lines (404 loc) · 15.5 KB

Basic Inference Pipelines with different Sources and Sinks

This page documents the following "Basic Inference Pipelines" consiting of


CSI Source, Primary GIE, OSD, and 3D Window Sink

#
# The simple example demonstrates how to create a set of Pipeline components, 
# specifically:
#   - CSI Source
#   - Primary GST Inference Engine (PGIE)
#   - On-Screen Display
#   - 3D Sink
# ...and how to add them to a new Pipeline and play.
#
# IMPORTANT! this examples uses a CSI Camera Source and 3D Sink - Jetson only!
#


File Source, Primary GIE, IOU Tracker, OSD, EGL Window Sink, and File Sink

#
# The simple example demonstrates how to create a set of Pipeline components, 
# specifically:
#   - File Source
#   - Primary GST Inference Engine (PGIE)
#   - IOU Tracker
#   - On-Screen Display (OSD)
#   - Window Sink
#   - File Sink to encode and save the stream to file.
# ...and how to add them to a new Pipeline and play
# 
# The example registers handler callback functions with the Pipeline for:
#   - key-release events
#   - delete-window events
#   - end-of-stream EOS events
#   - Pipeline change-of-state events
#  


File Source, Primary GIE, IOU Tracker, OSD, EGL Window Sink, and RTSP Sink

#
# This simple example demonstrates how to create a set of Pipeline components, 
# specifically:
#   - A File Source
#   - Primary GST Inference Engine (PGIE)
#   - IOU Tracker
#   - On-Screen Display
#   - Window Sink
#   - RTSP Sink
# ...and how to add them to a new Pipeline and play.
#
# The example registers handler callback functions for:
#   - key-release events
#   - delete-window events
#   - end-of-stream EOS events
#   - Pipeline change-of-state events
#  


File Source, Primary GIE, IOU Tracker, OSD, EGL Window Sink, and V4L2 Sink

#
# This simple example demonstrates how to create a set of Pipeline components, 
# specifically:
#   - A File Source
#   - Primary GST Inference Engine (PGIE)
#   - IOU Tracker
#   - On-Screen Display
#   - Window Sink
#   - V4L2 Sink
# ...and how to add them to a new Pipeline and play.
#
# The V4L2 Sink is used to display video to v4l2 video devices. 
# 
# V4L2 Loopback can be used to create "virtual video devices". Normal (v4l2) 
# applications will read these devices as if they were ordinary video devices.
# See: https://github.com/umlaeute/v4l2loopback for more information.
#
# You can install v4l2loopback with
#    $ sudo apt-get install v4l2loopback-dkms
#
# Run the following to setup '/dev/video3'
#    $ sudo modprobe v4l2loopback video_nr=3
#
# When the script is running, you can use the following GStreamer launch 
# command to test the loopback
#    $ gst-launch-1.0 v4l2src device=/dev/video3 ! videoconvert  ! xvimagesink
#
# The example registers handler callback functions for:
#   - key-release events
#   - delete-window events
#   - end-of-stream EOS events
#   - Pipeline change-of-state events
#  


File Source, Primary GIE, DCF Tracker, 2 Secondary GIEs, OSD, EGL Windon Sink

#
# The simple example demonstrates how to create a set of Pipeline components, 
# specifically:
#   - File Source
#   - Primary GST Inference Engine (PGIE)
#   - DCF Tracker
#   - 2 Secondary GST Inference Engines (SGIEs)
#   - On-Screen Display (OSD)
#   - Window Sink
# ...and how to add them to a new Pipeline and play
# 
# The example registers handler callback functions with the Pipeline for:
#   - key-release events
#   - delete-window events
#   - end-of-stream EOS events
#   - Pipeline change-of-state events
#  


RTSP Source, Primary GIE, IOU Tracker, OSD, EGL Window Sink

#
# The simple example demonstrates how to create a set of Pipeline components, 
# specifically:
#   - RTSP Source
#   - Primary GST Inference Engine (PGIE)
#   - DCF Tracker
#   - On-Screen Display (OSD)
#   - Window Sink
# ...and how to add them to a new Pipeline and play
# 
# The example registers handler callback functions with the Pipeline for:
#   - key-release events
#   - delete-window events
#   - end-of-stream EOS events
#   - error-message events
#   - Pipeline change-of-state events
#   - RTSP Source change-of-state events.
#  
# IMPORTANT! The error-message-handler callback fucntion will stop the Pipeline 
# and main-loop, and then exit. If the error condition is due to a camera
# connection failure, the application could choose to let the RTSP Source's
# connection manager periodically reattempt connection for some length of time.
#


HTTP Source, Primary GIE, IOU Tracker, OSD, EGL Window Sink

################################################################################
#
# The simple example demonstrates how to create a set of Pipeline components, 
# specifically:
#   - HTTP URI Source
#   - Primary GST Inference Engine (PGIE)
#   - IOU Tracker
#   - On-Screen Display (OSD)
#   - Window Sink
# ...and how to add them to a new Pipeline and play
# 
# The example registers handler callback functions with the Pipeline for:
#   - component-buffering messages
#   - key-release events
#   - delete-window events
#   - end-of-stream EOS events
#   - Pipeline change-of-state events
#  
# IMPORTANT! The URI Source will send messages on the Pipeline bus when
# buffering is in progress.  The buffering_message_handler callback is 
# added to the Pipeline to be called with every buffer message received.
# The handler callback is required to pause the Pipeline while buffering
# is in progress. 
#
# The callback is called with the percentage of buffering done, with 
# 100% indicating that buffering is complete.
#
################################################################################


File Source, Preprocessor, Primary GIE, IOU Tracker, OSD, EGL Window Sink

#
# The simple example demonstrates how to create a set of Pipeline components, 
# specifically:
#   - URI Source
#   - Preprocessor
#   - Primary GIE
#   - IOU Tracker
#   - On-Screen Display
#   - Window Sink
# ...and how to add them to a new Pipeline and play
#
# Specific services must be called for the PGIE to be able to receive tensor-meta
# buffers from the Preprocessor component.
# 
# The example registers handler callback functions with the Pipeline for:
#   - key-release events
#   - delete-window events
#   - end-of-stream EOS events
#   - Pipeline change-of-state events
#  


File Source, Primary TIS, DSF Tracker, OSD, EGL Window Sink

#
# The example demonstrates how to create a set of Pipeline components, 
# specifically:
#   - File Source
#   - Primary Triton Inference Server (PTIS)
#   - NcDCF Low Level Tracker
#   - On-Screen Display
#   - Window Sink
# ...and how to add them to a new Pipeline and play
# 
# The example registers handler callback functions with the Pipeline for:
#   - key-release events
#   - delete-window events
#   - end-of-stream EOS events
#   - Pipeline change-of-state events
#  


File Source, Primary TIS, IOU Tracker, OSD, EGL Window Sink

#
# The example demonstrates how to create a set of Pipeline components, 
# specifically:
#   - File Source
#   - Primary Triton Inference Server (PTIS)
#   - IOU Tracker
#   - On-Screen Display
#   - Window Sink
# ...and how to add them to a new Pipeline and play
# 
# The example registers handler callback functions with the Pipeline for:
#   - key-release events
#   - delete-window events
#   - end-of-stream EOS events
#   - Pipeline change-of-state events
#  


File Source, Primary TIS, IOU Tracker, 2 Secondary TIS, OSD, EGL Window Sink

#
# The example demonstrates how to create a set of Pipeline components, 
# specifically:
#   - File Source
#   - Primary Triton Inference Server (PTIS)
#   - 2 Secondary Triton Inference Servers(STIS)
#   - IOU Tracker
#   - On-Screen Display
#   - Window Sink
# ...and how to add them to a new Pipeline and play
# 
# The example registers handler callback functions with the Pipeline for:
#   - key-release events
#   - delete-window events
#   - end-of-stream EOS events
#   - Pipeline change-of-state events
#  


Image Source, Primary GIE, OSD, and EGL Window Sink

#
# The example demonstrates how to create a set of Pipeline components, 
# specifically:
#   - Image Source - single image to EOS
#   - Primary GST Inference Engine (PGIE)
#   - On-Screen Display
#   - Window Sink
# ...and how to add them to a new Pipeline and play
# 
# The example registers handler callback functions with the Pipeline for:
#   - key-release events
#   - delete-window events
#   - end-of-stream EOS events
#   - Pipeline change-of-state events
#  


URI Source, Primary GIE, IOU Tracker, and App Sink

#
# The simple example demonstrates how to create a set of Pipeline components, 
# specifically:
#   - URI Source
#   - Primary GST Inference Engine (PGIE)
#   - IOU Tracker
#   - APP Sink
# ...and how to add them to a new Pipeline and play
# 
# A "new_buffer_handler_cb" is added to the APP Sink to process the frame
# and object meta-data for each buffer received
#


V4L2 Source, Primary GIE, IOU Tracker, OSD, and EGL Window Sink

#
# The simple example demonstrates how to create a set of Pipeline components, 
# specifically:
#   - V4L2 Source - Web Camera
#   - Primary GST Inference Engine (PGIE)
#   - IOU Tracker
#   - On-Screen Display
#   - Window Sink
# ...and how to add them to a new Pipeline and play
# 
# The example registers handler callback functions with the Pipeline for:
#   - key-release events
#   - delete-window events
#
# The key-release handler function will update the V4L2 device picture settings
# based on the key value as follows during runtime.
#   * brightness - or more correctly the black level. 
#                  enter 'B' to increase, 'b' to decrease
#   * contrast   - color contrast setting or luma gain.
#                  enter 'C' to increase, 'c' to decrease
#   * hue        - color hue or color balence.
#                  enter 'H' to increase, 'h' to decrease
#
# The Picture Settings are all integer values, range 

App Source, Primary TIE, IOU Tracker, OSD, and EGL Window Sink

# 
# This example illustrates how to push raw video buffers to a DSL Pipeline
# using an App Source component. The example application adds the following
# client handlers to control the input of raw buffers to the App Source
#   * need_data_handler   - called when the App Source needs data to process
#   * enough_data_handler - called when the App Source has enough data to process
# 
# The client handlers add/remove a callback function to read, map, and push data
# to the App Source called "read_and_push_data". 
# 
# The raw video file used with this example is created by executing the following 
# gst-launch-1.0 command.
# 
# gst-launch-1.0 uridecodebin \
#       uri=file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.mp4 \
#       ! nvvideoconvert ! 'video/x-raw, format=I420, width=1280, height=720' \
#       ! filesink location=./sample_720p.i420
#