Live to VOD Implementation – SSME v2.0 walkthrough

Here are some terms I used in this blog:

What’s this API for?

This feature covers the requirements for enabling an unlimited DVR window that can be controlled completely by the client. This is critical for broadcast scenarios in which the size of the DVR window needs to be dynamic throughout the lifetime of a publishing point.

Before: with the implementation of live content, broadcast cable company could only provide fix length DVR window, for instance, you could only watch up to past eight-hours of contents. If you want to watch content one day ago, you won’t be able to do so. Now: with this new API ( SetPlayBackRangeAsync ), if you want to watch content anytime in the past, you will be able to do so, as long as the content was available at that time. Therefore, due to this API, content provider could make contents available all the time.

Who should use this API?

This API requires a new kind of client manifest specified below. In most of cases, this API is useful for broadcast cable company who owns a Live-to-VOD media server.

Client manifest

In Live-to-VOD, there are two types of client manifests: one is the default one, we also call it as “segmented” manifest, and the other is segment manifest, which is for a single segment, and we also call it as “VOD” manifest. The new client manifest introduced “segment” element and other new attributes. The following figure is a snapshot of partial default/segmented manifest.

Figure 1: partial default/segmented manifest

The text with yellow color highlighted in the Figure 1 above shows the new attribute and element.

  • • MajorVersion >= 3 is the necessary and sufficient conditions for Live to VOD client manifest, which is also called segmented manifest.
  • • Segment element is the new element in the XML, which flags the Live to VOD client manifest. It must have Url, StartTime and Length attributes.
  • • Chunk start time cannot be sooner (smaller) than the segment start time; Chunk start time cannot be equal or later (larger) than the segment end time either.
  • • LastTimeStamp is optional and it represents the start time of the last manifest segment where a sparse stream chunk is present.

Compared with the segmented manifest, the VOD manifest has the same new Segment element, but its URL attribute’s value is different. Please refer to the following Figure 2.

Figure 2: VOD manifest

Here, the URL value uses a relative path to minimize the code change and let the path resolved by the Silverlight automatically.

New APIs Signature

The above two overloading functions are for the new API to allow the app developer to specify an explicit start position and end position for accessing the 24×7 media channel.

Below is one code sample with Smooth Streaming Player and Code-behind:

<SSME:SmoothStreamingMediaElement AutoPlay="false" x:Name="SmoothPlayer" SmoothStreamingSource="http://iiswsmsrv4/multiaudio/ArmyDarknessMultiAudio.isml/manifest" Grid.Row="0" />

You could call SetPlayBackRangeAsync anytime after Manifest is ready. By using SetPlayBackRangeAsync, the player will start to seek video content at the time your request, which is leftEdge. Note here: we don’t support right edge yet, it has to be TimeSpan.MaxValue so far. Here in this example, we seek back 60 sec from the starting position of the player, which means player will starts loading content one minute ago till player starting position. Video will still get played at current position but available content get extended by 60 sec.

 New API related events and classes

This SetPlaybackRangeAsync API is based on Event-based Asynchronous Pattern, but so far it is a simple version and doesn’t support Cancel operation. This API can be extended in the future.

The following lists the corresponding events and event arguments.

The above sample demonstrated the usage of SetPlaybackRangeCompleted event. SetPlaybackRangeCompleted event could capture the state after calling SetPlaybackRangeAsync. For instance, if you set a breakpoint at TimeSpan temp=SmoothPlayer.StartPosition and you will see SmoothPlayer.StartPosition gets one minute earlier because we seek content one minute ago.

2 Responses to Live to VOD Implementation – SSME v2.0 walkthrough
  1. [...] Enable real 24 by 7 content availability for broadcast company. Developer could control the size of DVR ... mingfeiy.com/smooth-streaming-client-sdk
  2. gibson Reply

    Very nice.

    On currently IIS Media Services(4.1), client manifest’s major version is 2.
    Can I use the feature until new IIS Media Services will be shipped ?

    Thanks :)

Leave a Reply

Your email address will not be published. Please enter your name, email and a comment.