<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>David Bristol's Media blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/randomnumber/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/randomnumber/feed.xml</link>
    <description>From Windows Media to IIS Media Services to Azure Media Services I&amp;#039;ll have tips and tricks for each of these.</description>
    <lastBuildDate>Tue, 16 Apr 2019 05:25:29 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Using AES with token authentication for Media Services</title>
      <link>https://docs.microsoft.com/archive/blogs/randomnumber/using-aes-with-token-authentication-for-media-services</link>
      <pubDate>Thu, 21 Sep 2017 19:46:44 GMT</pubDate>
      <dc:creator><![CDATA[David Bristol [msft]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/randomnumber/?p=376</guid>
      <description><![CDATA[This post is a step by step walkthrough of using the Azure Media Services Explorer...]]></description>
      <content:encoded><![CDATA[<h5>This post is a step by step walkthrough of using the Azure Media Services Explorer (<a href="http://aka.ms/amse">http://aka.ms/amse</a>) to apply AES encryption to a video asset.  I’ll describe the full process of applying envelope (AES) encryption and providing a JWT token with claims authentication.  Note that while this article specifically discusses AES, some of the same principles apply to other DRM like PlayReady, Widevine, and FairPlay as far as the token authentication goes.</h5>
Whenever you’re changing the format of video or encrypting it, the first thing you should understand is what clients support that video format or encryption type.  With the Azure Media Player we have a compatibility list available at <a href="http://amp.azure.net/libs/amp/latest/docs/index.html#compatibility-matrix">http://amp.azure.net/libs/amp/latest/docs/index.html#compatibility-matrix</a>.  This lists OS and browser combinations and what playback mechanism is supported with unencrypted, envelope (AES), and DRM (PlayReady/Widevine/FairPlay).  Since we’re focusing on AES here, the middle column of the compatibility matrix lists what the expected tech is and whether or not the OS/browser combination is supported.  For example, with the Edge / IE 11 browsers on Windows 10 the azureHtml5Js tech is used to play AES encrypted content.  You can find more about the techs at <a href="http://amp.azure.net/libs/amp/latest/docs/index.html#playback-technology-tech-">http://amp.azure.net/libs/amp/latest/docs/index.html#playback-technology-tech-</a>.  For modern OS’s and browsers AES is the lowest common denominator for encryption.  But keep in mind that iOS 6+ with Safari and Android 4.0 with Chrome 37+ doesn’t support token authentication without a token proxy.  We’ll have to go back to the player docs once we have the token so that you know how to pass the token to the Azure Media Player.
<div></div>
<div></div>
Now that we know what browsers are supported you’ll need to encrypt the asset.  I’m performing all of the media processing in Azure Media Services Explorer (<a href="http://aka.ms/amse">http://aka.ms/amse</a>).  First we’ll upload and encode an asset. I’m encoding the asset with Media Encoder Standard with the <em>Content Adaptive Multiple Bitrate MP4</em> encoding profile.  This allows us to stream the output.  To encrypt the asset with AES:
<ol>
 	<li>Right click on the output asset and choose <strong>Security / Add dynamic encryption and key delivery policies to the asset(s)…</strong></li>
 	<li>For <em>Protection</em> choose <strong>Envelope clear key</strong>.</li>
 	<li>For <em>Delivery</em> I recommend checking <strong>Enable dynamic encryption</strong> and checking all three delivery protocol boxes (<strong>HLS, DASH, Smooth Streaming</strong>).
<a href="https://msdnshared.blob.core.windows.net/media/2017/09/DRM1.jpg"><img width="322" height="350" class="alignnone size-full wp-image-386" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/09/DRM1.jpg" /></a></li>
 	<li>On the next dialog for <em>AES Key Generation</em> I recommend using <strong>Automatic generation (random content key)</strong>.</li>
 	<li>On the next dialog if you have an external key server, feel free to use it, but it’s easier to use Azure Media Services for this.</li>
 	<li>Next set the <em>Key Delivery From Azure Media Services</em> to <strong>Yes</strong> and use only one policy.  Since you’re using AMS for the license acquisition you don’t need the <strong>Key Acquisition URL</strong> set.</li>
 	<li>With AES on the next dialog you have two options for the <em>Content key’s authorization policy option</em>.  The <strong>Open</strong> option does not require any authentication.  If you don’t care who views the video, but just want to encrypt it then this is the option to choose.  If you want to authenticate viewers then choose <strong>Token</strong>. That’s what we will focus on here.</li>
 	<li>In this example for the <em>Token Type</em> we will choose <strong>JWT – JSON Web Token with symmetric key</strong>.</li>
 	<li>For <em>Token Properties</em> set the issuer and audience.  Typically for the <em>Issuer</em> it will be your company’s web site.  The <em>Audience or scope</em> will be a subset of who you want to have access to the video.  This allows you to specify different groups that can have access.  For example, if you wanted only the marketing team to have access you could set it to <strong>urn:marketing</strong> assuming you have a way of providing a token only for people from the marketing team.
<img width="331" height="349" class="alignnone size-full wp-image-395" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/09/DRM2.jpg" /></li>
 	<li>You can specify additional claims if you wish.</li>
</ol>
<div>You actually don’t have to have any claims in the token, but I’d recommend that you minimally set the Issuer field.  The audience or scope is just used to restrict the token to specific groups in an organization.  Another scenario would be authenticating multiple customers that used your service.  If their content was actually comingled in your Media Services account you could set a scope for Company A for one piece of content and the scope for Company B for another.  It all uses the same set of tokens, but restricts what it applies to.  Claims are best described on <a href="https://en.wikipedia.org/wiki/Claims-based_identity">https://en.wikipedia.org/wiki/Claims-based_identity</a>.  The claims in the token must match those configured for the key (or license).  In other words, what you set when you apply DRM to an asset must match what your token service includes with for the claim.  In a multiple company scenario where you are hosting content for two different client companies, what that would mean is that you’d set the issuer to be your company’s domain name.  For the audience you could use a value of your client's company name ‘Company A’.  Whenever you issue tokens for that company you’d need to include both your company’s domain name as the issuer and ‘Company A’ for the scope.  For ‘Company B’ you’d just set the scope on their content to ‘Company B’ and issue tokens for them.</div>
<div></div><div></div>
<div>In Azure Media Services Explorer, after going through the steps the encryption policies will be applied to the asset.  You will see in the Explorer status pane that several things are created including the content key ID and a sample Bearer token.  This bearer token can be use temporarily to test playback of the encrypted content.  You can also see this information and more by double clicking on the asset and going to the <em>Content keys</em> as well as <em>Delivery policies</em> tabs.  I’ve included an example bearer token here:</div>
<div></div>
<blockquote>
<pre><span style="color: #993300">eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cm46bWljcm9zb2Z0OmF6dXJlOm1lZGlhc2VydmljZXM6Y29udGVudGtleWlkZW50aWZpZXIiOiI5ODFkN2YzNC1iYmVhLTQ0MzgtYTVkMi1kZDkyNzQwYTYyYjciLCJpc3MiOiJodHRwOi8vZGJyaXN0b2wuY29udG9zby5jb20vIiwiYXVkIjoidXJuOmFsbGNvbXBhbnkiLCJleHAiOjE1MDQxMTYyMjZ9._WSfzDk5P23KjbAtJWdcEnr5L77t1OxkiIHbtYyjBRA</span></pre>
</blockquote>
<div></div>
On the <em>Content keys</em> tab you can get a new test token and specify the expiration and other options if you wish.  This process is of course manual and not helpful outside of testing.  For a full workflow you would  want to run your own token generation service as part of your website.  There’s a number of third party options for doing that.  I’d suggest just searching for options on that <a href="https://www.bing.com/search?q=jwt+token+service">https://www.bing.com/search?q=jwt+token+service</a>.  But essentially the idea is:
<ol>
 	<li>You validate that a user logged into your website has a valid account (simply by logging in).</li>
 	<li>You figure out what group / audience they’re part of if needed.</li>
 	<li>You build the token payload that includes the following fields:
a. urn:microsoft:azure:mediaservices:contentkeyidentifier – (Required) This identifies specific key to unlock. Without this value the service would not know what to issue a key for.
b. iss – (Optional) The issuer of the token.
c. aud – (Optional) The audience / scope that I explained before.
d. exp – (Optional) This is the JWT token expiration.  You should expire it, otherwise it could be reused by someone else.
e. nbf – (Optional) This is essentially a start time, or “not before” time.  Used along with exp this gives you a time range that the JWT token is valid.</li>
 	<li>When generating the signature you just need to sign it based on the symmetric key of the asset.  If you’re in Azure Media Services Explorer, this is on step 3 of adding dynamic encryption to the asset on the dialog where you’re setting the <em>Token Type</em>, but on the <em>Symmetric token key</em> tab.  Because you are signing your token based on this key you will need to keep this in your database.  In AMSE you can get the symmetric key after encryption by double clicking on the asset, going to Content keys, selecting the Token option and clicking on the <strong>See key</strong> value button next to <em>Primary Verification Key</em>.</li>
</ol>
<div>To give you an example of the token construction, paste in the example token from above into <a href="https://jwt.io/">https://jwt.io/</a>.  Paste in</div>
<blockquote>
<pre><span style="color: #993300">FoEn89xKyFYZaE8fwXL2CeMKodS+AdS6qsufwKn2pBJcG293EKJFCGThHXgWlEWrGXleMw9J4lz77fIQ9ACIvw==</span></pre>
</blockquote>
<div>(my symmetric key) for the <em>VERIFY SIGNATURE</em> box and check the secret <strong>base64 encoded box</strong>.  You can see the entire token now and verify that the signature is good.  Note that in a production environment you would not share your symmetric key with anyone.</div>
<div></div><div></div>
<div>Hopefully your JWT token service is now generating tokens that work with Azure Media Services.  The final thing to do is to include this token when you dynamically build your web page for the streaming content.  There is documentation on the Player page at <a href="http://amp.azure.net/libs/amp/latest/docs/index.html#protected-content">http://amp.azure.net/libs/amp/latest/docs/index.html#protected-content</a> that explains how to include your bearer token.</div>]]></content:encoded>
    </item>
    <item>
      <title>Azure Media Player support for audio-only and video-only streams</title>
      <link>https://docs.microsoft.com/archive/blogs/randomnumber/azure-media-player-support-for-audio-only-and-video-only-streams</link>
      <pubDate>Wed, 21 Jun 2017 15:24:30 GMT</pubDate>
      <dc:creator><![CDATA[David Bristol [msft]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/randomnumber/?p=345</guid>
      <description><![CDATA[Azure Media Player itself does not support audio-only or video-only streams as per the bottom of...]]></description>
      <content:encoded><![CDATA[Azure Media Player itself does not support audio-only or video-only streams as per the bottom of <a href="https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Famp.azure.net%2Flibs%2Famp%2Flatest%2Fdocs%2Ffeatures.html&amp;data=02%7C01%7Cdbristol%40exchange.microsoft.com%7C4f047531dbe346eb93ca08d4b8b1f0ec%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636336521769066564&amp;sdata=JMIp61ygqsi2hj1gLSy5EzuqNMlZwXs4HCUPLAIXEXw%3D&amp;reserved=0">http://amp.azure.net/libs/amp/latest/docs/features.html</a>.  This is due to issues with the AzureHtml5JS tech.  If you attempt to play a video-only asset in Azure Media Player you will see the error, "The video playback was aborted due to a corruption problem or because the video used features your browser did not support. (0x20400003)".

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/video-playback-error.png"><img width="661" height="101" class="alignnone size-full wp-image-346" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/06/video-playback-error.png" /></a>

At the JavaScript level you may see the error: MEDIA_ERR_SRC_NOT_SUPPORTED

There are a couple of ways to workaround this issue depending on what tool you're using to encode video.  The obvious one is to always make sure that you have assets that have both audio and video.  But sometimes this is impractical or doesn't meet your needs.  If you are using the Azure web portal http://portal.azure.com/, then use the <em>Adaptive Streaming</em> preset with Media Encoder Standard.

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/adaptive-streaming.png"><img width="181" height="129" class="alignnone size-full wp-image-355" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/06/adaptive-streaming.png" /></a>

This will do two things.  It will encode the video into a <a href="https://docs.microsoft.com/en-us/azure/media-services/media-services-autogen-bitrate-ladder-with-mes">bitrate ladder </a>and it will automatically insert silent audio into video-only sources or black video into audio-only sources.

If you are using the <a href="http://aka.ms/amse">Azure Media Services Explorer</a>, a really great tool by the way, you would right click on the asset, choose <strong>Encode asset(s) with Media Encoder Standard (MES)…</strong>  On the Preset tab, choose <em>Adaptive Streaming</em> profile.  That's all you need to do unless you want to use a specific encoding profile.  To do that, choose the profile you want to use and go to the <em>Advanced</em> tab and check the <strong>Insert a silent audio track when input has no audio option </strong>if your source asset has no audio or <strong>Insert black video when input has no video</strong> if your source asset has no video.

<a href="https://msdnshared.blob.core.windows.net/media/2017/06/insert-blank.png"><img width="453" height="350" class="alignnone size-full wp-image-365" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/06/insert-blank.png" /></a>

If you are using the Azure Media Services SDK and are defining your encoding profile with JSON or XML, you can use the parameters described on <a href="https://docs.microsoft.com/en-us/azure/media-services/media-services-advanced-encoding-with-mes">https://docs.microsoft.com/en-us/azure/media-services/media-services-advanced-encoding-with-mes</a> to insert what you need:

InsertSilenceIfNoAudio
InsertBlackIfNoVideoBottomLayerOnly
InsertBlackIfNoVideo]]></content:encoded>
    </item>
    <item>
      <title>Encoder changes within Azure Media Services now create ISMC file</title>
      <link>https://docs.microsoft.com/archive/blogs/randomnumber/encoder-changes-within-azure-media-services-now-create-ismc-file</link>
      <pubDate>Fri, 08 Jul 2016 20:50:03 GMT</pubDate>
      <dc:creator><![CDATA[David Bristol [msft]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/randomnumber/?p=325</guid>
      <description><![CDATA[Beginning in June 2016, when you encode videos with the Media Encoder Standard within Azure Media...]]></description>
      <content:encoded><![CDATA[Beginning in June 2016, when you encode videos with the Media Encoder Standard within Azure Media Services a new file is generated as part of your output video asset. The Media Encoder Standard will generate a .ismc file. This is a client manifest that is traditionally used in Smooth Streaming, but is also used to improve performance on the Azure Media Services origin.

For most customers this will not impact their workflow at all. However, if you are expecting only certain file types to be listed in your assets after the encode is complete you may experience problems with your code. For example, if you use a LINQ query to get certain files from the IAssetFiles collection like this:

     <code>IAsset.AssetFiles.FirstOrDefault();</code>

You may not get the file you expected because that could now be the .ismc file. If you need to locate a specific file type, the streaming manifest in this example, you can use a LINQ query similar to:

     <code>var assetFiles = outputAsset.AssetFiles.ToList();</code>
     <code>var manifest = assetFiles.Where(f =&gt; f.Name.ToLower().EndsWith(".ism")).FirstOrDefault();</code>

Further, you should not write code that assumes an order to files within an Asset, nor about the contents of the streaming manifest (*.ism/*.ismc) files, as both are subject to change without prior notice as the service evolves.]]></content:encoded>
    </item>
    <item>
      <title>Progressive download and streaming differences with Azure Media Services</title>
      <link>https://docs.microsoft.com/archive/blogs/randomnumber/progressive-download-and-streaming-differences-with-azure-media-services</link>
      <pubDate>Wed, 23 Mar 2016 20:07:33 GMT</pubDate>
      <dc:creator><![CDATA[David Bristol [msft]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/randomnumber/?p=323</guid>
      <description><![CDATA[&lt;note: I plan on occasionally editing this page with updated information. I may not document the...]]></description>
      <content:encoded><![CDATA[&lt;note: I plan on occasionally editing this page with updated information. I may not document the changes made as they happen.&gt;

Azure Media Services gives you two different ways of delivering video content.  You can either progressively download content from Azure Storage or stream the content from Azure Media Services.  This article discusses these two options with the pros and cons of each. The tl;dr is that progressive download is more simple, but streaming provides a better client playback experience.

<strong>Progressive Download</strong>
The term 'progressive download' is more commonly used when comparing it as a delivery mechanism for video versus streaming.  At first glance, progressive download is really simple. It is essentially just downloading a file from a web server over HTTP. There is a little more to it than that, but that’s the core of it. This method supports any file type and codec since the web server doesn’t really care about any of that. With Azure, blob storage acts as the web server that you access through a SAS (Shared Access Signature) URL. Azure Media Services allows you to create container based SAS URLs when you publish locators. These URLs look like http://&lt;accountname&gt;.blob.core.windows.net/asset-5310435d-1500-80c6-743b-f1e515255692/video.mp4?sv=2012-02-12&amp;sr=c&amp;si=2ef045bc-bd32-46e0-9ece-01cb8ea1d414&amp;sig=W95c%2Fc%2FGi0cmikscbkI27jDt%2FTXHpkVm0Z1MJsUJzDA%3D&amp;se=2115-08-12T19%3A21%3A27Z. There are a couple of things that make it obvious that this is a SAS URL. First is that the domain name contains blob.core.windows.net. The ‘blob’ part of this is blob storage. Second is the inclusion of the query string at the end that contains the ‘sv’, ‘sr’, etc. parameters that describe things like the expiration of the URL and signatures.

As I mentioned before, progressive download supports any video file type. There are a ton of different formats out there that you to can choose from. But keep in mind that whatever player you are using to point to the SAS URL must be able to play the file. Since it currently has the widest possible adoption I’d recommend creating a MP4 file that uses the H.264 video codec and the AAC audio codec. Another advantage to this format is that it works with the HTML5 &lt;video&gt; tag. There are two main disadvantages that I see with using progressive download. They are that with progressive download whatever bitrate you have chosen to encode the video is the only bitrate it can be played. So if you encode at 1 Mbps, then a client must maintain that speed to play the video. If the video is only a few seconds long that may not be a problem, but if it is an hour the client could experience a lot of buffering/playing/buffering/playing/buffering if it was connected to the Internet on a 900 Kbps connection.  If you choose a low bitrate for your video then you are sacrificing quality for the lowest common denominator of internet bandwidth. Second is that the player you are targeting may not be available on all platforms. For example, if you use the HTML5 &lt;video&gt; tag, that is not available on machines that have older browsers.

These are some fairly technical details about progressive download / Azure Storage that most people don't need to know:
<ul>
	<li>Not all clients / web servers are able to seek within the video.  Some may have to wait until the video is fully downloaded before they seek.  To support the seeking of video with progressive download both the client and server must support byte range offsets.  This is using the HTTP 'Accept-Ranges' server response and the client's 'Content-Range' request as per <a href="https://tools.ietf.org/html/rfc2616">RFC 2616</a>.</li>
	<li>Azure Media Services creates SAS URLs for links to blob storage as container based URLs, not blob URLs directly.  You can certainly link to a blob within the container though using the base URL of the container + the blob file name.</li>
	<li>Azure Media Services uses a signed identifier, the 'si' value, as the container policy ID so that the SAS URL can be revoked.</li>
	<li>There is a Storage limit of 5 policies per container.  This is why Azure Media Services is limited to 5 SAS URLs.</li>
	<li>The video that was progressively downloaded will be stored in client's browser cache (assuming it will fit).</li>
	<li>If you want to use a CDN for distributing SAS URL based videos you setup the CDN on the Blob Storage account.</li>
</ul>
&nbsp;

<strong>Streaming</strong>
There are a couple of different ways of doing streaming, but I will focus on <a title="Adaptive bitrate streaming" href="https://en.wikipedia.org/wiki/Adaptive_bitrate_streaming">adaptive streaming</a> here since that is what Azure Media Services uses with the different protocols it has available. Adaptive streaming is a bit more complex to setup but generally allows for a better client playback experience. This is because you typically encode the video in a way such that you have multiple different bitrates to choose from. You may have bitrates as low as 300 Kbps and all of the way up to 3.5 Mbps (this is customizable) with a number of bitrates between those. Clients can then choose the most appropriate bitrate as they are streaming. The way this works is that the client downloads the lowest bitrate first chunk of video. This chunk of video is 2 – 10 seconds long. The client determines the bandwidth between the client and the Azure Media Services origin based on that first chunk and then adjusts the bandwidth accordingly. If it is determined that the client has quite a bit of bandwidth then the bitrate is increased. If over time the client bandwidth degrades then the client can lower the bitrate that it requests from the origin. One side effect of this is that there is essentially no initial buffering necessary, so playback begins almost instantly. Technically there is buffering, but it is only the time it takes to buffer the initial chunk. An example streaming URL is http://&lt;accountname&gt;.streaming.mediaservices.windows.net/e8927280-0d3b-4c19-8eb0-4c56cb0bf1f0/video.ism/Manifest. You can tell it is streaming from Azure Media Services since the domain name contains the streaming.mediaservices.windows.net as well as the file name ends with .ism with the /manifest REST parameter.

Azure Media Services is capable of streaming Smooth Streaming to Silverlight and Flash clients, HLS to iOS clients, and MPEG-DASH to browsers that support Media Source Extensions. Streaming with MPEG-DASH allows clients to avoid using browser plugins like Flash or Silverlight to play content. To create content that is streamable from Azure Media Services you can create content in two different ways. You can either encode it to the target format, such as an ISMV for Smooth Streaming, or encode into an adaptive bitrate MP4 set. If you choose to target one protocol, like Smooth Streaming, then the video can only stream with that protocol. However, if you use the adaptive bitrate MP4 set the Azure Media Services origin can transmux the file on the fly to any of the protocols that the service supports. This way you only have one asset. The way you reference the different protocols is by adding a parameter on the manifest request. To get HLS, instead of the above URL for the manifest, you would use http://.streaming.mediaservices.windows.net/e8927280-0d3b-4c19-8eb0-4c56cb0bf1f0/video.ism/Manifest(format=m3u8-aapl). And to get MPEG-DASH you would use (format=mpd-time-csf).  This is discussed in more depth in the <a title="Dynamic Packaging overview" href="http://msdn.microsoft.com/en-us/library/windowsazure/jj889436.aspx">Dynamic Packaging overview</a>.

With Azure Media Services you have a couple of different playback options.  You can use the HTML5 &lt;video&gt; tag with dash.js, or Silverlight to play Smooth Streaming directly, or a number of other options.  But one of the easiest things to use is the Azure Media Player.  There's an example page at <a title="http://ampdemo.azureedge.net" href="http://ampdemo.azureedge.net">http://ampdemo.azureedge.net</a> that lets you paste in your streaming locator and uses a collection of players (HTML5 MSE, HTML5, Flash, and Silverlight) to find the best playback option automatically for the client you're playing the video on.  The <a title="Azure Media Player documentation" href="https://aka.ms/ampdocs">player documentation</a> explains how to embed the player in your own web page.

These are some fairly technical details about streaming from Azure Media Services that most people don't need to know:
<ul>
	<li>Video chunks, or sometimes called fragments, are sized to be the same as the GOP (Group of Pictures).</li>
	<li>When clients request video fragments the client makes a REST call for that specific fragment.  This includes details about the timestamp of the fragment as well as the bitrate.</li>
	<li>Because REST calls are used for fragments the response is easily cached on proxies or CDNs.</li>
	<li>Live streaming uses the same REST format as on demand streaming.</li>
	<li>To use dynamic packaging you must use at least one streaming unit on your Azure Media Services origin.</li>
	<li>If you want to use a CDN for distributing streaming URL based videos you setup the CDN on the Azure Media Services streaming endpoint.</li>
</ul>]]></content:encoded>
    </item>
    <item>
      <title>Listing more than 1000 assets with the PHP SDK for Azure Media Services</title>
      <link>https://docs.microsoft.com/archive/blogs/randomnumber/listing-more-than-1000-assets-with-the-php-sdk-for-azure-media-services</link>
      <pubDate>Thu, 05 Nov 2015 07:05:00 GMT</pubDate>
      <dc:creator><![CDATA[David Bristol [msft]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/randomnumber/2015/11/05/listing-more-than-1000-assets-with-the-php-sdk-for-azure-media-services/</guid>
      <description><![CDATA[To get the list of assets from Azure Media Services in the PHP SDK you use the getAssetList()...]]></description>
      <content:encoded><![CDATA[<div>To get the list of assets from Azure Media Services in the PHP SDK you use the getAssetList() function to get a list of video assets.&nbsp; If you have more than 1000 assets the getAssetList() function will only return the first 1000.&nbsp; Azure Media Services limits the number of results returned for performance reasons.&nbsp; The way to get the full list is to page through the list 1000 assets at a time.&nbsp; The .NET SDK has this ability built in, but unfortunately the PHP SDK does not.&nbsp; We can add a new function in the REST proxy to do this.</div>
<div>The&nbsp;getAssetList() call is fed through the REST proxy.&nbsp; To make this work we have to add a new function to the REST proxy that specifically handles this.&nbsp; This is modeled on the getAssetList function.&nbsp; This is in MediaServicesRestProxy.php.&nbsp;</div>
<div style="padding-left: 30px;"><span style="font-family: courier new,courier;">/**</span><br /><span style="font-family: courier new,courier;">&nbsp;* Get paged asset list starting at skip value</span><br /><span style="font-family: courier new,courier;">&nbsp;*</span><br /><span style="font-family: courier new,courier;">&nbsp;* @return array of Models\Asset</span><br /><span style="font-family: courier new,courier;">&nbsp;*/</span><br /><span style="font-family: courier new,courier;">public function getAssetListPage($skipStart)</span><br /><span style="font-family: courier new,courier;">{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; $propertyList = $this-&gt;_getEntityList("Assets()?".'$skip='.$skipStart);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; $result&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = array();</span><br />&nbsp;<br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; foreach ($propertyList as $properties) {</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $result[] = Asset::createFromOptions($properties);</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; }</span><br />&nbsp;<br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; return $result;</span><br /><span style="font-family: courier new,courier;">}</span></div>
<div style="padding-left: 30px;">&nbsp;</div>
<div>When calling the getAssetListPage function, use an index value for the next 1000 similar to getAssetListPage(1000).</div>
<div>I'd like to thank Dhanendran Rajagopal for help with the code.</div>]]></content:encoded>
    </item>
    <item>
      <title>500 error when streaming adaptive bitrate MP4 set content from Azure Media Services</title>
      <link>https://docs.microsoft.com/archive/blogs/randomnumber/500-error-when-streaming-adaptive-bitrate-mp4-set-content-from-azure-media-services</link>
      <pubDate>Wed, 10 Jun 2015 11:40:00 GMT</pubDate>
      <dc:creator><![CDATA[David Bristol [msft]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/randomnumber/2015/06/10/500-error-when-streaming-adaptive-bitrate-mp4-set-content-from-azure-media-services/</guid>
      <description><![CDATA[If you are using Azure Media Services to deliver video content and encoded your video with one of...]]></description>
      <content:encoded><![CDATA[<p>If you are using Azure Media Services to deliver video content and encoded your video with one of the Adaptive Bitrate MP4 Set profiles you may see one of the following errors.</p>
<p>In the web portal:</p>
<p style="padding-left: 30px;"><em>We are unable to connect to the content you've requested.&nbsp; We apologize for the inconvenience.</em><br /><em>A network error caused the video download to fail part-way.&nbsp; ExtendedMessage: An error has occurred while downloading the manifest.</em></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/46/0525.playererror.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-46/0525.playererror.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/46/0525.playererror.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-46/0525.playererror.png" alt="" width="442" height="404" border="0" /></a>&nbsp;</p>
<p>If you try browsing to the manifest directly or you use a network trace tool to monitor the manifest request you see the error:</p>
<p style="padding-left: 30px;"><em>500 - Internal server error.</em><br /><em>There is a problem with the resource you are looking for, and it cannot be displayed.</em></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/46/0552.500servererror.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-46/0552.500servererror.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/46/0552.500servererror.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-46/0552.500servererror.png" alt="" width="480" height="101" border="0" /></a></p>
<p>When you see these errors the most likely cause is that you do not have a <strong>Streaming Unit</strong> for the dynamically packaged video content.</p>
<p>Dynamic Packaging is a technology that Azure Media Services uses that allows you to create a single video asset and have that asset streamed over the&nbsp;Smooth Streaming, HLS, and MPEG-DASH protocols.&nbsp; In the past when you created a video asset you could only stream that video asset using the protocol specific to the format that it was encoded as.&nbsp; For example, if you encoded&nbsp;an asset as Smooth Streaming you would get a group of ISMV video files&nbsp;that made up that asset.&nbsp; The server would only be able to deliver those videos over the Smooth Streaming protocol.&nbsp; If you wanted to stream over HLS or another protocol you had to encode another video asset with the MPEG-2 TS files that HLS used to stream over that protocol.&nbsp; Dynamic Packaging allows you to create a single Adaptive Bitrate MP4 set and from that one asset deliver content over a number of different protocols.&nbsp; With Azure Media Services this repackaging is done at browse time for each client.&nbsp; Because this takes extra work,<span style="background-color: #ffff00;"> a Streaming Unit is required to use this feature</span>.&nbsp; For an overview of how to use Dynamic Packaging, see <a href="https://azure.microsoft.com/en-us/documentation/articles/media-services-dynamic-packaging-overview/">https://azure.microsoft.com/en-us/documentation/articles/media-services-dynamic-packaging-overview/</a>.</p>
<p>Use the follow steps to&nbsp;enable a Streaming Unit:</p>
<ol>
<li>Open the web portal for Azure Media Services and got to the STREAMING ENDPOINTS tab.&nbsp; If you have at least one Streaming Unit then the issue you are seeing is not related to this article.<br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/46/5327.endpoints.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-46/5327.endpoints.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/46/5327.endpoints.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-46/5327.endpoints.png" alt="" border="0" /></a></li>
<li>Click the arrow beside&nbsp;'default'&nbsp;to open your streaming endpoint.</li>
<li>Move the STREAMING UNITS slider to the right so that you have at least one streaming unit.&nbsp; Note: this will have a pricing impact on your account.&nbsp; Please review <a href="https://go.microsoft.com/fwLink/?LinkID=309724&amp;clcid=0x409">https://go.microsoft.com/fwLink/?LinkID=309724&amp;clcid=0x409</a> for the cost of streaming units.&nbsp; Save the changes.<br /><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/46/5734.scale.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-46/5734.scale.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/46/5734.scale.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-46/5734.scale.png" alt="" width="477" height="155" border="0" /></a></li>
</ol>
<p>It will take a few minutes for the Streaming Unit to be active.&nbsp; Once it is active you should no longer see the playback error.</p>]]></content:encoded>
    </item>
    <item>
      <title>Additional steps needed to enable multicast logging for Windows Media Services 2008 R2</title>
      <link>https://docs.microsoft.com/archive/blogs/randomnumber/additional-steps-needed-to-enable-multicast-logging-for-windows-media-services-2008-r2</link>
      <pubDate>Tue, 21 Oct 2014 11:44:00 GMT</pubDate>
      <dc:creator><![CDATA[David Bristol [msft]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/randomnumber/2014/10/21/additional-steps-needed-to-enable-multicast-logging-for-windows-media-services-2008-r2/</guid>
      <description><![CDATA[Multicast logging can be useful when you want to collect statistical information about the client...]]></description>
      <content:encoded><![CDATA[<p>Multicast logging can be useful when you want to collect statistical information about the client viewing experience of a live Windows Media Services multicast stream.&nbsp; The steps on <a title="Install and configure Logging Agent" href="http://technet.microsoft.com/en-us/library/cc771331.aspx">Install and configure Logging Agent</a> outline how to set this up, but you may need to do some additional steps to get the logging working.</p>
<p>On step 4 of the installation guide it mentions enabling execute permissions on the virtual root.&nbsp; To do this:</p>
<ol>
<li>Open the <strong>Handler Mappings</strong> module on the virtual directory.&nbsp;</li>
<li>Select the ISAPI-dll mapping and choose <strong>Edit Feature Permissions...</strong></li>
<li>Check the <strong>Execute</strong> box and choose OK.</li>
<li>Additionally, with the ISAPI-dll still highlighted, choose <strong>Edit...</strong></li>
<li>For the executable, point to the path of the wmsiislog.dll and choose OK.</li>
</ol>
<p>At this point if you make a test the path to the DLL by opening a browser and requesting <strong>http://</strong><em><a>web_server_name</a></em><strong>/</strong><em>virtual_directory_name</em><strong>/wmsiislog.dll</strong>you should get a response of:</p>
<h1>WMS ISAPI Log Dll/9.6.7600.16564</h1>
<p>This will confirm that the dll is executing correctly.&nbsp; Create a multicast and ensure that you are getting log files in the %<em>windir%\System32\LogFiles\WMS_ISAPI</em> folder.&nbsp; If no files are present after playing several multicast streams you may need to change the permissions on this folder.&nbsp; The To do this:</p>
<ol>
<li>Right click on the <em>WMS_ISAPI</em> folder and go to <strong>Properties</strong> / <strong>Security</strong>.&nbsp;</li>
<li>Click on <strong>Advanced</strong>.&nbsp; Go to the <strong>Owner</strong> tab.&nbsp; Click <strong>Edit</strong>...</li>
<li>Select the administrative account you are logged in as to be the owner.&nbsp; Click several OK several times until you are back to the <strong>Security</strong> tab.</li>
<li>Click on <strong>Advanced</strong> once again.&nbsp; On the <em>Advanced Security Settings for WMS_ISAPI</em> dialog click <strong>Change Permissions...&nbsp;</strong></li>
<li>Check the box for <strong>Replace all child object permissions...</strong> and click on <strong>Add...</strong></li>
<li>For the account name use the <em>&lt;machine name&gt;\IUSR </em>and click OK.</li>
<li>For the permissions choose everything except for <em>Full control</em> and <em>Change permissions</em>.</li>
<li>Click OK until all dialogs are closed.&nbsp;</li>
</ol>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/46/0451.permissions.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-46/0451.permissions.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/46/0451.permissions.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-46/0451.permissions.png" alt="" width="458" height="343" border="0" /></a></p>
<p>Keep in mind that if the log file is listed as 0 bytes initially it is because the ISAPI dll will buffer writing to the file.&nbsp; Wait a few minutes and you should see the contents of the log.</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Unable to delete an Azure Media Services live streaming channel</title>
      <link>https://docs.microsoft.com/archive/blogs/randomnumber/unable-to-delete-an-azure-media-services-live-streaming-channel</link>
      <pubDate>Mon, 06 Oct 2014 08:22:00 GMT</pubDate>
      <dc:creator><![CDATA[David Bristol [msft]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/randomnumber/2014/10/06/unable-to-delete-an-azure-media-services-live-streaming-channel/</guid>
      <description><![CDATA[When you use Azure Media Services to create a live streaming channel, a program is also created. A...]]></description>
      <content:encoded><![CDATA[<p>When you use Azure Media Services to create a live streaming channel, a program is also created. A program allows you to control how the channel is published and archived&nbsp;/ DVR'd.&nbsp; When you want to delete an unused program, you may see the error, "<em>No programs could be found that match the filters you provided</em>."</p>
<p>If you truly&nbsp;have no programs when you go into the <strong>PROGRAMS</strong> section you should a message saying, &ldquo;<em>You have no programs</em>.&rdquo;</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/46/5165.no%20programs.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-46/5165.no-programs.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/46/5165.no%20programs.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-46/5165.no-programs.png" alt="" border="0" /></a></p>
<p>However, if you have programs but they are not listed then you get the message, &ldquo;<em>No programs could be found that match the filters you provided</em>.&rdquo;&nbsp; By default the when you open the <strong>PROGRAMS</strong> list it will only list programs that were created in the last 24 hours.</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/46/6886.missing%20programs.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-46/6886.missing-programs.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/46/6886.missing%20programs.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-46/6886.missing-programs.png" alt="" border="0" /></a></p>
<p>If you change the query time to include a bit more time, or at least as long as you think you may have had the program round you will find the program(s).</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/46/5516.found%20programs.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-46/5516.found-programs.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/99/46/5516.found%20programs.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-99-46/5516.found-programs.png" alt="" border="0" /></a></p>
<p>Now that you can see all of the programs, you can delete them so that you can delete the channel.</p>]]></content:encoded>
    </item>
    <item>
      <title>A Change in the Default URL Type When Publishing a MP4 using Azure Management Portal</title>
      <link>https://docs.microsoft.com/archive/blogs/randomnumber/a-change-in-the-default-url-type-when-publishing-a-mp4-using-azure-management-portal</link>
      <pubDate>Thu, 18 Sep 2014 07:57:00 GMT</pubDate>
      <dc:creator><![CDATA[David Bristol [msft]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/randomnumber/2014/09/18/a-change-in-the-default-url-type-when-publishing-a-mp4-using-azure-management-portal/</guid>
      <description><![CDATA[Starting in September 2014 Azure Media Services changed the default behavior for publishing Azure...]]></description>
      <content:encoded><![CDATA[<p>Starting in September 2014 Azure Media Services changed the default behavior for publishing Azure Media&nbsp;Services encoded&nbsp;MP4 files.&nbsp; Previously after encoding a video with the Azure Media Encoder when you published&nbsp;a single-file MP4 video asset a SAS (Shared Access Signature) URL would be created that allows you to download the video from blob storage.&nbsp; Currently when you publish a single-file MP4 video asset the URL that is generated points to an Azure Media Services streaming endpoint.&nbsp; This does not affect MP4 videos that are directly uploaded to Azure Media Services and published without being encoded by Azure Media Services.</p>
<p><br />A more detailed workflow on the previous behavior world be something like:</p>
<ol>
<li>Visit <a href="https://manage.windowsazure.com/">https://manage.windowsazure.com/</a> and go to Azure Media Services.</li>
<li>Select the account you want to use and go to the CONTENT tab.</li>
<li>Assuming you have a MP4 video asset already listed, you click on the PUBLISH button.</li>
<li>You get a URL similar to <strong>https://&lt;AccountName&gt;.blob.core.windows.net/asset-12345678-9abc-def1-2345-6789abcdef12/video.mp4?st=2014-09-17T04%3A47%3A25Z&amp;se=2015-09-17T04%3A47%3A25Z&amp;sr=c&amp;si=3456789a-bcde-f123-4567-89abcdef1234&amp;sig=n0Yc1jQzRshaJbOhM2WhMgztKNZUvtyf03NGv6IAMslE%3D</strong></li>
</ol>
<p><br /><strong>Changed behavior</strong></p>
<ol>
<li>Visit <a href="https://manage.windowsazure.com/">https://manage.windowsazure.com/</a> and go to Azure Media Services.</li>
<li>Select the account you want to use and go to the CONTENT tab.</li>
<li>Assuming you have a MP4 video asset already listed, you click on the PUBLISH button.</li>
<li>You get a URL similar to <strong>http://&lt;AccountName&gt;.origin.mediaservices.windows.net/12345678-9abc-def1-2345-6789abcdef12/video.ism/Manifest</strong></li>
</ol>
<p><br />The reason for this change is that it is possible to stream the single MP4 video asset as a dynamically packaged video using the HLS, Smooth Streaming, and MPEG-DASH formats.&nbsp; Typically this type of streaming is done with multiple MP4 files that are encoded at different bitrates for the video asset, but it is possible to use only a single bitrate.&nbsp; When you encode a video with the Azure Media Encoder a manifest is created.&nbsp; If this manifest is present&nbsp;an origin URL will be created instead of a SAS URL.&nbsp;&nbsp;MP4 videos that are uploaded&nbsp;and published&nbsp;without encoding on Azure Media Encoder will not have this manifest so a standard SAS URL is generated.&nbsp; For more information on dynamic packaging see <a href="http://msdn.microsoft.com/library/azure/jj889436.aspx">http://msdn.microsoft.com/library/azure/jj889436.aspx</a>.</p>
<p><strong>Workarounds</strong><br />If you still wish to use a SAS URL for your single file Azure Media&nbsp;Services encoded&nbsp;MP4 asset then it is recommended that you use the Azure Media Services SDK to specifically set the locator to be a SAS URL.</p>
<p>See <a href="http://msdn.microsoft.com/en-us/library/azure/jj129575.aspx">http://msdn.microsoft.com/en-us/library/azure/jj129575.aspx</a> for more info on creating a SAS URL through code.</p>
<p>Additionally, you can use the Azure Media Services Explorer which you can get from <a href="https://github.com/Azure/Azure-Media-Services-Explorer/releases/latest">https://github.com/Azure/Azure-Media-Services-Explorer/releases/latest</a>&nbsp;to publish the URL.</p>]]></content:encoded>
    </item>
    <item>
      <title>Job record limit for Windows Azure Media Encoder</title>
      <link>https://docs.microsoft.com/archive/blogs/randomnumber/job-record-limit-for-windows-azure-media-encoder</link>
      <pubDate>Mon, 05 May 2014 08:12:00 GMT</pubDate>
      <dc:creator><![CDATA[David Bristol [msft]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/randomnumber/2014/05/05/job-record-limit-for-windows-azure-media-encoder/</guid>
      <description><![CDATA[Job record limit for Windows Azure Media Encoder
After processing a large number of videos with the...]]></description>
      <content:encoded><![CDATA[<h1><span style="color: #2e74b5;"><span style="font-family: Calibri Light;">Job record limit for Windows Azure Media Encoder</span></span></h1>
<p><span style="font-size: small;"><span style="font-family: Calibri;">After processing a large number of videos with the Windows Azure Media Encoder you may see an error in the portal that says, "This account has reached the limit of 50,000 jobs."&nbsp; You see this error when you try to submit a new job.&nbsp; If you are using the REST API or the .Net SDK you see a return of ServiceUnavailable when submitting a job.&nbsp; </span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">There is a record limit of 50,000 jobs within Windows Azure Media Encoder.&nbsp; You must delete historic job records occasionally to clear up space for new job records.&nbsp; </span></span></p>
<h1><span style="color: #2e74b5;"><span style="font-family: Calibri Light;">Sample Code to Delete Finished Jobs</span></span></h1>
<p><span style="font-family: Calibri; font-size: small;">This C# command line sample code will delete all finished jobs from a single Media Services account.&nbsp; The only parameters that you have to pass are the Media Services account name and key.&nbsp; The sample only deletes jobs that finished (</span>JobState.Finished<span style="font-family: Calibri; font-size: small;">).&nbsp; If you wish to delete cancelled jobs or jobs that ended with an error, use </span>JobState.Canceled <span style="font-family: Calibri; font-size: small;">or </span>JobState.Error <span style="font-size: small;"><span style="font-family: Calibri;">respectively for the job state.</span></span></p>
<p><span style="color: #0000ff;">using</span> System;<br /><span style="color: #0000ff;">using</span> System.Text;<br /><span style="color: #0000ff;">using</span> Microsoft.WindowsAzure.MediaServices.Client;&nbsp;</p>
<p><span style="color: #0000ff;">namespace</span> DeleteJobs<br />{<br />&nbsp;&nbsp;&nbsp; <span style="color: #0000ff;">class</span> <span style="color: #008080;">Program</span><br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #0000ff;">private static</span> <span style="color: #008080;">CloudMediaContext</span> _context = <span style="color: #0000ff;">null</span>;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #0000ff;">static void</span> Main(<span style="color: #0000ff;">string</span>[] args)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #0000ff;">if</span> (args.Length != 2)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DisplayUsage();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #0000ff;">return</span>;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #008080;">Console</span>.Clear();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #008080;">Console</span>.WriteLine("Are you sure you want to delete ALL finished jobs?");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #008080;">Console</span>.WriteLine("Y/N");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #0000ff;">if</span> (!(<span style="color: #008080;">Console</span>.ReadKey().Key == <span style="color: #008080;">ConsoleKey</span>.Y))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #0000ff;">return</span>;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #0000ff;">string</span> accountName = args[0].ToString();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #0000ff;">string</span> accountKey = args[1].ToString();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _context = <span style="color: #0000ff;">new</span> <span style="color: #008080;">CloudMediaContext</span>(accountName, accountKey);&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #0000ff;">foreach</span> (<span style="color: #008080;">IJob</span> job <span style="color: #0000ff;">in</span> _context.Jobs)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #0000ff;">if</span> (job.State == <span style="color: #008080;">JobState</span>.Finished)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #008080;">Console</span>.WriteLine("Deleting job {0}", job.Id);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; job.Delete();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #0000ff;">static void</span> DisplayUsage()<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #008080;">Console</span>.Out.WriteLine("\nDeleteFinishedJobs.exe will delete all finished jobs.&nbsp; There is a limit of");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #008080;">Console</span>.Out.WriteLine("50,000 jobs that are allowed to remain in a single Media Services account.");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #008080;">Console</span>.Out.WriteLine("Jobs that are processing, queued, or errored out are not deleted.");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #008080;">Console</span>.Out.WriteLine("\nUsage:");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #008080;">Console</span>.Out.WriteLine("DeleteFinishedJobs.exe &lt;account name&gt; &lt;account key&gt;");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #008080;">Console</span>.Out.WriteLine("\n\nExample:\nDeleteJobs.exe testAcct AbCdEfGhIjKlMnOpQrStUvWxYz1234567890=");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; }<br />}<span style="font-family: Calibri; font-size: small;">&nbsp;</span></p>
<p>&nbsp;</p>
<p><span style="font-family: Calibri; font-size: small;">For more information on the quotas and limitations of Windows Azure Media Services see <a href="http://msdn.microsoft.com/en-us/library/jj945161.aspx">http://msdn.microsoft.com/en-us/library/jj945161.aspx</a>.</span></p>]]></content:encoded>
    </item>
  </channel>
</rss>