Gstreamer libsrt

It would be great for the custom gstreamer to have libsrt support.
Secure Reliable Transport (SRT) is an open source transport technology that optimizes streaming performance across unpredictable networks, such as the Internet.

Is the source for available for the custom gstreamer so this could be compiled.

Gstreamer itself isn’t custom. So long as you install “sudo apt install libgstreamer1.0-dev” and perhaps some other plugin development packages, you can write any plugin you want (as nvidia has done) for gstreamer. Here is the plugin writer’s guide.

Due to Gstreamer’s license, Nvidia couldn’t distribute a closed source version of gstreamer even if they wanted (it’s LGPL). Only some of Nvidia’s plugins are closed source anyways. Many can be found if you “sudo apt install deepstream-4.0” in /opt/nvidia/deepstream/deepstream-4.0/sources/gst-plugins/…

However, if you want secure, reliable, video transport, gstreamer’s RtspServer does support TLS, and transport over TCP. Or you could proxy that through nginx. Examples are here, but you’ll have to swap out the stock elements with Nvidia’s if you want hardware decode/encode or other acceleration. If you want to connect it to a dynamic pipeline there are some examples in the deepstream forum.

Hey. So, I Googled a bit and there is actually already a srtsink for gstreamer, however it’s in the “bad plugins” list which means it my lack tests, may not be currently maintained, or there may be other issues. If you do end up writing a srt plugin, the existing one is probably a good place to start.

Did apt-get install with bad-plugins. Didn’t see it with gst-inspect. Does a build guide for gstreamer with the nvidia support exist where srt could be added in.

It looks like some names have just changed:

$ gst-inspect-1.0 | grep srt
dtls:  dtlssrtpdemux: DTLS SRTP Demultiplexer
dtls:  dtlssrtpenc: DTLS-SRTP Encoder
dtls:  dtlssrtpdec: DTLS-SRTP Decoder
subparse: subparse_typefind: srt, sub, mpsub, mdvd, smi, txt, dks, vtt
subenc:  srtenc: Srt encoder
srtp:  srtpdec: SRTP decoder
srtp:  srtpenc: SRTP encoder

I would suggest looking at the documentation for those with gst-inspect, like:

$ gst-inspect-1.0 srtpenc
Factory Details:
  Rank                     none (0)
  Long-name                SRTP encoder
  Klass                    Filter/Network/SRTP
  Description              A SRTP and SRTCP encoder
  Author                   Gabriel Millaire <millaire.gabriel@collabora.com>

Plugin Details:
  Name                     srtp
  Description              GStreamer SRTP
  Filename                 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstsrtp.so
  Version                  1.14.5
  License                  LGPL
  Source module            gst-plugins-bad
  Source release date      2019-05-29
  Binary package           GStreamer Bad Plugins (Ubuntu)
  Origin URL               https://launchpad.net/distros/ubuntu/+source/gst-plugins-bad1.0

GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstSrtpEnc

Pad Templates:
  SINK template: 'rtcp_sink_%u'
    Availability: On request
    Capabilities:
      application/x-rtcp
  
  SRC template: 'rtcp_src_%u'
    Availability: Sometimes
    Capabilities:
      application/x-srtcp
  
  SINK template: 'rtp_sink_%u'
    Availability: On request
    Capabilities:
      application/x-rtp
  
  SRC template: 'rtp_src_%u'
    Availability: Sometimes
    Capabilities:
      application/x-srtp

Element has no clocking capabilities.
Element has no URI handling capabilities.

Pads:
  none

Element Properties:
  name                : The name of the object
                        flags: readable, writable
                        String. Default: "srtpenc0"
  parent              : The parent of the object
                        flags: readable, writable
                        Object of type "GstObject"
  key                 : Master key (minimum of 30 and maximum of 46 bytes)
                        flags: readable, writable, changeable in NULL, READY, PAUSED or PLAYING state
                        Boxed pointer of type "GstBuffer"
  rtp-cipher          : RTP Cipher
                        flags: readable, writable
                        Enum "GstSrtpCipherType" Default: 1, "aes-128-icm"
                           (0): null             - GST_SRTP_CIPHER_NULL
                           (1): aes-128-icm      - GST_SRTP_CIPHER_AES_128_ICM
                           (2): aes-256-icm      - GST_SRTP_CIPHER_AES_256_ICM
  rtp-auth            : RTP Authentication
                        flags: readable, writable
                        Enum "GstSrtpAuthType" Default: 2, "hmac-sha1-80"
                           (0): null             - GST_SRTP_AUTH_NULL
                           (1): hmac-sha1-32     - GST_SRTP_AUTH_HMAC_SHA1_32
                           (2): hmac-sha1-80     - GST_SRTP_AUTH_HMAC_SHA1_80
  rtcp-cipher         : RTCP Cipher
                        flags: readable, writable
                        Enum "GstSrtpCipherType" Default: 1, "aes-128-icm"
                           (0): null             - GST_SRTP_CIPHER_NULL
                           (1): aes-128-icm      - GST_SRTP_CIPHER_AES_128_ICM
                           (2): aes-256-icm      - GST_SRTP_CIPHER_AES_256_ICM
  rtcp-auth           : RTCP Authentication
                        flags: readable, writable
                        Enum "GstSrtpAuthType" Default: 2, "hmac-sha1-80"
                           (0): null             - GST_SRTP_AUTH_NULL
                           (1): hmac-sha1-32     - GST_SRTP_AUTH_HMAC_SHA1_32
                           (2): hmac-sha1-80     - GST_SRTP_AUTH_HMAC_SHA1_80
  random-key          : Generate a random key if TRUE
                        flags: readable, writable
                        Boolean. Default: false
  replay-window-size  : Size of the replay protection window
                        flags: readable, writable
                        Unsigned Integer. Range: 64 - 32768 Default: 128 
  allow-repeat-tx     : Whether retransmissions of packets with the same sequence number are allowed(Note that such repeated transmissions must have the same RTP payload, or a severe security weakness is introduced!)
                        flags: readable, writable
                        Boolean. Default: false
  stats               : Various statistics
                        flags: readable
                        Boxed pointer of type "GstStructure"
                                                             streams: <  >

Element Signals:
  "pad-added" :  void user_function (GstElement* object,
                                     GstPad* arg0,
                                     gpointer user_data);
  "pad-removed" :  void user_function (GstElement* object,
                                       GstPad* arg0,
                                       gpointer user_data);
  "no-more-pads" :  void user_function (GstElement* object,
                                        gpointer user_data);
  "soft-limit" :  void user_function (GstElement* object,
                                      gpointer user_data);

edit: note that subparse and srtenc are probably not what you’re looking for. Confusingly, .srt is a very popular subtitle format.

The following is from my x86 box thats working. Think they version is missing them on the nano.
srt: srtserversink: SRT sink
srt: srtclientsink: SRT sink
srt: srtserversrc: SRT source
srt: srtclientsrc: SRT source
srt: srtsink: SRT sink
srt: srtsrc: SRT source

I looked into that the other day. If I recall correctly, 1.16 has srtsrc and srtsink.

I suspect it’s a version difference we’re looking at. If you really need the newer version you could look into rebuilding gstreamer. I believe there are instructions in the manual.