Home

Introducing an experimental content-aware encoding in Azure Media Services

%3CLINGO-SUB%20id%3D%22lingo-sub-400617%22%20slang%3D%22en-US%22%3EIntroducing%20an%20experimental%20content-aware%20encoding%20in%20Azure%20Media%20Services%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-400617%22%20slang%3D%22en-US%22%3E%3CH1%20id%3D%22toc-hId-1898358761%22%20id%3D%22toc-hId-1898388709%22%3EOverview%3C%2FH1%3E%0A%3CP%3EIn%20order%20to%20prepare%20content%20for%20delivery%20by%20%3CA%20href%3D%22https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FAdaptive_bitrate_streaming%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eadaptive%20bitrate%20streaming%3C%2FA%3E%2C%20the%20video%20needs%20to%20be%20encoded%20at%20multiple%20bit-rates%20(high%20to%20low).%20In%20order%20to%20ensure%20graceful%20degradation%20of%20quality%2C%20as%20the%20bitrate%20is%20lowered%2C%20so%20is%20the%20resolution%20of%20the%20video.%20This%20results%20in%20a%20so-called%20encoding%20ladder%20%E2%80%93%20a%20table%20of%20resolutions%20and%20bitrates%2C%20as%20you%20can%20see%20in%20some%20of%20our%20fixed%20encoding%20presets%2C%20such%20as%20%E2%80%9C%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fmedia-services%2Fprevious%2Fmedia-services-mes-preset-h264-multiple-bitrate-1080p%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EH264MultipleBitrate1080p%3C%2FA%3E%E2%80%9D.%3C%2FP%3E%0A%3CP%3EInterest%20in%20moving%20beyond%20a%20one-preset-fits-all-videos%20approach%20increased%20after%20Netflix%20published%20their%20%3CA%20href%3D%22https%3A%2F%2Fmedium.com%2Fnetflix-techblog%2Fper-title-encode-optimization-7e99442b62a2%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eblog%3C%2FA%3E%20in%20December%202015.%20Since%20then%2C%20multiple%20solutions%20for%20content-aware%20encoding%20have%20been%20released%20in%20the%20marketplace%20%E2%80%93%20see%20%3CA%20href%3D%22https%3A%2F%2Fwww.streamingmedia.com%2FArticles%2FEditorial%2FFeatured-Articles%2FBuyers-Guide-to-Per-Title-Encoding-130676.aspx%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ethis%3C%2FA%3E%20article%20for%20an%20overview.%20The%20idea%20is%20to%20be%20aware%20of%20the%20content%20%E2%80%93%20to%20customize%20or%20tune%20the%20encoding%20ladder%20to%20the%20complexity%20of%20the%20individual%20video.%20%26nbsp%3BAt%20each%20resolution%2C%20there%20is%20a%20bitrate%20beyond%20which%20any%20increase%20in%20quality%20is%20not%20perceptive%20%E2%80%93%20the%20encoder%20operates%20at%20this%20optimal%20bitrate%20value.%20The%20next%20level%20of%20optimization%20is%20to%20select%20the%20resolutions%20based%20on%20the%20content%20%E2%80%93%20for%20example%2C%20a%20video%20of%20a%20PowerPoint%20presentation%20does%20not%20benefit%20from%20going%20below%20720p.%20Going%20further%2C%20the%20encoder%20can%20be%20tasked%20to%20optimize%20the%20settings%20for%20each%20shot%20within%20the%20video%20%E2%80%93%20Netflix%20described%20such%20%3CA%20href%3D%22https%3A%2F%2Fmedium.com%2Fnetflix-techblog%2Foptimized-shot-based-encodes-now-streaming-4b9464204830%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eapproach%3C%2FA%3E%20in%202018.%3C%2FP%3E%0A%3CP%3EIn%20early%202017%2C%20we%20released%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fmedia-services%2Flatest%2Fautogen-bitrate-ladder%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EAdaptive%20Streaming%3C%2FA%3E%20preset%20to%20address%20the%20problem%20of%20the%20variability%20in%20the%20quality%20and%20resolution%20of%20the%20source%20videos.%20Our%20customers%20had%20a%20varying%20mix%20of%20content%20%E2%80%93%20some%20at%201080p%2C%20others%20at%20720p%2C%20and%20a%20few%20at%20SD%20and%20lower%20resolutions.%20Further%2C%20not%20all%20source%20content%20were%20high%20quality%20mezzanines%20from%20film%20or%20TV%20studios.%20The%20Adaptive%20Streaming%20preset%20addressed%20these%20problems%20by%20ensuring%20that%20the%20bitrate%20ladder%20never%20exceeds%20the%20resolution%20or%20the%20average%20bitrate%20of%20the%20input%20mezzanine.%3C%2FP%3E%0A%3CP%3EThe%20experimental%20content-aware%20encoding%20preset%20extends%20that%20mechanism%2C%20by%20incorporating%20custom%20logic%20that%20lets%20the%20encoder%20seek%20the%20optimal%20bitrate%20value%20for%20a%20given%20resolution%2C%20but%20without%20requiring%20extensive%20computational%20analysis.%20The%20net%20result%20is%20that%20this%20new%20preset%20produces%20an%20output%20that%20has%20lower%20bitrate%20than%20the%20Adaptive%20Streaming%20preset%2C%20but%20at%20a%20higher%20quality.%20See%20sample%20graphs%20below%2C%20that%20show%20the%20comparison%20using%20quality%20metrics%20like%20%3CA%20href%3D%22https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FPeak_signal-to-noise_ratio%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPSNR%3C%2FA%3E%20and%20%3CA%20href%3D%22https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FVideo_Multimethod_Assessment_Fusion%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EVMAF%3C%2FA%3E.%20The%20source%20was%20created%20by%20concatenating%20short%20clips%20of%20high%20complexity%20shots%20from%20movies%20and%20TV%20shows%2C%20intended%20to%20stress%20the%20encoder.%20By%20definition%2C%20this%20preset%20produces%20results%20that%20vary%20from%20content%20to%20content%20%E2%80%93%20it%20also%20means%20that%20for%20some%20content%2C%20there%20may%20not%20be%20significant%20reduction%20in%20bitrate%20or%20improvement%20in%20quality.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20732px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F105863i7C3A44CECD39267E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22aaa.png%22%20title%3D%22aaa.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20681px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F105865i26F1C406067FE7E9%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22bbb.png%22%20title%3D%22bbb.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20present%20currently%20is%20tuned%20for%20high%20complexity%2C%20high%20quality%20source%20videos%20(movies%2C%20TV%20shows).%20Work%20is%20in%20progress%20to%20adapt%20to%20low%20complexity%20(eg.%20PowerPoint%20presentations)%20content%2C%20as%20well%20as%20poorer%20quality%20videos.%20This%20preset%20also%20uses%20the%20same%20set%20of%20resolutions%20as%20the%20Adaptive%20Streaming%20preset%20%E2%80%93%20we%20are%20working%20on%20methods%20to%20select%20the%20minimal%20set%20of%20resolutions%20based%20on%20the%20content.%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId--653798200%22%20id%3D%22toc-hId--653768252%22%3EUsing%20the%20experimental%20preset%3C%2FH1%3E%0A%3CP%3EYou%20can%20create%20Transforms%20that%20use%20this%20preset%20as%20follows.%20If%20using%20a%20tutorial%20like%20this%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fmedia-services%2Flatest%2Fstream-files-tutorial-with-api%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Eone%3C%2FA%3E%2C%20you%20can%20update%20the%20code%20as%20follows%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20TransformOutput%5B%5D%20output%20%3D%20new%20TransformOutput%5B%5D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20new%20TransformOutput%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2F%2F%20The%20preset%20for%20the%20Transform%20is%20set%20to%20one%20of%20Media%20Services%20built-in%20sample%20presets.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2F%2F%20You%20can%26nbsp%3B%20customize%20the%20encoding%20settings%20by%20changing%20this%20to%20use%20%22StandardEncoderPreset%22%20class.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BPreset%20%3D%20new%20BuiltInStandardEncoderPreset()%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2F%2F%20This%20sample%20uses%20the%20new%20experimental%20preset%20for%20content-aware%20encoding%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20PresetName%20%3D%20EncoderNamedPreset.%20ContentAwareEncodingExperimental%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%7D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-1089012135%22%20id%3D%22toc-hId-1089042083%22%3ENext%20steps%3C%2FH1%3E%0A%3CP%3ENow%20that%20you%20have%20learnt%20about%20this%20new%20option%20of%20optimizing%20your%20videos%2C%20we%20invite%20you%20to%20try%20it%20out.%20You%20can%20send%20us%20feedback%20via%20the%20link%20below%2C%20or%20engage%20us%20more%20directly%20at%20%3CA%20href%3D%22mailto%3Aamsved%40microsoft.com%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eamsved%40microsoft.com%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-400617%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMedia%20Services%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Anil Murching
Microsoft

Overview

In order to prepare content for delivery by adaptive bitrate streaming, the video needs to be encoded at multiple bit-rates (high to low). In order to ensure graceful degradation of quality, as the bitrate is lowered, so is the resolution of the video. This results in a so-called encoding ladder – a table of resolutions and bitrates, as you can see in some of our fixed encoding presets, such as “H264MultipleBitrate1080p”.

Interest in moving beyond a one-preset-fits-all-videos approach increased after Netflix published their blog in December 2015. Since then, multiple solutions for content-aware encoding have been released in the marketplace – see this article for an overview. The idea is to be aware of the content – to customize or tune the encoding ladder to the complexity of the individual video.  At each resolution, there is a bitrate beyond which any increase in quality is not perceptive – the encoder operates at this optimal bitrate value. The next level of optimization is to select the resolutions based on the content – for example, a video of a PowerPoint presentation does not benefit from going below 720p. Going further, the encoder can be tasked to optimize the settings for each shot within the video – Netflix described such approach in 2018.

In early 2017, we released the Adaptive Streaming preset to address the problem of the variability in the quality and resolution of the source videos. Our customers had a varying mix of content – some at 1080p, others at 720p, and a few at SD and lower resolutions. Further, not all source content were high quality mezzanines from film or TV studios. The Adaptive Streaming preset addressed these problems by ensuring that the bitrate ladder never exceeds the resolution or the average bitrate of the input mezzanine.

The experimental content-aware encoding preset extends that mechanism, by incorporating custom logic that lets the encoder seek the optimal bitrate value for a given resolution, but without requiring extensive computational analysis. The net result is that this new preset produces an output that has lower bitrate than the Adaptive Streaming preset, but at a higher quality. See sample graphs below, that show the comparison using quality metrics like PSNR and VMAF. The source was created by concatenating short clips of high complexity shots from movies and TV shows, intended to stress the encoder. By definition, this preset produces results that vary from content to content – it also means that for some content, there may not be significant reduction in bitrate or improvement in quality.

aaa.png

 

bbb.png

 

The present currently is tuned for high complexity, high quality source videos (movies, TV shows). Work is in progress to adapt to low complexity (eg. PowerPoint presentations) content, as well as poorer quality videos. This preset also uses the same set of resolutions as the Adaptive Streaming preset – we are working on methods to select the minimal set of resolutions based on the content.

Using the experimental preset

You can create Transforms that use this preset as follows. If using a tutorial like this one, you can update the code as follows:

        TransformOutput[] output = new TransformOutput[]

        {

            new TransformOutput

            {

                // The preset for the Transform is set to one of Media Services built-in sample presets.

                // You can  customize the encoding settings by changing this to use "StandardEncoderPreset" class.

                Preset = new BuiltInStandardEncoderPreset()

                {

                    // This sample uses the new experimental preset for content-aware encoding

                    PresetName = EncoderNamedPreset. ContentAwareEncodingExperimental

                }

            }

        };

Next steps

Now that you have learnt about this new option of optimizing your videos, we invite you to try it out. You can send us feedback via the link below, or engage us more directly at amsved@microsoft.com

 

 

 

Related Conversations
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
Tabs and Dark Mode
cjc2112 in Discussions on
30 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
29 Replies