Skip to main content

Azure Media Services (Day 16 of 31)

List of all posts from this series:

Short Description 
Azure Media Services give us the possibility to develop and build application that distributed media content to clients. This solution covers all the steps that are done to distribute and manage media content, starting from upload and encode to package and streaming.

Main Features 
Cross platform support
Media Services can be used with success in different scenario that covers a wide range of devices, starting from iOS to desktop and TVs. Because of this the current implementation contains also libraries and SDK for:

  • Node.js
  • .NET 
  • Java
  • RESTApi
  • PHP

Live streaming
We have the ability to stream live content over the wire using Media Services. In this way we can broadcast a live event without having to range complex and expensive machines and reserve CPU power.
Video On Demand (VoD) Delivery
Content can be delivered to clients based on their requests. Because of this we can imagine different scenarios, when  we stream a movie to a specific clients only after he requested and paid for it.
DRM Support
There is native support for Digital Rights Management. This mean that we can manage and protect all the content that we need to distribute over the wire. Sharing property content can be done more easily.
Scalable in multiple points
Media Service is constructed in such a way that we can scale different components of it separately. For example we can scale separately the streaming part of it, without having to scale the ingest nodes.
Secure connection
Not only that the content that is send over the wire to end customers is secure, but also media content that is uploaded can be uploaded in a secure and reliable way.
AES Encryption
If DRM system for content management cannot be used by your clients, you can encrypt the content that is send over the wire using AES. In this way you will be able to stream protected content to devices that don’t have a player with DRM support.
Pay only what you use
In the media steaming would it is extremely important to be able to use and pay only what you use. In this way, Media Services don’t require to reserve CPU power for a peek that you many not reach or for an encoding process in advance. You will pay only what you use – that is more cost efficiently.
Media Services are integrated with Azure CDNs 100%. This mean that this streaming service is using CDNs to reach clients, decreasing the latency and backend resources needs.
Multiple formats support
Encoding and streaming can be made on multiple formats and quality level, based on our needs. This mean that we can encode for example music in MP4 format with different bitrates.
One content format to multiple content formats
This services allow us to store on backend only one copy of our content in a specific format that can be converted on the fly to other formats, based on clients needs.
Azure Media Indexer
We could say that this services is a service inside another services. It allow us to index the content of our media as text file that can be searchable.
Ads Support
There is full support to push adds from the backend to client player in different ways, based on client type. We have 3 types of adds that we can push to our clients:

  • Companion – for ads that are displayed outside the player
  • Liniar – for adds that pause the player and use all the space occupied by the media
  • Nonlinioar – for adds that are partial cover the media content on client side

Video/Audio Formats Supported
There is a wide variety of supported formats that are accepted at encode level but also at export level. This includes wmv, mp4, ismv, ac3, m2v, avi, 3gp, MPEG and so on.

5 Live Channels per Media Service Account
In this moment you are limited to maximum 5 live channels in parallel (more can be requested using a ticket).
25 encoding units
This is the maximum number of encoding units that can be created for a account.

Applicable Use Cases 
Below you can find 3 use cases when I would use Media Services:
Conference Live Streaming 
Streaming a life conference can be a hard thing because it is hard to predict how many users will be online and how to manage peeks. Using Media Services you can manage very easily this kind of scenario.
On Demand Video
I would use Media Streaming if I would need to share video content based on user requires (and payment). We could store hundreds of media content and provide to specific clients only the content that they request.
Stream for Video Advertisement
I would use Media Services if I would need to stream the adds for multiple supermarkets. In this case you would need to be able to share the same content to multiple location in a secure and cost efficient way.

Code Sample 
I recomand the fallowing two samples that describe how to upload new content to Azure Media Services and how to use them (from client perspective).

Pros and Cons 

  • Scalable
  • Multiple formats (for ingest and streaming)
  • Cross platform capabilities
  • Live Streaming
  • DRM Support
  • Cannot be used when you have multiple live streams and multiple clients that listen to them (100.000 ingest sources and 200.000 clients for example) – video surveying 

When you calculate the costs of Media Services you should take into account the fallowing:

  • How much data you want to encode
  • How much content you want to index
  • How much media storage you want to store
  • Quantity of outbound traffic 

In this moment I would say YES. Media Services is finally mature product that can be used with success for use cases when you need to stream large quantities of media content. I invite you to look over it and keep it under the radar when you will need such a functionality.


Popular posts from this blog

ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded

Today blog post will be started with the following error when running DB tests on the CI machine:
threw exception: System.InvalidOperationException: The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' registered in the application config file for the ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See for more information. at System.Data.Entity.Infrastructure.DependencyResolution.ProviderServicesFactory.GetInstance(String providerTypeName, String providerInvariantName) This error happened only on the Continuous Integration machine. On the devs machines, everything has fine. The classic problem – on my machine it’s working. The CI has the following configuration:

TeamCity.NET 4.51EF 6.0.2VS2013
It seems that there …

Entity Framework (EF) TransactionScope vs Database.BeginTransaction

In today blog post we will talk a little about a new feature that is available on EF6+ related to Transactions.
Until now, when we had to use transaction we used ‘TransactionScope’. It works great and I would say that is something that is now in our blood.
using (var scope = new TransactionScope(TransactionScopeOption.Required)) { using (SqlConnection conn = new SqlConnection("...")) { conn.Open(); SqlCommand sqlCommand = new SqlCommand(); sqlCommand.Connection = conn; sqlCommand.CommandText = ... sqlCommand.ExecuteNonQuery(); ... } scope.Complete(); } Starting with EF6.0 we have a new way to work with transactions. The new approach is based on Database.BeginTransaction(), Database.Rollback(), Database.Commit(). Yes, no more TransactionScope.
In the followi…

GET call of REST API that contains '/'-slash character in the value of a parameter

Let’s assume that we have the following scenario: I have a public HTTP endpoint and I need to post some content using GET command. One of the parameters contains special characters like “\” and “/”. If the endpoint is an ApiController than you may have problems if you encode the parameter using the http encoder.
using (var httpClient = new HttpClient()) { httpClient.BaseAddress = baseUrl; Task<HttpResponseMessage> response = httpClient.GetAsync(string.Format("api/foo/{0}", "qwert/qwerqwer"))); response.Wait(); response.Result.EnsureSuccessStatusCode(); } One possible solution would be to encode the query parameter using UrlTokenEncode method of HttpServerUtility class and GetBytes method ofUTF8. In this way you would get the array of bytes of the parameter and encode them as a url token.
The following code show to you how you could write the encode and decode methods.