Updated: February 27, 2015
In order to manage, encode, and stream your videos, you must first upload your content into Microsoft Azure Media Services. Once uploaded, your content is stored securely in the cloud for further processing and streaming.
This topic gives an overview of relevant concepts and shows different ways to upload your content. You can decide which method is more suitable for your scenario based on the information presented in this article.
Supported File Types
Uploading Content with Azure Media Services REST API
Uploading Content with Azure Media Services SDK for .NET
Uploading Content with Java and Node.js
Uploading Content with PHP
Uploading Content with the Azure Management Portal
Uploading Large Sets of Files with High Speed
Managing Media Services Assets across Multiple Storage Accounts
Asset – The Asset entity contains digital files (including video, audio, images, thumbnail collections, text tracks and closed caption files) and the metadata about these files. After the digital files are uploaded into an asset, they could be used in the Media Services encoding and streaming workflows.
An asset is mapped to a blob container in the Azure Storage account and the files in the asset are stored as blobs in that container.
When deciding what media content to upload and store in an asset, the following considerations apply:
An asset should contain only a single, unique instance of media content. For example, a single edit of a TV episode, movie, or advertisement.
An asset should not contain multiple renditions or edits of an audiovisual file. One example of an improper usage of an Asset would be attempting to store more than one TV episode, advertisement, or multiple camera angles from a single production inside an asset. Storing multiple renditions or edits of an audiovisual file in an asset can result in difficulties submitting encoding jobs, streaming and securing the delivery of the asset later in the workflow.
Asset file - The AssetFile entity represents an actual video or audio file that is stored in a blob container. An asset file is always associated with an asset, and an asset may contain one or many files. The Media Services Encoder task fails if an asset file object is not associated with a digital file in a blob container.
You should not attempt to change the contents of blob containers that were generated by Media Services without using Media Service APIs.
Asset encryption options – Depending on the type of content you want to upload, Media Services provides various encryption options that you can choose from.
None - No encryption is used. This is the default value. Note that when using this option your content is not protected in transit or at rest in storage.
If you plan to deliver an MP4 using progressive download, use this option to upload your content. Azure Media Services Origin Service does not support the delivery of Storage Encrypted Assets. In the case of standard progressive download ISO MP4 files, PlayReady DRM is not supported.
StorageEncrypted - Encrypts your clear content locally using AES 256 bit encryption and then uploads it to Azure Storage where it is stored encrypted at rest. Assets protected with Storage Encryption are automatically unencrypted and placed in an encrypted file system prior to encoding, and optionally re-encrypted prior to uploading back as a new output asset. The primary use case for Storage Encryption is when you want to secure your high quality input media files with strong encryption at rest on disk.
CommonEncryption - Use this option if you are uploading content that has already been encrypted and protected with Common Encryption or PlayReady DRM (for example, Smooth Streaming protected with PlayReady DRM).
EnvelopeEncrypted – Use this option if you are uploading HLS encrypted with AES. Note that the files must have been encoded and encrypted by Transform Manager.
Access policy –The AccessPolicy entity defines permissions (like read, write, and list) and duration of access to an asset. You would usually pass an AccessPolicy object to a locator that would then be used to access the files contained in an asset.
Blob container - A blob container provides a grouping of a set of blobs. Blob containers are used in Media Services as boundary point for access control, and Shared Access Signature (SAS) locators on assets. An Azure Storage account can contain an unlimited number of blob containers. A container can store an unlimited number of blobs.
|You should not attempt to change the contents of blob containers that were generated by Media Services without using Media Service APIs.|
Locator – The Locator entity provides an entry point to access the files contained in an asset. An access policy is used to define the permissions and duration that a client has access to a given asset. Locators can have a many to one relationship with an access policy, such that different locators can provide different start times and connection types to different clients while all using the same permission and duration settings; however, because of a shared access policy restriction set by Azure storage services, you cannot have more than five unique locators associated with a given asset at one time. For more information, see Using a Shared Access Signature (REST API).
Storage account - All access to Azure Storage is done through a storage account. A Media Service account can associate with one or more storage accounts. An account can contain an unlimited number of containers, as long as their total size is under 200TB per storage account. Media Services provides SDK level tooling to allow you to manage multiple storage accounts and load balance the distribution of your assets during upload to these accounts based on metrics or random distribution. For more information, see Managing assets across multiple storage accounts In Azure Media Services and defining load balancing strategy.
You can upload various video, audio, and image files types to a Media Services account. There are no restrictions for the types or formats of files that you can upload using the Media Services SDK or upload tools. However, the Azure Management portal limits your uploads to the formats that are supported by the Azure Media Encoder. There are a number of partner encoders and media processor tasks that support a wider range of formats than the Azure Media Encoder. For details on the supported file formats available from partner encoders, like Digital Rapids Kayak, refer to the documentation provided by the partner media processor or tasks available in the Azure Store.
Microsoft Azure Media Services is an OData-based REST service that exposes objects such as Assets, Jobs, Tasks, and so on, as entities that can be queried in the same way as other OData entities. Furthermore, Media Services is built on OData v3, which means you can submit HTTP request bodies in atom+pub or verbose JSON, and receive your responses in the same formats.
Uploading content with the REST API involves multiple steps. The Ingesting Assets with the Media Services REST API topic shows you how to upload your content into a Media Services account using JSON with Media Services REST APIs.
Microsoft Azure Media Services SDK for .NET is a wrapper around the REST APIs. The SDK provides a simpler way to accomplish almost all of the tasks that are exposed by the REST API.
The Ingest Assets topic demonstrates how to upload a single or multiple files from a local directory into a Media Services account.
The following WPF application demonstrates how to use the Task-based Asynchronous Pattern (TAP) to upload your content and show progress. It also shows how to take advantage of multiple storage accounts to increase the total available storage well beyond the 200TB limit of a single storage account: How to: Manage Multiple Storage Accounts Attached to a Media Services Account.
To upload large sets of files using SDK for .NET, see Ingesting Assets in Bulk with the Media Services SDK for .NET.
You may already have existing blobs in some storage account that you want to copy into new Media Services assets. The following topic shows how to accomplish this task: Copying an Existing Blob into a Media Services Asset.
How to upload a stream to the storage blob associated with the Azure Media Services account.
How to associate the file in the blob with the asset using the Media Services REST APIs.
How to get a SAS URL pointing to the uploaded file.
You can upload various video, audio, and image files types to a Media Services account. There are no restrictions for the types or formats of files that you can upload using the Media Services SDK or upload tools. However, the Azure Management Portal limits your uploads to the formats that are supported by the Azure Media Encoder.
Uploading your content with the Management Portal has the following limitations.
Cannot upload multiple files in a single upload.
Cannot upload a file larger than 200MB. Note, there is no file size limit if you are uploading from an existing storage account.
Cannot upload all the file formats that are supported by Media Services.
The files with following extensions can be uploaded: .asf, .avi, .m2ts, .m2v, mp4, .mpeg, .mpg, .mts, .ts, .wmv, .3gp, .3g2, .3gp2, .mod, .dv, .vob, .ismv., .m4a.
Using Aspera high-speed file transfer software.
Using STORM managed file transfer system.
To expand your storage beyond the limitations of 200TB per storage account, you can choose to attach multiple storage accounts to a single Media Services account. Ability to attach multiple storage accounts to a Media Services account provides the following benefits:
Load balancing your assets across multiple storage accounts.
Scaling Media Services for large amounts of content storage and processing. Currently a single storage account is limited to 200 TB of storage.
Isolating your mezzanine file storage from your streaming or DRM protected file storage.
For more information, see Managing Media Services Assets across Multiple Storage Accounts. Also, see the following WPF sample that shows how to monitor capacity data for storage accounts in order to decide to which storage account to upload files: How to: Manage Multiple Storage Accounts Attached to a Media Services Account.
TasksImplementing Failover Streaming Scenario
ConceptsIngesting Assets with the Media Services SDK for .NET
Ingesting Assets in Bulk with the Media Services SDK for .NET
Ingesting Assets with the Media Services REST API
Ingesting Assets in Bulk with the REST API
Copying an Existing Blob into a Media Services Asset
Managing Media Services Assets across Multiple Storage Accounts