How to generate Http Live Streaming (HLS) content using Windows Azure Media Services

If you want to deliver video content to iOS devices and platform, the best option you have is to package your content into Http Live Streaming. HLS is Apple’s implementation of adaptive streaming and here is some useful resources from Apple. Apple implements the format but they don’t provide hosting. You could use Apache server for hosting HLS content, but better, you could choose Windows Azure Media Services – a way to host video in the cloud. Therefore, you don’t need to manage infrastructure and worry about scalability: Azure takes care of all that for you.

Scenario One: You have a .Mp4 file and you want to package into HLS and stream out from Windows Azure Media Services.

Here is how you could do it through Windows Azure Management Portal:

1. Login to https://manage.windowsazure.com/ and if you don’t have a media services account yet, here is how you could obtain a preview account.

2. Here is how the portal looks like. Click on Media Services tab and choose an existing MP4 file you have. If you don’t have any available MP4 file in portal, you could click on UPLOAD button at the bottom to upload a file from your laptop. Note: you could only upload file size less than 200MB through Azure portal. If you want to upload file bigger than 200 MB, please use our Media Services API.

Portal for Media Services

3. After having your MP4 file in place, click on the Encode button below and choose the third profile: Playback on IOS devices and PC/MAC. After you hit okay, it will start to produce two files.

4. Now, after you kick off the encoding job, you will see two new assets get generated. For my case, they are “The Surface Movement_small-mp4-iOS-Output” and “The Surface Movement_small-mp4-iOS-Output-Intermediate-PCMac-Output”. Here, any name with an “Intermediate” is a SMOOTH STREAMING content and the other one is HLS content. We firstly package your H.264 content into Smooth Streaming and then we mark it as HLS content.

Question: If I don’t need Smooth Streaming content, could we delete it?

Answer: Yes, you could. But if you use portal to do the conversion  Smooth Streaming asset will be created.

Question: what profile of HLS content do I generate here?

Answer: The profile we used here is “H264 Smooth Streaming 720p“, and you could check out details here. If you want to encode into other HLS profile, you will need to use our API. For Azure portal, only one profile is provided.

5. After the packing is done, click on the HLS asset (without Intermediate in the name) and click on PUBLISH button at the bottom. Now, your HLS content is hosted on Windows Azure Media Services, and you could grab the link at Publish URL column. That’s the link you put in your video application (iOS native app or HTML5 web app for Safari) and enjoy your video!

6. I will publish another blog post on how to generate HLS content through Azure Media Services .NET SDK.

One Response to How to generate Http Live Streaming (HLS) content using Windows Azure Media Services
  1. Diego Caceres Reply

    Hi there Mingfei,

    Have you written that post you mentioned at the end, about generating hls through Azure Media Services .NET SDK?

    I’m have only found this using dynamic packaging.

    Thanks.

    Diego Cáceres.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">