⬆️ ⬇️

Encode content in Dolby Digital Plus with a certified codec in the cloud on request

In this article we’ll talk about using Dolby Digital Plus certified audio codec to encode media data on demand in the Windows Azure Media Services cloud.







Windows Azure Media Encoder



The Windows Azure Media Encoder (WAME) is an engine that contains a set of pre-installed, certified, and ready-to-use codecs for encoding video and audio content in the Windows Azure Media Services cloud service. Recently, this engine received a big update, the main novelty of which was the support of the certified Dolby Digital Plus codec. In addition, the third version of the engine learned how to generate several output files with different audio formats at once within the same encoding task. Some other features have been added.



Dolby Digital Plus



image

')

Dolby Digital Plus (Enhanced AC-3, E-AC-3) is an advanced audio codec for encoding multi-channel surround sound developed by Dolby Laboratories, Inc. A distinctive feature of the codec is a large number of supported audio channels, optimization and low requirements for the width of communication channels.



Media Services Support



The Windows Azure Media Services platform offers a built-in certified Dolby Digital Plus codec for encoding stereo and six-channel audio. Users can use the cloud platform to build solutions working with this codec.



Dolby Digital Plus encoding support is provided via the <DolbyDigitalPlusAudioProfile> configuration profile. Let's take a closer look at working with codecs in Windows Azure Media Services.



Work with codecs



To create a media content encoding task in the cloud, the user must prepare an XML configuration file, specifying the required encoding parameters and listing the necessary codec profiles.



<AudioProfile Condition="SourceContainsAudio"> <DolbyDigitalPlusAudioProfile Codec="DolbyDigitalPlus" EncoderMode="DolbyDigitalPlus" AudioCodingMode="Mode20" LFEOn="False" SamplesPerSecond="48000" DialogNormalization="-31"> <Bitrate> <ConstantBitrate Bitrate="128" IsTwoPass="False" BufferWindow="00:00:00" /> </Bitrate> </DolbyDigitalPlusAudioProfile> </AudioProfile> 


In the picture you can see the fully configured settings for the <DolbyDigitalPlusAudioProfile> profile, which allows you to transcode content with a new codec.



Under these links, you can find ready-made XML configuration files for encoding in Dolby Digital Plus stereo and multichannel modes.



Let's consider their use in the code of the demonstration project.



Work with codecs - code



 IJob job = context.Jobs.Create("Encode with Dolby"); IMediaProcessor mediaProcessor = context.MediaProcessors .Where(x => x.Name == "Windows Azure Media Encoder") .ToList().OrderBy(x => new Version(x.Version)).LastOrDefault(); 


In the first step, we create instances of the task to convert the content and media processor to perform this task.



 var SSConfig = File.ReadAllText(@"C:\temp\dolby.xml"); 


Then we get the text of the configuration file.



 ITask encodeTask = job.Tasks.AddNew("Encoding to Dolby", mediaProcessor, SSConfig, TaskOptions.None); encodeTask.InputAssets.Add(inputAsset); encodeTask.OutputAssets.AddNew("Video with Dolby", AssetCreationOptions.None); 


The next step is to create a new instance of the encoding task for the conversion task, indicating the processor and the encoding configuration. Add the input to the encoding task and set the output files.



 job.StateChanged += Job_StateChanged; job.Submit(); job.GetExecutionProgressTask(CancellationToken.None).Wait(); 


The final step is to add a task handler to receive notifications about the progress of content processing in the cloud and send the task for execution.



It's all. As you can see, working with the Windows Azure Media Services media platform is easy. Let me remind you that the SDK toolkit for working with the platform is for both .NET and Java .



Access to results



image



Access to the results of the content coding task can be made both from the code and from the management portal. All data is stored in Windows Azure Storage blob storage.



Support for encoding multiple audio formats in one task



Another new feature in Windows Azure Media Services is the ability to encode content in one task at once into several separate audio formats.



 <Preset Version="5.0"> <Job /> <MediaFile DeinterlaceMode="AutoPixelAdaptive" ResizeQuality="Super" NormalizeAudio="True" AudioGainLevel="1" VideoResizeMode="Stretch"> <OutputFormat> <MP4OutputFormat StreamCompatibility="Standard"> <AudioProfile Condition="SourceContainsAudio"> <DolbyDigitalPlusAudioProfile> <!-- attributes not shown for brevity --> </DolbyDigitalPlusAudioProfile> </AudioProfile> </MP4OutputFormat> </OutputFormat> </MediaFile> </Preset> 


For this purpose, new sections <presets> and <preset> have been added in the configuration file, which allow you to specify the required formats.



You can find an example of such a configuration at the specified link .



Other updates WAME 3.0



In addition to the main innovations in the new WAME 3.0 engine, several other less significant features were introduced. Among them:





Windows Azure Media Services



It is worth recalling what is Windows Azure Media Services .



Windows Azure Media Services is a media platform with a ready infrastructure for solving problems of consumption, storage, protection, processing and conversion, distribution of content to all devices and platforms.



Media Services is a platform that contains everything you need to build your own media solutions at no cost to your own infrastructure, its configuration and maintenance.



Media Services allows you to organize solutions for access to video on demand (Video on Demand) and solutions with live broadcasts. Live broadcasts were tested in a number of major events, including during the London Olympics, when broadcasts for millions of viewers in dozens of countries were conducted through the Windows Azure Media Services platform.



Details about the platform can be found at the specified link .



Do not miss



Do not miss the previous announcements of updates to the Windows Azure platform, which are released almost every week:





useful links



Below you will find links to resources that will help you in using the Microsoft cloud platform:





And if you are already developing on Windows Azure or want to find the developers of your service, visit appprofessionals.ru .



We will be happy to answer your questions at azurerus@microsoft.com . And we are waiting for you in the Windows Azure Community on Facebook . Here you will find experts (don't forget to ask them questions), photos, and lots and lots of news.



Video recordings of Windows Azure Summit reports and video interviews that were conducted during a large cloud conference. DevCon 2013 Windows Azure conference talks you can find here .

Source: https://habr.com/ru/post/186206/



All Articles