简体   繁体   中英

How to speed up Azure media services encoding

I am uploading videos in Azure media services (here the video size may vary) and requires adaptive streaming. So as far my knowledge (if not wrong) for that the below steps need to be done.

1) Upload video to Azure media services.

2) Encode the videos (time taking)

3) Publish URL.

Here when I do the above operations for a video, it is taking more time say above 2 minutes which is causing performance related issues. I need to know is there any way or any optimization for increasing the performance. I am using MVC Web Api which is called by iOS app. Here the web api is taking time for the above processes.

Encoding is time consuming process and you should not block a UI call and wait until job processing is done. Once job is created you will get job id which you can use to track job progress in separate process and notify user for example with push notification when encoding is done.

See https://azure.microsoft.com/en-us/documentation/articles/media-services-rest-check-job-progress/ to see how to implement polling of job progress.

You can also create a job associated with notification subscription and utilize azure storage queue to get notification: https://msdn.microsoft.com/en-us/library/azure/hh974289.aspx#create_jobs_with_notifications . You can look into end to end test TestJobWithTaskNotificationToBothAzureQueueAndWebHookEndPoint() in https://github.com/Azure/azure-sdk-for-media-services/blob/dev/test/net/Scenario/JobTests.cs .

To speed up encoding itself you need to consider buying Media Reserved Units to have ability to process many job in parallel and have reserved processing capacity which is not shared with other tenants. This make sense when you have a lot of users uploading and encoding videos simultaneously. But as i mentioned above it will not fully solve delay problem you described. You don't need to block and wait in your UI app while jobs are in processing state.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM