本文整理匯總了C#中Microsoft.WindowsAzure.MediaServices.Client.CloudMediaContext.GetMediaProcessor方法的典型用法代碼示例。如果您正苦於以下問題:C# CloudMediaContext.GetMediaProcessor方法的具體用法?C# CloudMediaContext.GetMediaProcessor怎麽用?C# CloudMediaContext.GetMediaProcessor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Microsoft.WindowsAzure.MediaServices.Client.CloudMediaContext
的用法示例。
在下文中一共展示了CloudMediaContext.GetMediaProcessor方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Main
static int Main(string[] args)
{
if (args.Length != 1)
{
Console.Error.WriteLine("MP4ToSmoothStream <asset-id>");
return -1;
}
string accountName = Environment.GetEnvironmentVariable("ACCOUNT_NAME");
string accountKey = Environment.GetEnvironmentVariable("ACCOUNT_KEY");
CloudMediaContext cloudMediaContext = new CloudMediaContext(accountName, accountKey);
string assetId = args[0];
IAsset asset = cloudMediaContext.FindAssetById(assetId);
IJob job = cloudMediaContext.Jobs.Create(string.Format("Convert {0} to Smooth Stream", asset.Name));
IMediaProcessor processor = cloudMediaContext.GetMediaProcessor("Windows Azure Media Encoder");
ITask task = job.Tasks.AddNew("MP4 to Smooth Stream Conversion",
processor,
"H264 Smooth Streaming 720p", // Task Preset. Amend as required.
Microsoft.WindowsAzure.MediaServices.Client.TaskOptions.ProtectedConfiguration);
task.InputAssets.Add(asset);
task.OutputAssets.AddNew(string.Format("Smooth Stream for {0}", asset.Name),
AssetCreationOptions.None);
job.Submit();
Console.WriteLine("{0}\t{1}\t{2}\t{3}\t{4}", job.Id, job.Name, job.State, job.RunningDuration, job.LastModified);
return 0;
}