Announcing Windows Azure Media Services .NET SDK Extensions Version 2.0

I am excited to announce that our Windows Azure Media services Extension SDK version 2.0 just released! If you were using the first version of extension SDK, please pay attention because this version includes a few breaking changes – we had a round of redesign for our existing extension APIs.

What is extension SDK?

This extension SDK is a great initiative by developer Mariano Conveti from our partner Southworks. This SDK extension library contains a set of extension methods and helpers for the Windows Azure Media Services SDK for .NET. You could get the source code from Github repository or install Nuget package to start using it.

Why we are doing extension SDK?

As we known, we have our official Windows Azure Media Services SDK, however, because it is very flexible for building customized media workflow, you may have to write lots of lines of code in order to complete a simple function. What if there is an extension allows you to complete basic media workflow in 10 lines? That’s why WAMS extension SDK exists.

Who are maintaining the extension SDK?

This extension SDK is under Azure official code repository on Github. Currently, majority of code is contributed by Mariano. WAMS team is also contributing and is responsible for Github and Nuget release. However, we welcome developer community’s contribution. Please refer to our Github page for more details.

What’s new for version 2.0?

  • • I have another blog on major features for version 1.0. All the features are still working in this new version.
  • •  For version 2.0, we re-organized extension methods, which avoid defining all of them for CloudMediaContext class. This new extension SDK is based on the latest Windows Azure Media Services
  • • Automatically load balance between multiple storage accounts while uploading assets, you could refer to Mariano’s blog for code example

Here is how to use this extension SDK to complete a basic media workflow:

1. Open Visual Studio and create a .NET console application (it could target on either .NET 4 or .NET 4.5).

2. Right Click on your project and select Manage NuGet package. Navigate to Online tab, and search windowsazure.mediaservices on the Search windows. And select to install Windows Azure Media Services Extension SDK as showed in the picture below.

Nuget WAMS extension3. Copy and paste the following code in Main method (it uploads media file, encode it into mulit-bitrate Mp4 and publish for streaming)

*I put a local file in C:\demo\demo.mp4, please change this file path to link to your file on disk.

There are a few things I want to highlight in this sample code:

  • • Encoding presents could be selected in MediaEncoderTaskPresetStrings, you no longer need to go to MSDN to check for task presents:

Task preset for WAMS

  • • There are two types of locator as you can see in Step 4, in fact, this concept isn’t new and it exists in WAMS SDK as well. However, this is one of the most asked questions so I’d love to explain again.
  • SAS(Shared Access Signature) Locator: this is generated to access video file directly from Blob (as any other files). This is used for progressive download.
  • OnDemandOrigin Locator: the url allows you to access media file through our origin server. In this example, you can see there are 3 OnDemandOrigin Locator gets generated in step 5: MPEG-DASH, Smooth Streaming and HLS. It’s utilizing our dynamic packaging feature that by storing your media file in multi-bitrate Mp4, we can deliver multiple media formats on the fly. However, remember you need at least reserved unit for streaming to make it work.
  • Below is the picture for explaining these two locators’ URLs:
  • Locator concept

4. Press F5 and run. In the output console, you should be able to see three streaming URLs and a few SAS locators for various bitrates Mp4 files. I have shared project source code for download.

5. If you found any issues or there are APIs you think are helpful but missing in current collection, don’t hesitate to post on Github Issue tab. We are looking forward to seeing your feedback.

One Response to Announcing Windows Azure Media Services .NET SDK Extensions Version 2.0
  1. [...] shared 6 times • Announcing Windows Azure Media Services .NET SDK Extensions Version 2.0 ...

Leave a Reply

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