Previously I’ve summarised how to use the Azure Media Encoder to encode uploaded media for delivery to client apps. To do this you create a media processing job that enables you to schedule and automate the encoding of assets.
In this blog post I’ll summarise how Azure Media Services content can be downloaded, or directly accessed by using locator URLs. For more information about locator URLs see my previous blog post. Content to be delivered can include media assets that are stored in Media Services, or media assets that have been encoded and processed in different ways.
There are a number of approaches that can be used to deliver Media Services content:
- Direct download from Azure Storage
- Access media in Azure Storage
- Stream media to a client application
- Send media content to another application or to another content provider.
Media content can be directly downloaded as long as you have the Media Services credentials for the account that uploaded and encoded the asset. Content can be downloaded by creating a shared access signature (SAS) locator, which contains a URL to the asset that contains the requested file. The URL can then be used by anyone to download the asset.
Alternatively, you may want to give users access to content stored in Azure Storage. To do this you must create a full SAS URL to each file contained in the media asset. This is achieved by appending the file name to the SAS locator.
Media Services also provides the means to directly access streaming media content. This is accomplished by creating an on-demand origin locator, which allows direct access to streaming content. With on-demand origin locators, you build a full URL to a streaming manifest file in an asset. You then provide the URL to a client application that can play streaming content.
Content can also be delivered by using a Content Delivery Network (CDN), in order to offer improved performance and scalability when streaming media. For more information see How to Manage Origins in a Media Services Account.
When streaming media using on-demand origin locators you can take advantage of dynamic packaging. When using dynamic packaging, your video is stored in one encoded format, usually an adaptive bitrate MP4 file set. When a video player requests the video it specifies the format it requires, and the Media Services Origin Service converts the MP4 file to the format requested by the player. This allows you to store only one format of your videos, therefore reducing storage costs. For more information about the Origin Service see Azure Media Services Origin Service.
The following diagram shows a high-level overview of the media delivery process that we used in the Building an On-Demand Video Service with Microsoft Azure Media Services project.
Client apps request media through a REST web interface. The Contoso web service queries the Content Management System, which returns the URL of the media asset in Azure Storage. The media asset could be a single media file, or a manifest file which references multiple media files. The client application then requests the URL content from the Origin Service, which processes the outbound stream from storage to client application. For a code walkthrough of this process see Browsing videos, Playing videos, and Retrieving recommendations.
You can scale Media Services delivery by specifying the number of on-demand streaming reserved units that you would like your account to be provisioned with. For more information see Scale a Media Service.
This blog post has summarised how Azure Media Services content can be downloaded, or directly accessed by using locator URLs. Content to be delivered can include media assets that are stored in Media Services, or media assets that have been encoded and processed in different ways.