Created
October 1, 2013 05:51
-
-
Save nmackenzie/6774373 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String inputAssetId = ASSET_ID; | |
IJob job = context.Jobs.Create("Encoding job"); | |
// Note that there are two Windows Azure Media Encoder processors | |
IMediaProcessor processor = context.MediaProcessors | |
.Where(p => p.Name == "Windows Azure Media Encoder") | |
.ToList() | |
.OrderBy(p => new Version(p.Version)) | |
.LastOrDefault(); | |
ITask task = job.Tasks.AddNew( | |
"Encoding task", | |
processor, | |
"VC1 Broadband 720p", | |
TaskOptions.ProtectedConfiguration); | |
IAsset inputAsset = context.Assets | |
.Where(a => a.Id == inputAssetId) | |
.FirstOrDefault(); | |
task.InputAssets.Add(inputAsset); | |
task.OutputAssets.AddNew("Output asset", AssetCreationOptions.None); | |
job.Submit(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment