在 Azure 门户中发布内容Publish content in the Azure portal

概述Overview

Note

要完成本教程,需要一个 Azure 帐户。To complete this tutorial, you need an Azure account. 有关详细信息,请参阅 Azure 试用For details, see Azure Trial.

若要为用户提供一个可用来流式传输内容或下载内容的 URL,首先必须通过创建定位符来发布资产。To provide your user with a URL that they can use to stream or download your content, first you must publish your asset by creating a locator. 通过定位符,可访问资产文件。Locators provide access to asset files. Azure 媒体服务支持两种类型的定位符:Azure Media Services supports two types of locators:

  • 流式处理 (OnDemandOrigin) 定位符Streaming (OnDemandOrigin) locators. 流式处理定位符用于自适应流式处理。Streaming locators are used for adaptive streaming. 自适应流式处理的示例包括 Apple HTTP Live Streaming (HLS)、Microsoft 平滑流式处理,以及经 HTTP 的动态自适应流式处理(DASH,也称 MPEG-DASH)。Examples of adaptive streaming include Apple HTTP Live Streaming (HLS), Microsoft Smooth Streaming, and Dynamic Adaptive Streaming over HTTP (DASH, also called MPEG-DASH). 要创建流式处理定位符,资产必须包括一个 .ism 文件。To create a streaming locator, your asset must include an .ism file. 例如, http://amstest.streaming.mediaservices.chinacloudapi.cn/61b3da1d-96c7-489e-bd21-c5f8a7494b03/scott.ism/manifestFor example, http://amstest.streaming.mediaservices.chinacloudapi.cn/61b3da1d-96c7-489e-bd21-c5f8a7494b03/scott.ism/manifest.
  • 渐进式(共享访问签名)定位符Progressive (shared access signature) locators. 渐进式定位符用于通过渐进式下载来传输视频。Progressive locators are used to deliver video via progressive download.

要生成 HLS 流 URL,请将 (format=m3u8-aapl) 附加到 URL: To build an HLS streaming URL, append (format=m3u8-aapl) to the URL:

{streaming endpoint name-media services account name}/{locator ID}/{file name}.ism/Manifest(format=m3u8-aapl)

要生成流式处理 URL 来播放平滑流资产,请使用以下 URL 格式:To build a streaming URL to play Smooth Streaming assets, use the following URL format:

{streaming endpoint name-media services account name}/{locator ID}/{file name}.ism/Manifest

要生成 MPEG DASH 流式处理 URL,请将 (format=mpd-time-csf) 附加到 URL: To build an MPEG-DASH streaming URL, append (format=mpd-time-csf) to the URL:

{streaming endpoint name-media services account name}/{locator ID}/{file name}.ism/Manifest(format=mpd-time-csf)

共享访问签名 URL 格式如下:A shared access signature URL has the following format:

{blob container name}/{asset name}/{file name}/{shared access signature}

有关详细信息,请参阅传送内容概述For more information, see the delivering content overview.

Note

2015 年 3 月之前在 Azure 门户中创建的定位符的过期日期为两年后。Locators that were created in the Azure portal before March 2015 have a two-year expiration date.

可以使用 REST API.NET API 来更新定位符的过期日期。To update an expiration date on a locator, use can use a REST API or a .NET API.

Note

更新共享访问签名定位符的过期日期时,URL 会发生变化。When you update the expiration date of a shared access signature locator, the URL changes.

使用门户发布资产To use the portal to publish an asset

  1. Azure 门户中,选择 Azure 媒体服务帐户。In the Azure portal, select your Azure Media Services account.

  2. 选择“设置” > “资产” 。Select Settings > Assets. 选择想要发布的资产。Select the asset that you want to publish.

  3. 选择“发布”按钮 。Select the Publish button.

  4. 选择定位符类型。Select the locator type.

  5. 选择 添加Select Add.

    发布视频

URL 将添加到“已发布 URL” 列表。The URL is added to the list of Published URLs.

在门户中播放内容Play content in the portal

可以在 Azure 门户中的内容播放器上测试视频。You can test your video on a content player in the Azure portal.

选择视频,然后选择“播放”按钮 。Select the video, and then select the Play button.

在 Azure 门户中播放视频

请注意以下事项:Some considerations apply:

  • 确保视频已发布。Make sure that the video has been published.
  • Azure 门户媒体播放器从默认的流式处理终结点播放。The Azure portal media player plays from the default streaming endpoint. 若要从非默认流式处理终结点播放,请选择并复制该 URL,然后将其粘贴到其他播放器中。If you want to play from a non-default streaming endpoint, select and copy the URL, and then paste it into another player. 例如,可以在 Azure Media Player 上测试视频。For example, you can test your video on the Azure Media Player.
  • 用于进行流式处理的流式处理终结点必须处于运行状态。The streaming endpoint from which you are streaming must be running.

后续步骤Next steps

媒体服务 v3(最新版本)Media Services v3 (latest)

查看最新版本的 Azure 媒体服务!Check out the latest version of Azure Media Services!

媒体服务 v2(旧版)Media Services v2 (legacy)