July 6, 2017

Setting SRT in Nimble Streamer

Secure Reliable Transport (SRT) is a transport technology that optimizes streaming performance across unpredictable networks. It's applied to contribution and distribution endpoints as part of a video stream workflow to deliver the best quality and lowest latency video at all times.

As audio/video packets are streamed from a source to a destination device, SRT detects and adapts to the real-time network conditions between the two endpoints. SRT helps compensate for jitter and bandwidth fluctuations due to congestion over noisy networks, such as the Internet. Its error recovery mechanism minimizes the packet loss typical of Internet connections. AES 128/256 bit encryption is also supported for end-to-end security, keeping your streams safe from prying eyes.

Our company, Softvelum LLC, became a member of SRT Alliance which is a group dedicated to managing and supporting the open source implementation of SRT. This alliance is accelerating interoperability of video streaming solutions and fostering collaboration with industry leaders to achieve lower latency Internet video transport. Softvelum is actively contributing to the community to improve the protocol and its ecosystem.

Nimble Streamer has full support for SRT:
  • Both Push and Listen delivery modes are supported.
  • Both Listen and Pull receive modes can be used to get SRT streams for further processing.
  • Rendezvous mode for sending and receiving is supported.
  • Custom "latency" parameter is supported for fine tuning.
  • Multiple streams can be sent via single SRT channel.
  • Mux rate can be set correctly - Nimble Streamer has 100% PCR accuracy, 0ns PCR drift and PCR interval <20 ms according to StreamGuru. This is typically used for precise testing of channel throughput.
  • AES 128 bit encryption provides stream security.

Using Nimble Streamer transmuxing engine, you may create any supported live protocol output from SRT, as well as receive any of them  to create SRT.

Let's see how SRT can be enabled and used in Nimble Streamer.

Install SRT package


SRT is available via separate package for Nimble Streamer. You need to install it in order to use this protocol.
  1. Install Nimble Streamer or upgrade it to latest version.
  2. Follow this instruction to install SRT package.
Now you may proceed with the setup. You may define both transmission and reception settings so Nimble Streamer could be used on both ends of delivery chain.

Set up sending via SRT 


Having any input via RTMP, RTSP, MPEG-TS or HLS, you may create outgoing SRT streams.

Go to Nimble Streamer -> Live streams settings menu. Click on UDP streaming tab.

UDP settings page.

Click on Add SRT setting button to see the following dialog for creating a new SRT channel.

Adding new SRT channel transmission.
IP and Port fields define the destination of your channel.

Mode field may be set to either Push or Listen - those are the modes supported by SRT.

  • Push will initiate the active sending of the selected channel to the destination IP/Port regardless of the recipient state.
  • Listen will make Nimble Streamer connect to destination IP/Port and will wait for the Pull command from remote server.

Mux rate is typically used for precise testing of channel throughput. Read this article for all details regarding mux rate setup.

Source applications names, streams names and their respective PMT PIDs, Video PIDs and Audio PIDs describe where the content is taken from for further transmission. You may define multiple sources - in this case SRT channel will have multiple streams in it.


In addition to mandatory parameters you may specify custom parameters and their values.

Custom parameters


latency parameter can be defined in milliseconds. We recommend setting it not less than "120". If you don't specify, Nimble will use 120 by default. This specified delay causes an extra "wasted time" if the packet reached the destination quickly (and therefore it's way ahead of "time to play"), but when it was lost, this gives it an extra time to recover the packet before its "time to play" comes. You may also read this thread to find out more details.

passphrase and pbkeylen parameters are available to enable encryption for processed streams. The passphrase must be at least 10 symbols long - this is your password. The pbkeylen may be set to 16, 24 or 32 with 16 used by default. If these parameters are set during the transmission, you need to re-start the stream in order for encryption parameters to apply. Same set of parameters and values must be defined for both sender and receiver parts.


Once you save the settings, they will be added to the list and will be synced with the server.

Setting is being synced.

Now you may receive content via SRT on your destination. As we already mentioned, Nimble can be used to receive the SRT streams so let's see how you can do that.

Set up receiving of SRT


Having SRT input, you may transmux it into  RTMP, RTSP, MPEG-TS, HLS, MPEG-DASH or even Icecast outgoing streams.

Add incoming stream


Go to Nimble Streamer -> Live streams settings menu. Click on MPEGTS In tab.

MPEGTS settings


Click on Add SRT stream button to see the following dialog for creating a new incoming SRT channel.

Adding SRT stream.

Receive mode specifies the mode used for obtaining the stream.

  • Listen sets Nimble to wait for incoming data and process it as soon as it arrives. Your source needs to be set "Push" mode - see previous section.
  • Pull sets Nimble to initiate the source server to start sending the data. Your source needs to be set to Listen mode.

IP Address and Port fields specify which interface will be used for connection.

Alias is the name that will be used in incoming streams list.

If your source channel uses latency parameter, you also need to specify in it custom parameters.

Once you save the setting, it will be started for sync-up with your server.

SRT stream added.


So you specified incoming stream, now you need to add it to outgoing streams, like it's done for any other MPEG-TS streams. This needs to be done because each SRT channel may carry several streams.

Add outgoing stream


Go to MPEGTS Out tab to see the list of outgoing streams. Click on Add outgoing stream.



Here you will define the names of applications and streams which will be used for playback and other use cases. You will select video and audio sources and if they have multiple streams in a single channel, then you'll select the required ones. Read this article for more details about adding outgoing streams.

To play the SRT stream, go to Nimble Streamer -> Live Streams menu, select the outgoing streams to see what your server now has to offer for playback.


Setting up Rendezvous mode



Rendezvous mode
 is an addition to the modes described above. It allows streaming over SRT in case if one of both sides of send-receive pair use firewalls.
Each side needs local and remote interfaces to be set up: Local IP with Local Port and Remote IP with Remote Port.

These interfaces are used for initiating the transmission and exchanging the data.

  • Sender side will send data to Receiver Local IP/port.
  • Receiver side will send data to Sender Local IP/port during initial negotiation.


You can refer to SRT Deployment Guide (the link will start download) to get more details about it.

The description below shows how you can set up the Rendezvous mode.

Sending in Rendezvous mode


To set up SRT sending you need to go to Nimble Streamer -> Live Streams Settings menu. You will see settings page, click on UDP streaming tab there. You will see a page similar to what you saw in Set up sending via SRT section above. Click on Add SRT setting button to see the dialog. there you need to choose Rendezvous from Mode dropdown list.


Here, a pair of 192.168.0.2 and its port is a Local interface of our server which is a source of a stream to send. The Remote pair is the destination.

Receiving in Rendezvous mode


Go to Nimble Streamer -> Live streams settings menu. Click on MPEGTS In tab to see a page similar to what you saw in Set up receiving of SRT section above. Click on Add SRT stream to see the dialog below. Select Rendezvous from the Mode drop-down.



Here, a pair of Remote IP and Port will point to a source of the stream, a pair of Local IP and Port will point to current receiver server. The rest of the setup is done the same way as in Set up receiving of SRT section.




That's it - your Nimble Streamer instance may now get live streams via SRT.

The received SRT streams can be used in other live streaming capabilities as well as be used as input for Live Transcoder so you can build any content delivery scenarios with Nimble Streamer.


We keep improving this feature set, so let us know if you have any questions or concerns about it.


Related documentation


SRT support in Nimble Streamer, Live streaming scenarios, Live Transcoder

19 comments:

  1. Hi - this is great news!

    Currently looking to test. I updated according to the instructions above. Now have nimble server 3.2.5-1 + nimble-srt 1.0.0-1. Is there any activation process to get it to show SRT options in WMSpanel?

    Cheers!

    ReplyDelete
    Replies
    1. Hi,

      The UI will be deployed on Monday. Thanks for your patience.

      Delete
    2. RIP this weekend's show!

      But this is great to hear :) I'm looking forward to testing!

      Delete
    3. OK, it's now online - follow the instruction above to set it up. In case of questions, contact our engineers via https://wmspanel.com/help

      Delete
  2. Hi,
    thanks a lot for your interest! We will deploy UI in the Monday and you will be able to test new SRT transport.

    ReplyDelete
  3. Hello , I will be moving an h265 MPTS to be played from the destination network using brightsign players. Any recommendations ?

    Also hoping to use resberry pi for destination transmux device What demands on that hardware are expected with 4 audio pairs and 2 videos totaling 25 mbits ??

    I don't really expect the pie to work but version 3 is strong .... Thoughts ??

    ReplyDelete
  4. Hi,
    we don't support SRT for raspberry pi now so please consider linux/Windows for now

    ReplyDelete
  5. hello,
    Can I send an MPTS using SRT or is it required to be broken up into individual streams ?

    ReplyDelete
    Replies
    1. Thanks for great question!
      Nimble can send and get MPTS over SRT and we hope this ability will be very welcomed among our clients

      Delete
  6. does the windows install version of nimble streamer automatically include SRT functionality ?

    ReplyDelete
    Replies
    1. No, it's not included. You need to install it separately: https://wmspanel.com/nimble/srt_install#os_windows

      Delete
  7. please explain:

    source application name: what are valid choices, how do you KNOW they are valid names.

    SRT source IP : do you send the SRT to the IP of the remote device ? or the ip address of the device sending the SRT out

    can you retransmit an MPTS on the receiver sides network that was sent using SRT so that the MPTS released on the receiver sides network is identical to the original MPTS used to create the SRT transmitters source streams?

    in other words ....

    ENCODER--> MPTS--> SRT Transmit--> INTERNET--> Receive SRT--> MPTS--> network

    ReplyDelete
  8. MPTS on received network is not identical as Nimble receives and demuxes mpts and in case if you need to produce mpts on receiver you will have to use http://blog.wmspanel.com/2015/07/advanced-mpegts-delivery-udp-nimble-streamer.html

    i.e nimble receives mpts stream demux into several streams then combine into MPTS before sending to destination. Nimble will be send input MPTS stream without modifications. It will get input stream demux it and send MPTS stream produced by Nimble not original.

    ReplyDelete
  9. Can you please comment on the Source naming structure.

    ReplyDelete
    Replies
    1. That is any stream which is available in Nimble Streamer. Check Nimble Streamer -> Live Streams menu and go to Outgoing streams page.

      Delete
  10. Hi
    I tested this feature today but it seems not working on my server.
    On the sender server, I saw the rtp port is opened


    [root@localhost ~]# ss -ln | grep 1234
    udp UNCONN 0 0 x.x.x.x:1234 *:*

    config:
    {
    "ip": "x.x.x.x",
    "port": 1234,
    "protocol": "srt",
    "ttl": 1,
    "paused": false,
    "send_mode": "listen",
    "parameters": {
    "latency": "500"
    },
    "source_streams": [
    {
    "application": "nimble_live",
    "stream": "test-pb-udp",
    "pmt_pid": 7166,
    "video_pid": 256,
    "audio_pid": 257
    }
    ]
    }

    However on the receiver, which is also the sender (same server), the log file showed:

    [2017-07-26 19:36:22 P999-T1010] [srtpull] E: connection closed by s=269192917: 2001 Connection was broken.
    [2017-07-26 19:36:27 P999-T1010] [srtpull] E: connection closed by s=269192914: 2001 Connection was broken.

    Config:
    {
    "cam_alias": "test",
    "ip": "x.x.x.x",
    "parameters": {
    "latency": "500"
    },
    "port": 1234,
    "protocol": "srt",
    "receive_mode": "pull"
    },

    What am I wrong here, please advise.
    BTW, I am using latest nimble version.

    [root@localhost ~]# yum list | grep nimble
    nimble.x86_64 3.2.6-1.el7.centos @nimble
    nimble-srt.x86_64 1.0.0-1.el7.centos @nimble
    nimble-transcoder.x86_64 1.0.4-3.el7.centos @nimble
    nimble-transcoder.x86_64 1.0.8-1.el7.centos nimble

    ReplyDelete
    Replies
    1. Looks like you've already addressed this to our helpdesk and had our team response. In case of any further issues please use https://wmspanel.com/help
      Thank you.

      Delete
  11. one thing i learned about SRT and the whole nimble system in general is that you must have an output for everything.

    so when you have an MPEGTS udp input for example, you must create some output for it to be available for inclusion into an SRT stream.

    you can not just go from a nimble input directly to SRT, it must go to an nimble output to be included in an SRT Stream... or any stream for that matter.

    on the receive side, when you accept the SRT as an MPEGTS input, you must then send it to an MPEGTS output one for each program in the SRT stream

    you may then stream them out using the UDP streamer.

    ReplyDelete
    Replies
    1. Hello,

      You are right, you need to define outgoing stream for MPEGTS-based streaming. It's always set like that in Nimble just because there may be multiple programs inside of one MPEGTS stream. So to give capabilities our customers to generate any combination of output streams, we made it that way.
      Please refer to this article for more details: http://blog.wmspanel.com/2015/07/advanced-mpegts-delivery-udp-nimble-streamer.html

      Delete