.. _DS_plugin_gst-nvmultiurisrcbin: Gst-nvmultiurisrcbin (Alpha) ============================= .. note:: The DeepStream 6.2 introduces nvmultiurisrcbin with REST API support for dynamic sensor add/remove capability. This is an Alpha feature. This bin integrates three major DeepStream components viz. :ref:`nvds_rest_server`, nvurisrcbin, and nvstreammux (:ref:`DS_plugin_gst-nvstreammux2` / :ref:`\DS_plugin_gst-nvstreammux`) into a single GstBin. For more details on `nvurisrcbin`, please run `gst-inspect-1.0 nvurisrcbin` on a machine/docker container with DeepStream installed. The bin allows users to create simple gstreamer pipelines for AI multimedia analytics. Users can add or remove sensors over REST API calls made to a HTTP endpoint. A sensor is defined as a streaming entity with a valid unique Sensor ID, and URI. The below High Level Overview diagram and table illustrate how nvmultiurisrcbin integrates nvds_rest_server, nvurisrcbin, and nvstreammux. .. image:: ../content/DS_plugin_gst-nvmultiurisrcbin_high_level_overview.png :align: center :alt: Gst-nvmultiurisrcbin High Level Overview .. csv-table:: Gst-nvmultiurisrcbin High Level Overview of integrated components :file: ../text/tables/Gst-nvmultiurisrcbin/DS_Plugin_gst-nvmultiurisrcbin-high-level-components.csv :widths: 30, 30 :header-rows: 1 1. Introduction -------------------- This GstBin is a GStreamer source bin. The bin exposes only one source pad that provide batched buffers from an nvstreammux instance. Users can add/remove streams to the bin for batching over the REST APIs defined in the Section :ref:`REST API Payload definitions `. Users can also provide a static list of streams and their sensor IDs to start the pipeline with. This can be done using the Gst properties uri-list and sensor-id-list described below. The nvmultiurisrcbin component output batched buffers from an nvstreammux instance. Users can set environment variable USE_NEW_NVSTREAMMUX=yes to load the :ref:`DS_plugin_gst-nvstreammux2` instead of the default :ref:`\DS_plugin_gst-nvstreammux`. 2. Features ------------ The following table summarizes the features of the bin. .. csv-table:: Gst-nvmultiurisrcbin features :file: ../text/tables/Gst-nvmultiurisrcbin/DS_Plugin_gst-nvmultiurisrcbin-features.csv :widths: 30, 30, 30 :header-rows: 1 3. How to use nvmultiurisrcbin in a pipeline ---------------------------------------------- Below pipeline is a sample gstreamer pipeline which is configured to accept upto 10 input sources and the pipline starts up with two sources: :: gst-launch-1.0 nvmultiurisrcbin \ port=9000 ip=localhost \ batched-push-timeout=33333 max-batch-size=10 \ drop-pipeline-eos=1 live-source=1 \ uri-list=file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4,file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4 width=1920 height=1080 \ ! nvmultistreamtiler ! nveglglessink Below diagram illustrates a similar pipeline (with different plugins like nvinfer, nvmsgconv, and nvmsgbroker downstream). .. image:: ../content/DS_plugin_gst-nvmultiurisrcbin_sample_video_pipeline.png :align: center :alt: Gst-nvmultiurisrcbin sample video pipeline .. _DS_plugin_gst-nvmultiurisrcbin-rest-payload: 3.1 REST API payload definitions and sample curl commands for reference ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3.1.1 ADD a new stream to a DeepStream pipeline ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Payload definition and the sample curl command: :: curl -XPOST 'http://localhost:9000/stream/add' -d '{ "key": "sensor", "value": { "camera_id": "uniqueSensorID1", "camera_name": "front_door", "camera_url": "file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4", "change": "camera_add", "metadata": { "resolution": "1920 x1080", "codec": "h264", "framerate": 30 } }, "headers": { "source": "vst", "created_at": "2021-06-01T14:34:13.417Z" } }' 3.1.2 REMOVE a new stream to a DeepStream pipeline ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Payload definition and the sample curl command: :: curl -XPOST 'http://localhost:9000/stream/remove' -d '{ "key": "sensor", "value": { "camera_id": "uniqueSensorID1", "camera_name": "front_door", "camera_url": "file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4", "change": "camera_remove", "metadata": { "resolution": "1920 x1080", "codec": "h264", "framerate": 30 } }, "headers": { "source": "vst", "created_at": "2021-06-01T14:34:13.417Z" } }' 4. Gst Properties --------------- 4.1 Gst Properties directly configuring nvmultiurisrcbin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. csv-table:: Gst-nvmultiurisrcbin gstreamer properties directly configuring the bin :file: ../text/tables/Gst-nvmultiurisrcbin/DS_Plugin_gst-properties.csv :widths: 25, 25, 25, 25 :header-rows: 1 4.2 Gst Properties to configure each instance of nvurisrcbin created inside this bin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. csv-table:: Gst-nvmultiurisrcbin nvurisrcbin specific properties :file: ../text/tables/Gst-nvmultiurisrcbin/DS_Plugin_gst-properties_nvurisrcbin.csv :widths: 25, 25, 25, 25 :header-rows: 1 4.3 Gst Properties to configure the instance of nvstreammux created inside this bin ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ All properties except “batch-size” can be configured using the same property names as defined for :ref:`nvstreammux here ` and :ref:`new nvstreammux2 here `. 5. Important Notes ----------------- 5.1 nvmultiurisrcbin config recommendations and notes on expected behavior ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. csv-table:: Gst-nvmultiurisrcbin recommendations :file: ../text/tables/Gst-nvmultiurisrcbin/DS_Plugin_gst-nvmultiurisrcbin-recommended-property-values.csv :widths: 1, 30 :header-rows: 1 6. Known Issues --------------- .. csv-table:: Gst-nvmultiurisrcbin known issues :file: ../text/tables/Gst-nvmultiurisrcbin/DS_Plugin_gst-nvmultiurisrcbin-known-issues.csv :widths: 1, 30 :header-rows: 1