Partager via


A Change in the Default URL Type When Publishing a MP4 using Azure Management Portal

Starting in September 2014 Azure Media Services changed the default behavior for publishing Azure Media Services encoded MP4 files.  Previously after encoding a video with the Azure Media Encoder when you published 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.  Currently when you publish a single-file MP4 video asset the URL that is generated points to an Azure Media Services streaming endpoint.  This does not affect MP4 videos that are directly uploaded to Azure Media Services and published without being encoded by Azure Media Services.

A more detailed workflow on the previous behavior world be something like:

  1. Visit https://manage.windowsazure.com/ and go to Azure Media Services.
  2. Select the account you want to use and go to the CONTENT tab.
  3. Assuming you have a MP4 video asset already listed, you click on the PUBLISH button.
  4. You get a URL similar to https://<AccountName>.blob.core.windows.net/asset-12345678-9abc-def1-2345-6789abcdef12/video.mp4?st=2014-09-17T04%3A47%3A25Z&se=2015-09-17T04%3A47%3A25Z&sr=c&si=3456789a-bcde-f123-4567-89abcdef1234&sig=n0Yc1jQzRshaJbOhM2WhMgztKNZUvtyf03NGv6IAMslE%3D

Changed behavior

  1. Visit https://manage.windowsazure.com/ and go to Azure Media Services.
  2. Select the account you want to use and go to the CONTENT tab.
  3. Assuming you have a MP4 video asset already listed, you click on the PUBLISH button.
  4. You get a URL similar to https://<AccountName>.origin.mediaservices.windows.net/12345678-9abc-def1-2345-6789abcdef12/video.ism/Manifest

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.  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.  When you encode a video with the Azure Media Encoder a manifest is created.  If this manifest is present an origin URL will be created instead of a SAS URL.  MP4 videos that are uploaded and published without encoding on Azure Media Encoder will not have this manifest so a standard SAS URL is generated.  For more information on dynamic packaging see https://msdn.microsoft.com/library/azure/jj889436.aspx.

Workarounds
If you still wish to use a SAS URL for your single file Azure Media Services encoded MP4 asset then it is recommended that you use the Azure Media Services SDK to specifically set the locator to be a SAS URL.

See https://msdn.microsoft.com/en-us/library/azure/jj129575.aspx for more info on creating a SAS URL through code.

Additionally, you can use the Azure Media Services Explorer which you can get from https://github.com/Azure/Azure-Media-Services-Explorer/releases/latest to publish the URL.