本文整理汇总了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;
}