Skip to content

Instantly share code, notes, and snippets.

@nmackenzie
Created October 1, 2013 05:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nmackenzie/6774373 to your computer and use it in GitHub Desktop.
Save nmackenzie/6774373 to your computer and use it in GitHub Desktop.
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