Previously I’ve introduced the Content Management System (CMS) that’s used to store video details for the video on-demand service, along with details of video encoding jobs. I’ve also explained how to connect to Azure Media Services.
In this blog post I’ll summarise how client apps can upload video to the video on-demand service. For info about the supported codecs and file container formats see Formats Supported by the Media Services Encoder.
Uploading content
To upload content into Media Services you must first create an asset and add files to it, and then upload the asset. This process is known as ingesting content. The content object in Media Services is an IAsset, which is a collection of metadata about a set of media files. Each IAsset contains one or more IAssetFile objects. The approach adopted here is to create an Asset, upload the content to Media Services, and then generate AssetFiles and associate them with the Asset. In order to create an Asset you must first have a reference to the Media Services server context. For more info see Connecting to Azure Media Services.
The following diagram shows a high-level overview of the media upload process used in the Building an On-Demand Video Service with Microsoft Azure Media Services project.
The client apps communicate with the web service through a REST web interface. When a new video is uploaded a new asset is created by Media Services, and the asset is uploaded to Azure Storage before the asset details are published to the CMS. The upload process can be decomposed into the following steps:
- Create a new empty Asset.
- Create an AccessPolicy instance that defines the permissions and duration of access to the Asset.
- Create a Locator instance that will provide access to the Asset.
- Upload the file that’s associated with the Asset into blob storage.
- Publish the Asset.
- Save the Asset details to the CMS.
- Generate an AssetFile for the Asset.
- Add the Asset to the encoding pipeline.
For a code walkthrough of this process see Upload process in the Contoso Azure Media Services applications.
Media Services also allows you to secure your content from the time it leaves your computer, by specifying an encryption option as a parameter when creating an Asset. For more info see Securing media for upload into Azure Media Services.
Summary
This blog post has summarised the media upload process from client apps into a video on-demand service that uses Azure Media Services. For more info see Building an On-Demand Video Service with Microsoft Azure Media Services.
In my next blog post I’ll discuss the next step in the Media Services workflow – encoding and processing uploaded media.