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.
|Media Processor Name ||Description ||More Information |
|Azure Media Encoder ||Lets you run encoding tasks using the Media Encoder. || Task Preset Strings for the Azure Media Encoder |
|Windows Azure Media Packager ||Lets you convert media assets from .mp4 to smooth streaming format. Also, lets you convert media assets from smooth streaming to the Apple HTTP Live Streaming (HLS) format. ||Task Preset Strings for the Azure Media Packager |
|Windows Azure Media Encryptor ||Lets you encrypt media assets using PlayReady Protection. ||Task Preset Strings for the Azure Media Packager |
|Azure Media Indexer ||Enables you to make media files and content searchable, as well as generate closed captioning tracks and keywords. ||N/A |
|Storage Decryption ||Lets you decrypt media assets that were encrypted using storage encryption. ||N/A |
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.