Using preset overrides to control per-job settings

Media Services logo v3


Warning

Azure Media Services will be retired June 30th, 2024. For more information, see the AMS Retirement Guide.

Tip

Want to generate thumbnails, stitch two videos together, subclip a video or rotate it (among other things)? You can find Media Services sample code on the Samples page.

Transforms and jobs overview

To encode with Media Services v3, you need to create a Transform and a Job. The transform defines a recipe for your encoding settings and outputs; the job is an instance of the recipe. For more information, see Transforms and Jobs.

When encoding or using analytics with Media Services you can define custom presets in a transform to define what settings to use. Sometimes it is required to override the settings on a transform on a per-job basis to avoid having to create a custom transform for every scenario. To override any setting on your transform preset, you can use the preset override property of the job output asset prior to submitting the job to the transform.

Preset overrides

Preset overrides give you the ability to pass in a customized preset that will override the settings supplied to a transform object after it was created. This property is available on the job output asset when submitting a new job to a transform.

This can be useful for situations where you need to override some properties of your custom defined transforms, or a property on a built-in preset. For example, consider the scenario where you have created a custom transform that uses the audio analyzer built-in preset, but you initially set up that preset to use the audio language setting of "en-us" for English. This would result in a transform where each job submitted would be sent to the speech-to-text transcription engine as US English only. Every job submitted to that transform would be locked to the "en-us" language setting. You could work around this scenario by having a transform defined for every language, but that would be much more difficult to manage and you could hit transform quota limitations in your account. To best solve for this scenario, you use a preset override on the job output asset prior to submitting the job to the transform. You can then define a single "Audio transcription" transform and pass in the required language settings per-job.

The preset override provides you a way to pass in a new custom preset definition with each job submitted to the transform. This property is available on the job output entity in all SDK versions based off the 2021-06-01 version of the API.

For reference, see the presetOverride property on the job output entity in the REST documentation.

Note

You can only use preset overrides to override the settings on a defined preset in the transform. You cannot switch from one specific preset to another type. For example, attempting to override a transform created with the built-in content-aware encoding preset to use another preset like the audio analyzer would result in an error message.

Note

AudioAnalyzerPreset is not supported if the storage account does not have public network access.

Sample code

Get help and support

You can contact Media Services with questions or follow our updates by one of the following methods: