How to: Get a Media Processor Instance
This article is part of the Media Services Video on Demand workflow series.
In Media Services a media processor is a component that handles a specific processing task, such as encoding, format conversion, encrypting, or decrypting media content. You typically create a media processor when you are creating a task to encode, encrypt, or convert the format of media content.
The following table provides the name and description of each available media processor.
The following method shows how to get a media processor instance. The code example assumes the use of a module-level variable named _context to reference the server context as described in the section How to: Connect to Media Services Programmatically.
private static IMediaProcessor GetLatestMediaProcessorByName(string mediaProcessorName)
var processor = _context.MediaProcessors.Where(p => p.Name == mediaProcessorName).
ToList().OrderBy(p => new Version(p.Version)).LastOrDefault();
if (processor == null)
throw new ArgumentException(string.Format("Unknown media processor", mediaProcessorName));
Now that you know how to get a media processor instance, go to the How to Encode an Asset topic which will show you how to use the Azure Media Encoder to encode an asset.