August 4, 2017

Using offset to decrease start time in SLDP player

Recently we introduced new real-time low latency protocol called SLDP. It provides sub-second delay for live streaming delivery for the cases when it's truly important. Some basic usage of SLDP protocol is described in this article.

One of the key features of SLDP is a quick start of a stream on a client side. Typically the best way to reduce start time is to set GOP size to 1 second or less. This can be done with any transcoder, e.g. Nimble Live Transcoder. This will increase bandwidth however so you need to reach some balance between start time and traffic consumption.

So if you cannot make that GOP size reduction, SLDP has an offset player parameter which allows affecting the start-up behavior. The following description shows how you can use it for your use cases.

Typically, a playback starts with a key frame of each GOP (group of pictures) as the player cannot start decoding and processing without the key frame information. This means a delay between the start of connection and the start of the playback and it may be several seconds, depending on the encoding settings - all this time a viewer will see a black screen waiting for a picture. This is what needs to be avoided, let's see how this can be avoided.

Here's a pseudo-graphics example of frames sequence of a live streams:

   |---------|---------|

Here, "|" means key frame and "-" means intermediate frames of any type. In this example we have GOP of 10 seconds total.

Once a viewer connects to the stream, he will probably get non-key frame and will have to wait until some key frame arrives:
   |---------|----n----!
Here, "n" means a moment of time which is "now" and "!" is the key-frame which will be used to start the playback.

This means that a playback will start 6 seconds after the moment when the player connected to the server.

Now we add "offset" parameter which specifies how many milliseconds back from now a source media server needs to go back to get previous key frame. In our example this will be 8s. The player connects to the server and defines the offset. The server gets back to 8s of this stream and checks this is the next key frame after the selected moment:
   |---p-----!n--------|
Here you see "!" is right before the "now" time mark. This means that a player will start playing from the moment of time which is only 1s behind current time.

Another example - a player connects to a source server 1 second before the next key frame. The offset is 8s so there will be no earlier keyframe. However, the nearest key frame arrives just 1 second after the connection, so there will be no huge delay.
   |---------|p-------n!
As you can see, the offset should be less than the size of your GOP, otherwise in previous example a viewer will get a key frame from previous GOP while the next GOP is just about to arrive:

   |--------p!--------n|
So we recommend setting offset to around 80% of expected GOP size.

The offset parameter in optional and it's not enabled by default. So you can specify if your streaming scenario requires quick display. If you use short GOPs, e.g. 1 second or less, you may just skip it as it's not required in that case.


You can see this and other parameters of our HTML5 player on this player page.


From the media server setup perspective SLDP is just another output protocol from the list of supported ones, which you can see on our live streaming digest page. So feel free to try it in action with our HTML5 web player.

Take a look at the answers for frequent questions to improve your SLDP usage and visit SLDP website and contact us in case of any questions.

Related documentation

No comments:

Post a Comment