Gst-nvdsudpsink ================ The Gst-nvdsudpsink plugin is a sink type component which can be used to transmit the RTP packets over IP network. Internally, the plugin uses `Rivermax` SDK APIs for network communications. NVIDIA |Rivermax®| offers a unique IP-based solution for any media and data streaming use case. For more details see the `Rivermax Product Page `_. .. |Rivermax®| replace:: Rivermax\ :sup:`®` ``nvdsudpsink`` can operate in three different modes based on the input type and properties set to the component. **RTP packets with Rivermax Generic API** This is default mode. In this mode nvdsudpsink will receive RTP packets and transmit it to network using Rivermax generic APIs. nvdsudpsink doesn’t require any information about the content of RTP packets. **RTP packets with Rivermax Media API** This mode is for specific use case of SMPTE 2110-20, 30 streams. In this mode, nvdsudpsink supports SMPTE 2110-20 and SMPTE 2110-30 streams with traffic shaping. nvdsudpsink expects RTP packets having either uncompressed audio or video as payload and It will transmit those packets to network using Rivermax media APIs. Since Rivermax media APIs need to know the information about the data being transmitted for it to handle the traffic shaping, nvdsudpsink needs that information for Rivermax initialization in the form of SDP file. * This mode can be enabled by setting ``sdp-file`` property of the component. In this mode, for uncompressed video streams, ``packets-per-line`` and ``payload-size`` properties along with ``sdp-file`` must be set. Similarly, value of ``mtu`` property of payloader component must be same as ``payload-size`` of ``nvdsudpsink``. * For uncompressed audio streams in this mode, ``max-ptime`` and ``ptime-multiple`` properties of payloader component must be set. **Uncompressed data with Rivermax media API** In this mode, nvdsudpsink expects uncompressed audio or video frames directly instead of RTP packets. The component will convert those frames to RTP packets and then transmit over network using Rivermax media API. * This mode will be enabled if in addition to the requirements of mode #2 the incoming data is uncompressed video or audio frames instead of RTP packets. * In this mode, if ``render-thread-core`` property is set, a separate thread will be created to packetize the frame and transmit the packets. That thread will also be bound to the CPU core(s) provided as the value of the property. .. note:: In this mode as uncompressed video input, only YUV 4:2:2 and RGB with 8 or 10 bit depth is supported. **Payload size and packets per line for some of common formats** To calculate the payload size and packets per line, use the following steps: 1. Calculate line stride as follows: :: line stride = (width * pgroup size) / pgroup coverage 2. Divide this stride into number of packets having equal bytes. This will be value of packet-per-line. 3. Add 20 bytes to size of each packet calculated in step 2 for RTP + Payload header. This will be value for payload-size. .. note:: It is assumed that there is only single Sample Row Data per RTP packet and line stride is equally divisible. Following are values for some of the common formats: :: YCbCr-4:2:2 1920x1080 8 bit: payload-size:1300, packets-per-line:3 YCbCr-4:2:2 1920x1080 10 bit: payload-size:1220, packets-per-line:4 YCbCr-4:2:0 1920x1080 8 bit: payload-size:1460, packets-per-line:2 YCbCr-4:2:0 1920x1080 10 bit: payload-size:1220, packets-per-line:3 RGB 1920x1080 8 bit: payload-size:1460, packets-per-line:4 RGB 1920x1080 10 bit: payload-size:1220, packets-per-line:6 Refer to the ``SMPTE ST 2110-20:2017`` for more information. System can also have Gstreamer provided OSS implementation of udp sink (``udpsink``) component. In that case system would have two implementations for udp sink - ``udpsink`` and ``nvdsudpsink``. ``nvdsudpsink`` component can only be used with NVIDIA Mellanox ConnectX-5 and above cards after having installed ``Rivermax`` SDK and its license. * Download and setup the ``Rivermax`` 1.11.x SDK here: https://developer.nvidia.com/networking/rivermax-getting-started. * Follow the instruction on the SDK page to obtain development license for Rivermax or purchase it here: https://store.mellanox.com/categories/ethernet/connectx-smartnics/rivermax-licenses.html. * To select ``nvdsudpsink`` out of two installations, use either ``LOCAL_IFACE_IP`` environment variable or ``local-iface-ip`` property. Use the command below to export the environment variable: :: export LOCAL_IFACE_IP= * ``nvdsudpsink`` component also requires ``CAP_NET_RAW`` capability. Either run the application that uses ``nvdsudpsink`` component with superuser privilege or set the ``CAP_NET_RAW`` capabilities using the following command. :: sudo setcap CAP_NET_RAW=ep For example: :: sudo setcap CAP_NET_RAW=ep /opt/nvidia/deepstream/deepstream/bin/deepstream-app sudo setcap CAP_NET_RAW=ep /usr/bin/gst-launch-1.0 .. image:: /content/DS_plugin_gst-nvdsudpsink.png :align: center :alt: Gst-nvdsudpsrc Inputs and Outputs ------------------- * Inputs * GstBufferList having RTP packets as buffer content. * GstBuffer having uncompressed audio or video frame. * Control parameters * LOCAL_IFACE_IP ENV flag or local-iface-ip property * host * port * chunk-size * packets-per-chunk * payload-size * sdp-file * packets-per-line * internal-thread-core * ptp-src * render-thread-core * Output * None Features --------- The following table summarizes the features of the plugin. .. csv-table:: Gst-nvdsudpsink plugin features :file: ../text/tables/Gst-nvdsudpsink tables/DS_Plugin_gst-nvdsudpsink_features.csv :widths: 30, 30, 30 :header-rows: 1 Gst Properties ---------------- The following table describes the Gst-nvdsudpsink plugin’s Gst properties. .. csv-table:: Gst-nvdsudpsink plugin gst properties :file: ../text/tables/Gst-nvdsudpsink tables/DS_Plugin_gst-nvdsudpsink_gst-properties.csv :widths: 20, 20, 20, 20, 20 :header-rows: 1 Example pipelines ----------------- * Pipeline to transmit 24 bit 2 channel 48k audio stream using Rivermax media API: :: gst-launch-1.0 audiotestsrc wave=8 ! 'audio/x-raw, format=(string)S24BE, rate=48000, channels=2, payload=(int)97' ! rtpL24pay ptime-multiple=1000000 max-ptime=1000000 seqnum-offset=0 pt=97 ! nvdsudpsink host= port= local-iface-ip= sdp-file= internal-thread-core=4 -v --gst-debug=3 * Pipeline with separate payload component to transmit 10bit YUV 4:2:2 1080p30 video stream using Rivermax media API: :: gst-launch-1.0 videotestsrc ! 'video/x-raw, width=1920, height=1080, format=(string)UYVP, framerate=30/1' ! queue ! rtpvrawpay mtu=1220 ! nvdsudpsink host= port= local-iface-ip= payload-size=1220 packets-per-line=4 sdp-file= -v --gst-debug=3 * Pipeline without additional payload component to transmit 10bit YUV 4:2:2 1080p60 video stream using Rivermax media API: :: gst-launch-1.0 videotestsrc ! 'video/x-raw, width=1920, height=1080, format=(string)UYVP, framerate=60/1' ! queue ! nvdsudpsink host= port= local-iface-ip= payload-size=1220 packets-per-line=4 sdp-file= -v --gst-debug=3 * Pipeline that uses PTP hardware clock from NIC: :: gst-launch-1.0 videotestsrc ! 'video/x-raw, width=1920, height=1080, format=(string)UYVP, framerate=60/1' ! queue ! nvdsudpsink host= port= local-iface-ip= payload-size=1220 packets-per-line=4 sdp-file= ptp-src= -v --gst-debug=3 * Pipeline that uses separate render thread and bind it to CPU core(s): :: gst-launch-1.0 videotestsrc ! 'video/x-raw, width=1920, height=1080, format=(string)UYVP, framerate=60/1' ! queue ! nvdsudpsink host= port= local-iface-ip= payload-size=1220 packets-per-line=4 sdp-file= ptp-src= render-thread-core="list of core(s)" sync=0 -v --gst-debug=3