Showing posts with label Blob. Show all posts
Showing posts with label Blob. Show all posts

Thursday, 28 June 2018

Microsoft Azure Media Service – Encoding & Indexing Process using C#.Net – Part 1

I would like to share development experience during the process of converting media encoding and transcribing using Azure media service. There are many resources available on Microsoft and other sites still, I would try my best to explain the process via practical scenario so that anyone would understand easy by referring to this blog.

There are many media industries who have lots of media(audio/video) libraries, those files are large may be too large to deliver content over the Internet for his customer. To deliver smooth media over the internet it requires encoding process. Encoding is a phenomenon which compresses video and audio by using Azure Media Services and publish over the internet for on demand playlist.

Below are the pre-requirement to process before development :

  • IDE -Visual Studio 2015/2017
  • C#.NET
  • Azure SDK
  • Azure Media Service
  • Azure Storage Account

Azure Media Services Encoder and Indexing Manual Process through Azure web portal:

  1.  Log in to the Azure portal and open Media Service and click on Assets – Here you can click on Upload button and upload the video file those you want to encoding and streaming over the internet.
  2. After successfully uploaded video file – you can select upload file and click on top bar Encode button and select encoding preset information – hit the Start button to initiate the process.
  3. After initiating process – you can review job progress on click at Job tab
  4. After completion of encoding job, it would have processed output Multi-bitrate output files.
  5. Publish the encoded content – and select the Locator URL to Play the video over the Media player. Sample Azure Media Player
  6. For Indexing/Transcribing those video file select Analyze button and create Indexing job for closed captioning files.
  7. Once click on create it would also initiate job in background after finished status - it would generate output files like SAMI, TTML, and WebVTT output files.
  8. Published and generate URL and attach *.VTT file along with Media Player so that content would show on a player during streaming.

So that’s all about the manual process for encoding and indexing process of media files !!!

I would request you to follow the steps and do manual process and I will create a new post in Part 2 of this blog with dynamic operation using C#.NET.

Stay Tuned!!!!

Monday, 5 March 2018

Automation Process - Azure Storage Account To Azure Media Service Encoding Process




Today, I would like to share detail on automation process that we implemented in our recent development work.

I split blog in three division so that it would help for better understanding. 

Problem Statement:

We had implemented Cloud service for existing library files to process Azure media encoding and transcribing process so that it processed all the thousands of files successfully.

Now- Based on new requirement end user would upload files from the web application and that newly uploaded files would store in Azure Storage account.

We have to reuse existing cloud service source code logic so that it would process new uploaded media file for encoding and transcribing job.


The solution we design:

As we approach Azure function and mediator to communicate cloud service, new media upload.
Below is the high-level cross-functional diagram.



Actual Implementation: 

Azure functions is a solution for easily running small pieces of code in the cloud. we can write just the code you need for the problem at hand, without worrying about a whole application or the infrastructure to run it. 

We have implemented an Azure function in a language of choice, such as C#, F#, Node.js, Java, or PHP. 

We created in C# as per below code snippet so that once new blob upload from web to storage account it would auto trigger and send a message to blob queue.

#r "Microsoft.WindowsAzure.Storage"
using Microsoft.WindowsAzure.Storage.Blob;
using Microsoft.WindowsAzure.Storage.Queue;

public static void Run(CloudBlockBlob myBlob, string name, ICollector<string> blobQueueItem, TraceWriter log)
{
log.Info($"C# Blob trigger function Processed blob\n Name:{name} \n URI: {myBlob.Uri} ");
blobQueueItem.Add(myBlob.Uri.ToString());
}


On other ends Cloud, service would de-queue message and send new uploaded assets to process encoding and transcribing service.


 CloudBlobClient sourceCloudBlobClient = sourceStorageAccount.CreateCloudBlobClient();
CloudBlobContainer sourceContainer = sourceCloudBlobClient.GetContainerReference(AppConfiguration.SourceBlobContainerName);
CloudBlobClient amsCloudBlobClient = amsStorageAccount.CreateCloudBlobClient();

 CloudQueue AzureCloudQueue = AzureQueueClient.GetQueueReference(AppConfiguration.blobqueuename);
 var azureQueueMessageList = AzureCloudQueue.GetMessages();


I request you to share your thoughts on the same and I would really appreciate if you could provide your valuable feedback.

Thanks!!! 

Xamarin - Cross Platform Mobile Development

Xamarin - Cross Platform Mobile Development Xamarin is one of the most popular cross-platform frameworks at the moment. Xamarin devel...