Microsoft Azure Review
Bending the Windows Azure Media Services–H.264 Baseline profile


Disclaimer: What I will describe here is not officially supported by Microsoft and by Windows Azure Media Services. This means that if task fails you cannot open support ticket, nor you can complain. I discovered these hidden feature by digging deeply into the platform. Use the code and task preset at your own risk and responsibility. And note that what works now, may not work tomorrow.

Exploring the boundaries of Windows Azure Media Services (WAMS), and following questions on StackOverflow and respective MSDN Forums, it appears that WAMS has previously supported H.264 Baseline Profile and have had a task preset for Baseline Profile. But now it only has Main Profile and High Profile task presets. And because the official documentation says that Baseline Profile is supported output format, I don’t see anything wrong in exploring how to achieve that.

So what can we do, to encode a video into H.264 baseline profile if we really want? Well, use the following Task Preset at your own will (and risk :) ):

01 <?xml version="1.0" encoding="utf-16"?>
02 <!--Created with Expression Encoder version 4.0.4276.0-->
03 <Preset
04   Version="4.0">
05   <Job />
06   <MediaFile
07     WindowsMediaProfileLanguage="en-US"
08     VideoResizeMode="Letterbox">
09     <OutputFormat>
10       <MP4OutputFormat
11         StreamCompatibility="Standard">
12         <VideoProfile>
13           <BaselineH264VideoProfile
14             RDOptimizationMode="Speed"
15             HadamardTransform="False"
16             SubBlockMotionSearchMode="Speed"
17             MultiReferenceMotionSearchMode="Speed"
18             ReferenceBFrames="True"
19             AdaptiveBFrames="True"
20             SceneChangeDetector="True"
21             FastIntraDecisions="False"
22             FastInterDecisions="False"
23             SubPixelMode="Quarter"
24             SliceCount="0"
25             KeyFrameDistance="00:00:05"
26             InLoopFilter="True"
27             MEPartitionLevel="EightByEight"
28             ReferenceFrames="4"
29             SearchRange="32"
30             AutoFit="True"
31             Force16Pixels="False"
32             FrameRate="0"
33             SeparateFilesPerStream="True"
34             SmoothStreaming="False"
35             NumberOfEncoderThreads="0">
36             <Streams
37               AutoSize="False"
38               FreezeSort="False">
39               <StreamInfo>
40                 <Bitrate>
41                   <ConstantBitrate
42                     Bitrate="4000"
43                     IsTwoPass="False"
44                     BufferWindow="00:00:04" />
45                 </Bitrate>
46               </StreamInfo>
47             </Streams>
48           </BaselineH264VideoProfile>
49         </VideoProfile>
50         <AudioProfile>
51           <AacAudioProfile
52             Level="AacLC"
53             Codec="AAC"
54             Channels="2"
55             BitsPerSample="16"
56             SamplesPerSecond="44100">
57             <Bitrate>
58               <ConstantBitrate
59                 Bitrate="160"
60                 IsTwoPass="False"
61                 BufferWindow="00:00:00" />
62             </Bitrate>
63           </AacAudioProfile>
64         </AudioProfile>
65       </MP4OutputFormat>
66     </OutputFormat>
67   </MediaFile>
68 </Preset>

You can quickly check whether it works for you by using the RunTask command line, part of the MediaServicesCommandLineTools project. The H264_BaselineProfile.xml is provided for reference in the etc folder of the project. You can tweak and Audio and Video bitrates at your will by editing the XML.

Disclosure: I am a real user, and this review is based on my own experience and opinions.

Add a Comment

Guest
Why do you like it?

Sign Up with Email