Does Azure Media Services Support Offline Mode?


In my previous posts, I have answered in details the following questions:

  1. Does Azure Media Services provide Video Analytics or User Analytics? For the detailed answer, please see this blog.
  2. Does Azure Media Services support VR/360 live streaming? For detailed answer, please see this blog.

In this post, I will answer the following question:

Does Azure Media Services support offline download/playback with DRM protection?

Again the answer is yes.

First, some background info on offline mode playback, especially why:

  1. In some countries, Internet availability and/or bandwidth is still limited. Users may choose to download first to be able to watch content in high enough resolution for satisfactory viewing experience. In this case, more often, the issue is not network availability, rather it is limited network bandwidth. OTT/OVP providers are asking for offline mode support.
  2. As disclosed at Netflix 2016 Q3 shareholder conference, downloading content is a “oft-requested feature”, and “we are open to it” said by Reed Hastings, Netflix CEO.
  3. Some content providers may disallow DRM license delivery beyond a country's border. If a user needs to travel abroad and still wants to watch content, offline download is needed.

The challenge we face in implementing offline mode is the following:

  1. MP4 is supported by many players, encoder tools, but there is no binding between MP4 container and DRM;
  2. In the long term, CFF with CENC is the way to go. However, today, the tools/player support ecosystem is not there yet. We need a solution, today.

The idea is: smooth streaming (PIFF) file format with H264/AAC has a binding with PlayReady (AES-128 CTR). Individual smooth streaming .ismv file (assuming audio is muxed in video) is itself a fMP4 and can be used for playback. If a smooth streaming content goes through PlayReady encryption, each .ismv file becomes a PlayReady protected fragmented MP4. We can choose a .ismv file with the preferred bitrate and rename it as .mp4 for download.

There are two options for hosting the PlayReady protected MP4 for progressive download:

  1. One can put this MP4 in the same container/media service asset and leverage Azure Media Services streaming endpoint for progressive download;
  2. One can use SAS locator for progressive download directly from Azure Storage, bypassing Azure Media Services.

Of course, you have the liberty of using two types of PlayReady license delivery:

  1. PlayReady license delivery service in Azure Media Services;
  2. PlayReady license servers hosted anywhere.

Below are two sets of test assets, the first one using PlayReady license delivery in AMS while the second one using my PlayReady license server hosted on an Azure VM:

Asset #1:

Asset #2:

For playback testing, I used a Universal Windows Application on Windows 10. In Windows 10 Universal samples, there is a basic player sample called Adaptive Streaming Sample. All we have to do is to add the code for us to download video and use it as the source, instead of adaptive streaming source. The changes are in button click event handler:

private async void LoadUri_Click(object sender, RoutedEventArgs e)

{

    //Uri uri;

    //if (!Uri.TryCreate(UriBox.Text, UriKind.Absolute, out uri))

    //{

    // Log("Malformed Uri in Load text box.");

    // return;

    //}

    //LoadSourceFromUriTask = LoadSourceFromUriAsync(uri);

    //await LoadSourceFromUriTask;

    //willzhan change start

    // Create and open the file picker

    FileOpenPicker openPicker = new FileOpenPicker();

    openPicker.ViewMode = PickerViewMode.Thumbnail;

    openPicker.SuggestedStartLocation = PickerLocationId.ComputerFolder;

    openPicker.FileTypeFilter.Add(".mp4");

    openPicker.FileTypeFilter.Add(".ismv");

    //openPicker.FileTypeFilter.Add(".mkv");

    //openPicker.FileTypeFilter.Add(".avi");

    StorageFile file = await openPicker.PickSingleFileAsync();

    if (file != null)

{

       //rootPage.NotifyUser("Picked video: " + file.Name, NotifyType.StatusMessage);

       this.mediaPlayerElement.MediaPlayer.Source = MediaSource.CreateFromStorageFile(file);

       this.mediaPlayerElement.MediaPlayer.Play();

       UriBox.Text = file.Path;

}

     else

{

       // rootPage.NotifyUser("Operation cancelled.", NotifyType.ErrorMessage);

}

       // On small screens, hide the description text to make room for the video.

       DescriptionText.Visibility = (ActualHeight < 500) ? Visibility.Collapsed : Visibility.Visible;

}

Offline mode playback of PlayReady protected fMP4

Offline mode playback of PlayReady protected fMP4

Of course, since the video is under PlayReady protection, the screenshot will not be able to include the video.

In summary, we have achieved offline mode on Azure Media Services:

  1. Content transcoding and PlayReady encryption can be done in Azure Media Services or other tools;
  2. Content can be hosted in Azure Media Services or Azure Storage for progressive download;
  3. PlayReady license delivery can be from Azure Media Services or elsewhere;
  4. The prepared smooth streaming content can still be used for online streaming via DASH or smooth with PlayReady as the DRM.

What about HLS protected by FairPlay? You can check the new Apple's protected offline mode offering in this video (14 minutes into the video is on offline mode). Notice that this video is in HLS, so you need to use a browser which supports HLS, such as Microsoft Edge on Windows 10, or Safari on OS X.

 

ACKNOWLEDGMENT: Special acknowledgment goes to Nick Drouin of Windows & Devices, Quintin Burns and Anil Murching of Azure Media Services team for their technical insights, guidance and great help.

Comments (0)

Skip to main content