Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Serving Video Content from Azure Blob Storage

I am trying to serve MP4 Video content from Azure Blob Storage. I can get the video to play in modern browsers by ensuring that the Blob's Content Type is set to video/mp4; however I am unable to seek backwards.

Dropping the same video into an S3 bucket yields the desired result so I am ruling out problems with the content.

Do I need to configure the Storage role in a specific way to serve video content?

like image 648
JonnyReeves Avatar asked Jul 16 '12 11:07

JonnyReeves


People also ask

Can we store video in BLOB storage?

Azure Blob Storage: If you are just looking to store JPEG or PNG images, you should keep those in Azure Blob Storage. There is no benefit to putting them in your Media Services account unless you want to keep them associated with your Video or Audio Assets.

Is Azure Blob Storage ideal for streaming video and audio?

The correct answer is option A (Blob). Blob storage type should be used for streaming audio and video files. Azure Blob storage is mainly used for unstructured large files such as audio, video, images, backup files, etc.

Does Azure blob support streaming?

Blob storage is designed for: Serving images or documents directly to a browser. Storing files for distributed access. Streaming video and audio.


1 Answers

it was not clear for me from @smarx's answer how to set that for my blob container - but after some googling i found the code below. Just execute it in LINQPad, and video will start streaming:

var storageAccount = CloudStorageAccount.Parse("AccountName=<accountName>;AccountKey=<accountKeyBase64>;DefaultEndpointsProtocol=http");
var blobClient = storageAccount.CreateCloudBlobClient();

// Get the current service properties
var serviceProperties = blobClient.GetServiceProperties();

// Set the default service version to 2011-08-18 (or a higher version like 2012-03-01)
serviceProperties.DefaultServiceVersion = "2011-08-18";

// Save the updated service properties
blobClient.SetServiceProperties(serviceProperties);
like image 177
avs099 Avatar answered Oct 12 '22 13:10

avs099