媒体服务 v3 中的动态打包Dynamic packaging in Media Services v3

媒体服务徽标 v3media services logo v3


备注

Google Widevine 内容保护服务目前在 Azure 中国区域不可用。Google Widevine content protection services are currently unavailable in the Azure China regions.

Azure 媒体服务可用于对许多媒体源文件格式进行编码。Azure Media Services can be used to encode many media source file formats. 它通过不同的流式处理协议(无论是否提供内容保护)来提供它们,以覆盖所有主要设备(如 iOS 和 Android 设备)。It delivers them via different streaming protocols, with or without content protection, to reach all major devices (like iOS and Android devices). 这些客户端可理解不同的协议。These clients understand different protocols. 例如,iOS 要求以 HTTP Live Streaming (HLS) 格式传送流,Android 设备支持 HLS 以及 MPEG DASH。For example, iOS requires streams to be delivered in HTTP Live Streaming (HLS) format and Android devices support HLS as well as MPEG DASH.

在媒体服务中,流式处理终结点(源)表示动态(即时)打包和源服务,该服务可直接将你的实时和按需内容发送到客户端播放器应用。In Media Services, a streaming endpoint (origin) represents a dynamic (just-in-time) packaging and origin service that can deliver your live and on-demand content directly to a client player app. 它使用下一部分中所述的一种常见流式处理媒体协议。It uses one of the common streaming media protocols mentioned in the following section. 动态打包是所有流式处理终结点(标准或高级)的标准功能。Dynamic packaging is a feature that comes standard on all streaming endpoints (Standard or Premium).

备注

可以使用 Azure 门户执行以下操作:管理 v3 直播活动、查看 v3 资产、获取有关访问 API 的信息。You can use the Azure portal to manage v3 live events, view v3 assets, get info about accessing APIs. 对于其他所有管理任务(例如,转换和作业),请使用 REST APICLI 或某个受支持的 SDKFor all other management tasks (for example, transforms and jobs), use the REST API, CLI, or one of the supported SDKs.

准备源文件供传输To prepare your source files for delivery

若要利用动态打包,需将夹层(源)文件编码为一组自适应比特率 MP4(ISO 基本媒体 14496-12)文件。To take advantage of dynamic packaging, you need to encode your mezzanine (source) file into a set of multiple bitrate MP4 (ISO Base Media 14496-12) files. 你需要具备包含媒体服务动态打包所需的编码 MP4 和流式处理配置文件的资产You need to have an asset with the encoded MP4 and streaming configuration files needed by Media Services dynamic packaging. 通过此组 MP4 文件,可以使用动态打包通过下述流媒体协议传送视频。From this set of MP4 files, you can use dynamic packaging to deliver video via the streaming media protocols described below.

Azure 媒体服务动态打包仅支持 MP4 容器格式的视频和音频文件。Azure Media Services dynamic packaging only supports video and audio file in the MP4 container format. 如果使用的是备用编解码器(如 Dolby),则必须将音频文件编码为 MP4 容器。Audio files must be encoded into an MP4 container as well when using alternate codecs like Dolby.

提示

获取 MP4 和流式处理配置文件的一种方式是使用媒体服务对夹层文件进行编码One way to get the MP4 and streaming configuration files is to encode your mezzanine file with Media Services.

要使编码资产中的视频可供客户端播放,必须创建流式处理定位符,然后生成流式处理 URL。To make videos in the encoded asset available to clients for playback, you have to create a Streaming Locator and build streaming URLs. 然后,根据流式处理客户端清单中指定的格式(HLS、MPEG DASH 或平滑流式处理),使用你选择的协议接收流。Then, based on the specified format in the streaming client manifest (HLS, MPEG DASH, or Smooth Streaming), you receive the stream in the protocol you've chosen.

因此,只需以单一存储格式存储文件并为其付费,然后媒体服务服务就会基于客户端的请求构建并提供相应响应。As a result, you only need to store and pay for the files in single storage format and Media Services service will build and serve the appropriate response based on requests from a client.

如果计划使用媒体服务动态加密来保护内容,请参阅流式处理协议和加密类型If you plan to protect your content by using Media Services dynamic encryption, see Streaming protocols and encryption types.

HLS 协议HLS protocol

流式处理客户端可以指定以下 HLS 格式:Your streaming client can specify the following HLS formats:

协议Protocol 示例Example
HLS V4HLS V4 https://amsv3account-cne21.streaming.media.chinacloudapp.cn/21b17732-0112-4d76-b526-763dcd843449/ignite.ism/manifest(format=m3u8-aapl)
HLS V3HLS V3 https://amsv3account-cne21.streaming.media.chinacloudapp.cn/21b17732-0112-4d76-b526-763dcd843449/ignite.ism/manifest(format=m3u8-aapl-v3)
HLS CMAFHLS CMAF https://amsv3account-cne21.streaming.media.chinacloudapp.cn/21b17732-0112-4d76-b526-763dcd843449/ignite.ism/manifest(format=m3u8-cmaf)

MPEG-DASH 协议MPEG-DASH protocol

流式处理客户端可以指定以下 MPEG-DASH 格式:Your streaming client can specify the following MPEG-DASH formats:

协议Protocol 示例Example
MPEG-DASH CSFMPEG-DASH CSF https://amsv3account-cne21.streaming.media.chinacloudapi.cn/21b17732-0112-4d76-b526-763dcd843449/ignite.ism/manifest(format=mpd-time-csf)
MPEG-DASH CMAFMPEG-DASH CMAF https://amsv3account-cne21.streaming.media.chinacloudapi.cn/21b17732-0112-4d76-b526-763dcd843449/ignite.ism/manifest(format=mpd-time-cmaf)

平滑流式处理协议Smooth Streaming protocol

流式处理客户端可以指定以下平滑流式处理格式:Your streaming client can specify the following Smooth Streaming formats:

协议Protocol 说明/示例Notes/examples
平滑流Smooth Streaming https://amsv3account-cne21.streaming.media.chinacloudapi.cn/21b17732-0112-4d76-b526-763dcd843449/ignite.ism/manifest
平滑流式处理 2.0(旧清单)Smooth Streaming 2.0 (legacy manifest) 默认情况下,平滑流式处理清单格式包含重复标记(r 标记)。By default, Smooth Streaming manifest format contains the repeat tag (r-tag). 但是,一些播放器不支持 r-tagHowever, some players do not support the r-tag. 使用这些播放器的客户端可以使用禁用 r 标记的格式:Clients with these players can use a format that disables the r-tag:

https://amsv3account-cne21.streaming.media.chinacloudapi.cn/21b17732-0112-4d76-b526-763dcd843449/ignite.ism/manifest(format=fmp4-v20)

备注

平滑流式处理要求流中同时存在音频和视频。Smooth Streaming requires that both audio and video should be present in your stream.

按需流式处理工作流On-demand streaming workflow

以下步骤显示了常见的媒体服务流式处理工作流,其中动态打包与 Azure 媒体服务中的标准编码器一起使用。The following steps show a common Media Services streaming workflow where dynamic packaging is used along with the Standard Encoder in Azure Media Services.

  1. 上传一个输入文件,例如 MP4、QuickTime/MOV 或其他受支持的文件格式。Upload an input file such as a MP4, QuickTime/MOV, or other supported file format. 此文件也称为夹层文件或源文件。This file is also referred to as the mezzanine or source file. 有关受支持格式的列表,请参阅标准编码器支持的格式For the list of supported formats, see Formats Supported by the Standard Encoder.

  2. 将夹层文件编码为 H.264/AAC MP4 自适应比特率集。Encode your mezzanine file into an H.264/AAC MP4 adaptive bitrate set.

    如果已经有编码文件,只是想要复制并流式传输文件,请使用:CopyVideoCopyAudio API。If you already have encoded files and just want to copy and stream the files, use: CopyVideo and CopyAudio APIs. 将创建一个带有流式处理清单(.ism 文件)的新 MP4 文件。A new MP4 file with a streaming manifest (.ism file) will be created as a result.

  3. 发布包含自适应比特率 MP4 集的输出资产。Publish the output asset that contains the adaptive bitrate MP4 set. 通过创建流式处理定位符进行发布。You publish by creating a streaming locator.

  4. 生成针对不同格式(HLS、MPEG-DASH 和平滑流式处理)的 URL。Build URLs that target different formats (HLS, MPEG-DASH, and Smooth Streaming). 流式处理终结点将负责为所有这些不同格式提供正确的清单和请求。The streaming endpoint would take care of serving the correct manifest and requests for all these different formats.

下图显示了使用动态打包进行按需流式处理的工作流。The following diagram shows the on-demand streaming with dynamic packaging workflow.

使用动态打包进行按需流式处理的工作流关系图

上图中显示了下载路径,这只是为了向你展示可通过流式处理终结点(源)(在流式处理定位符上指定可下载的流式处理策略)直接下载 MP4 文件。The download path is present in the above image just to show you that you can download an MP4 file directly through the streaming endpoint (origin) (you specify the downloadable streaming policy on the streaming locator).
动态包生成工具不会更改文件。The dynamic packager is not altering the file. 如果希望绕过流式处理终结点(来源)功能,则可以选择使用 Azure blob 存储 API 直接访问 MP4 以便进行渐进式下载。You can optionally use the Azure blob storage APIs to access an MP4 directly for progressive downloading if you wish to bypass the streaming endpoint (origin) features.

编码为自适应比特率 MP4Encode to adaptive bitrate MP4s

以下文章介绍如何使用媒体服务对视频进行编码的示例:The following articles show examples of how to encode a video with Media Services:

请参阅标准编码器格式和编解码器的列表。See the list of Standard Encoder formats and codecs.

实时传送视频流工作流Live streaming workflow

直播活动可以设置为“直通”(本地实时编码器发送多比特率流)或“实时编码”(本地实时编码器发送单比特率流)。A live event can be set to either a pass-through (an on-premises live encoder sends a multiple bitrate stream) or live encoding (an on-premises live encoder sends a single bitrate stream).

以下是使用动态打包进行实时传送视频流的常用工作流:Here's a common workflow for live streaming with dynamic packaging:

  1. 创建直播活动Create a live event.
  2. 获取引入 URL 并配置本地编码器以使用 URL 发送贡献源。Get the ingest URL and configure your on-premises encoder to use the URL to send the contribution feed.
  3. 获取预览 URL 并使用它验证是否接收到来自编码器的输入。Get the preview URL and use it to verify that the input from the encoder is being received.
  4. 创建新资产。Create a new asset.
  5. 创建实时输出并使用创建的资产名称。Create a live output and use the asset name that you created.
    实时输出会将流存档到资产中。The live output archives the stream into the asset.
  6. 使用内置的流式处理策略类型创建流式处理定位符。Create a streaming locator with the built-in streaming policy types.
    如果想要加密内容,请查看内容保护概述If you intend to encrypt your content, review Content protection overview.
  7. 列出流式处理定位符的路径,以获取要使用的 URL。List the paths on the streaming locator to get the URLs to use.
  8. 获取要从中进行流式传输的流式处理终结点的主机名。Get the host name for the streaming endpoint you want to stream from.
  9. 生成针对不同格式(HLS、MPEG-DASH 和平滑流式处理)的 URL。Build URLs that target different formats (HLS, MPEG-DASH, and Smooth Streaming). 流式处理终结点负责提供正确的清单并请求不同的格式。The streaming endpoint takes care of serving the correct manifest and requests for the different formats.

此关系图显示使用动态打包进行实时传送视频流的工作流:This diagram shows the workflow for live streaming with dynamic packaging:

使用动态打包进行直通编码的工作流关系图

有关在媒体服务 v3 中实时传送视频流的信息,请参阅实时传送视频流概述For information about live streaming in Media Services v3, see Live streaming overview.

动态打包支持的视频编解码器Video codecs supported by Dynamic Packaging

动态打包支持采用 MP4 容器文件格式,并包含使用 H.264(MPEG-4 AVC 或 AVC1)或是 H.265(HEVC、hev1 或 hvc1)进行编码的视频的视频文件。Dynamic packaging supports video files that are in the MP4 container file format and contain video that is encoded with H.264 (MPEG-4 AVC or AVC1) or H.265 (HEVC, hev1, or hvc1).

备注

已使用动态打包测试了高达 4K 的分辨率和高达 60 帧/秒的帧速率。Resolutions of up to 4K and frame rates of up to 60 frames/second have been tested with dynamic packaging.

动态打包支持的音频编解码器Audio codecs supported by dynamic packaging

动态打包还支持以 MP4 文件容器格式存储、包含使用以下编解码器之一编码的音频流的音频文件:Dynamic packaging also supports audio files that are stored in the MP4 file container format containing encoded audio stream in one of the following codecs:

  • AAC(AAC-LC、HE-AAC v1 或 HE-AAC v2)。AAC (AAC-LC, HE-AAC v1, or HE-AAC v2).

  • Dolby Digital Plus(增强型 AC-3 或 E-AC3)。Dolby Digital Plus (Enhanced AC-3 or E-AC3). 编码的音频必须以 MP4 容器格式存储,才能使用动态打包。The encoded audio must be stored in the MP4 container format to work with Dynamic Packaging.

  • Dolby AtmosDolby Atmos

    流式处理 Dolby Atmos 内容支持 MPEG-DASH 协议等标准,包括采用公共流式处理格式 (CSF) 或公共媒体应用程序格式 (CMAF) 分段的 MP4,以及通过具有 CMAF 的 HTTP Live Streaming (HLS)。Streaming Dolby Atmos content is supported for standards like the MPEG-DASH protocol with either Common Streaming Format (CSF) or Common Media Application Format (CMAF) fragmented MP4, and via HTTP Live Streaming (HLS) with CMAF.

  • DTSDTS
    DASH-CSF、DASH-CMAF、HLS-M2TS 和 HLS-CMAF 打包格式支持的 DTS 编解码器包括:DTS codecs supported by DASH-CSF, DASH-CMAF, HLS-M2TS, and HLS-CMAF packaging formats are:

    • DTS Digital Surround (dtsc)DTS Digital Surround (dtsc)
    • DTS-HD High Resolution 和 DTS-HD Master Audio (dtsh)DTS-HD High Resolution and DTS-HD Master Audio (dtsh)
    • DTS Express (dtse)DTS Express (dtse)
    • DTS-HD Lossless (no core) (dtsl)DTS-HD Lossless (no core) (dtsl)

动态打包支持使用 DASH 或 HLS(版本 4 或更高版本)的多音轨,用于流式传输包含使用多个编解码器和语言的多音轨的资产。Dynamic packaging supports multiple audio tracks with DASH or HLS (version 4 or later) for streaming assets that have multiple audio tracks with multiple codecs and languages.

对于以上所有音频编解码器,编码的音频必须以 MP4 容器格式存储,才能使用动态打包。For all of the above audio codecs, the encoded audio must be stored in the MP4 container format to work with Dynamic Packaging. 该服务不支持 blob 存储上的原始基本流文件格式(例如,不支持以下格式:.dts、.ac3)。The service does not support raw elementary stream file formats on blob storage (for example the following would not be supported - .dts, .ac3.)

音频打包仅支持扩展名为 .mp4 或 .mp4a 的文件。Only files with the .mp4 of .mp4a extension are supported for audio packaging.

限制Limitations

AAC 5.1 音频上的 iOS 限制iOS limitation on AAC 5.1 audio

Apple iOS 设备不支持 5.1 AAC 音频编解码器。Apple iOS devices do not support 5.1 AAC audio codec. 必须使用 Dolby Digital 或 Dolby Digital Plus 编解码器对多通道音频进行编码。Multi-channel audio must be encoded using Dolby Digital or Dolby Digital Plus codecs.

有关详细信息,请参阅适用于 Apple 设备的 HLS 创作规范For detailed information, see HLS authoring specification for apple devices.

备注

媒体服务不支持 Dolby Digital、Dolby Digital Plus 或 Dolby Atmos 多通道音频格式的 Dolby Digital Plus 编码。Media Services does not support encoding of Dolby Digital, Dolby Digital Plus or Dolby Digital Plus with Dolby Atmos multi-channel audio formats.

Dolby Digital 音频Dolby Digital audio

媒体服务动态打包目前不支持包含 Dolby Digital (AC3) 音频(因为这被视为 Dolby 遗留的编解码器)的文件。Media Services dynamic packaging does not currently support files that contain Dolby Digital (AC3) audio (as this is considered a legacy codec by Dolby).

清单Manifests

在媒体服务动态打包中,HLS、MPEG-DASH 和平滑流式处理的流式处理客户端清单是基于 URL 中的格式选择器动态生成的。In Media Services dynamic packaging, the streaming client manifests for HLS, MPEG-DASH, and Smooth Streaming are dynamically generated based on the format selector in the URL.

清单文件包含流元数据,例如轨迹类型(音频、视频或文本)、轨迹名称、开始和结束时间、比特率(质量)、轨迹语言、演播窗口(持续时间固定的滑动窗口)和视频编解码器 (FourCC)。A manifest file includes streaming metadata such as track type (audio, video, or text), track name, start and end time, bitrate (qualities), track languages, presentation window (sliding window of fixed duration), and video codec (FourCC). 此文件还会通过提供有关下一个可播放视频片段及其位置的信息,来指示播放器检索下一个片段。It also instructs the player to retrieve the next fragment by providing information about the next playable video fragments that are available and their location. 片段(或段)实际上是视频内容的“区块”。Fragments (or segments) are the actual "chunks" of video content.

示例Examples

HLSHLS

以下示例是 HLS 清单文件,也称为 HLS 主播放列表:Here's an example of an HLS manifest file, also called an HLS master playlist:

#EXTM3U
#EXT-X-VERSION:4
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",NAME="aac_eng_2_128041_2_1",LANGUAGE="eng",DEFAULT=YES,AUTOSELECT=YES,URI="QualityLevels(128041)/Manifest(aac_eng_2_128041_2_1,format=m3u8-aapl)"
#EXT-X-STREAM-INF:BANDWIDTH=536608,RESOLUTION=320x180,CODECS="avc1.64000d,mp4a.40.2",AUDIO="audio"
QualityLevels(381048)/Manifest(video,format=m3u8-aapl)
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=536608,RESOLUTION=320x180,CODECS="avc1.64000d",URI="QualityLevels(381048)/Manifest(video,format=m3u8-aapl,type=keyframes)"
#EXT-X-STREAM-INF:BANDWIDTH=884544,RESOLUTION=480x270,CODECS="avc1.640015,mp4a.40.2",AUDIO="audio"
QualityLevels(721495)/Manifest(video,format=m3u8-aapl)
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=884544,RESOLUTION=480x270,CODECS="avc1.640015",URI="QualityLevels(721495)/Manifest(video,format=m3u8-aapl,type=keyframes)"
#EXT-X-STREAM-INF:BANDWIDTH=1327398,RESOLUTION=640x360,CODECS="avc1.64001e,mp4a.40.2",AUDIO="audio"
QualityLevels(1154816)/Manifest(video,format=m3u8-aapl)
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=1327398,RESOLUTION=640x360,CODECS="avc1.64001e",URI="QualityLevels(1154816)/Manifest(video,format=m3u8-aapl,type=keyframes)"
#EXT-X-STREAM-INF:BANDWIDTH=2413312,RESOLUTION=960x540,CODECS="avc1.64001f,mp4a.40.2",AUDIO="audio"
QualityLevels(2217354)/Manifest(video,format=m3u8-aapl)
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=2413312,RESOLUTION=960x540,CODECS="avc1.64001f",URI="QualityLevels(2217354)/Manifest(video,format=m3u8-aapl,type=keyframes)"
#EXT-X-STREAM-INF:BANDWIDTH=3805760,RESOLUTION=1280x720,CODECS="avc1.640020,mp4a.40.2",AUDIO="audio"
QualityLevels(3579827)/Manifest(video,format=m3u8-aapl)
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=3805760,RESOLUTION=1280x720,CODECS="avc1.640020",URI="QualityLevels(3579827)/Manifest(video,format=m3u8-aapl,type=keyframes)"
#EXT-X-STREAM-INF:BANDWIDTH=139017,CODECS="mp4a.40.2",AUDIO="audio"
QualityLevels(128041)/Manifest(aac_eng_2_128041_2_1,format=m3u8-aapl)

MPEG-DASHMPEG-DASH

以下示例是 MPEG-DASH 清单文件,也称为 MPEG-DASH 媒体演示说明 (MPD):Here's an example of an MPEG-DASH manifest file, also called an MPEG-DASH Media Presentation Description (MPD):

<?xml version="1.0" encoding="UTF-8"?>
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="static" mediaPresentationDuration="PT1M10.315S" minBufferTime="PT7S">
   <Period>
      <AdaptationSet id="1" group="5" profiles="ccff" bitstreamSwitching="false" segmentAlignment="true" contentType="audio" mimeType="audio/mp4" codecs="mp4a.40.2" lang="en">
         <SegmentTemplate timescale="10000000" media="QualityLevels($Bandwidth$)/Fragments(aac_eng_2_128041_2_1=$Time$,format=mpd-time-csf)" initialization="QualityLevels($Bandwidth$)/Fragments(aac_eng_2_128041_2_1=i,format=mpd-time-csf)">
            <SegmentTimeline>
               <S d="60160000" r="10" />
               <S d="41386666" />
            </SegmentTimeline>
         </SegmentTemplate>
         <Representation id="5_A_aac_eng_2_128041_2_1_1" bandwidth="128041" audioSamplingRate="48000" />
      </AdaptationSet>
      <AdaptationSet id="2" group="1" profiles="ccff" bitstreamSwitching="false" segmentAlignment="true" contentType="video" mimeType="video/mp4" codecs="avc1.640020" maxWidth="1280" maxHeight="720" startWithSAP="1">
         <SegmentTemplate timescale="10000000" media="QualityLevels($Bandwidth$)/Fragments(video=$Time$,format=mpd-time-csf)" initialization="QualityLevels($Bandwidth$)/Fragments(video=i,format=mpd-time-csf)">
            <SegmentTimeline>
               <S d="60060000" r="10" />
               <S d="42375666" />
            </SegmentTimeline>
         </SegmentTemplate>
         <Representation id="1_V_video_1" bandwidth="3579827" width="1280" height="720" />
         <Representation id="1_V_video_2" bandwidth="2217354" codecs="avc1.64001F" width="960" height="540" />
         <Representation id="1_V_video_3" bandwidth="1154816" codecs="avc1.64001E" width="640" height="360" />
         <Representation id="1_V_video_4" bandwidth="721495" codecs="avc1.640015" width="480" height="270" />
         <Representation id="1_V_video_5" bandwidth="381048" codecs="avc1.64000D" width="320" height="180" />
      </AdaptationSet>
   </Period>
</MPD>

平滑流Smooth Streaming

下面是平滑流式处理清单文件的示例:Here's an example of a Smooth Streaming manifest file:

<?xml version="1.0" encoding="UTF-8"?>
<SmoothStreamingMedia MajorVersion="2" MinorVersion="2" Duration="703146666" TimeScale="10000000">
   <StreamIndex Chunks="12" Type="audio" Url="QualityLevels({bitrate})/Fragments(aac_eng_2_128041_2_1={start time})" QualityLevels="1" Language="eng" Name="aac_eng_2_128041_2_1">
      <QualityLevel AudioTag="255" Index="0" BitsPerSample="16" Bitrate="128041" FourCC="AACL" CodecPrivateData="1190" Channels="2" PacketSize="4" SamplingRate="48000" />
      <c t="0" d="60160000" r="11" />
      <c d="41386666" />
   </StreamIndex>
   <StreamIndex Chunks="12" Type="video" Url="QualityLevels({bitrate})/Fragments(video={start time})" QualityLevels="5">
      <QualityLevel Index="0" Bitrate="3579827" FourCC="H264" MaxWidth="1280" MaxHeight="720" CodecPrivateData="0000000167640020ACD9405005BB011000003E90000EA600F18319600000000168EBECB22C" />
      <QualityLevel Index="1" Bitrate="2217354" FourCC="H264" MaxWidth="960" MaxHeight="540" CodecPrivateData="000000016764001FACD940F0117EF01100000303E90000EA600F1831960000000168EBECB22C" />
      <QualityLevel Index="2" Bitrate="1154816" FourCC="H264" MaxWidth="640" MaxHeight="360" CodecPrivateData="000000016764001EACD940A02FF9701100000303E90000EA600F162D960000000168EBECB22C" />
      <QualityLevel Index="3" Bitrate="721495" FourCC="H264" MaxWidth="480" MaxHeight="270" CodecPrivateData="0000000167640015ACD941E08FEB011000003E90000EA600F162D9600000000168EBECB22C" />
      <QualityLevel Index="4" Bitrate="381048" FourCC="H264" MaxWidth="320" MaxHeight="180" CodecPrivateData="000000016764000DACD941419F9F011000003E90000EA600F14299600000000168EBECB22C" />
      <c t="0" d="60060000" r="11" />
      <c d="42375666" />
   </StreamIndex>
</SmoothStreamingMedia>

命名清单中的曲目Naming of tracks in the manifest

如果在 .ism 文件中指定了音轨名称,则媒体服务会在 AdaptationSet 中添加 Label 元素,以指定特定音轨的纹理信息。输出 DASH 清单的示例:If an audio track name is specified in the .ism file, Media Services adds a Label element within an AdaptationSet to specify the textural information for the specific audio track. An example of the output DASH manifest:

<AdaptationSet codecs="mp4a.40.2" contentType="audio" lang="en" mimeType="audio/mp4" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
  <Label>audio_track_name</Label>
  <Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
  <Representation audioSamplingRate="48000" bandwidth="131152" id="German_Forest_Short_Poem_english-en-68s-2-lc-128000bps_seg">
    <BaseURL>German_Forest_Short_Poem_english-en-68s-2-lc-128000bps_seg.mp4</BaseURL>
  </Representation>
</AdaptationSet>

播放机可以使用 Label 元素在其 UI 上显示。The player can use the Label element to display on its UI.

发出音频描述轨道的信号Signaling audio description tracks

可以向视频中添加旁白轨道,以帮助视力受损的客户通过倾听旁白来跟随视频录制。You can add a narration track to your video to help visually impaired clients follow the video recording by listening to the narration. 需要将音轨批注为清单中的音频描述。You need to annotate an audio track as audio description in the manifest. 为此,请将“accessibility”和“role”参数添加到 .ism 文件中。To do that, add “accessibility” and “role” parameters to the .ism file. 你有责任正确设置这些参数,以将音频轨道作为音频描述发出信号。It's your responsibility to set these parameters correctly to signal an audio track as audio description. 例如,将 <param name="accessibility" value="description" /><param name="role" value="alternate" 添加到特定音频轨道的 .ism 文件中。For example, add <param name="accessibility" value="description" /> and <param name="role" value="alternate" to the .ism file for a specific audio track.

有关详细信息,请参阅如何发出描述性音轨信号示例。For more information, see the How to signal a descriptive audio track example.

平滑流式处理清单Smooth Streaming manifest

如果正在播放平滑流式处理流,则清单将在该音频轨道的 AccessibilityRole 属性中携带值。例如,Role="alternate" Accessibility="description" 将添加到 StreamIndex 元素中,以指示它是音频描述。If you're playing a Smooth Streaming stream, the manifest would carry values in Accessibility and Role attributes for that audio track. For example, Role="alternate" Accessibility="description" would be added in the StreamIndex element to indicate it's an audio description.

DASH 清单DASH manifest

对于 DASH 清单,将添加以下两个元素以发出音频描述信号:For DASH manifest, the following two elements would be added to signal the audio description:

<Accessibility schemeIdUri="urn:mpeg:dash:role:2011" value="description"/>
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="alternate"/>

HLS 播放列表HLS playlist

对于 HLS v7 及更高版本 (format=m3u8-cmaf),当音频描述跟踪收到信号时,其播放列表将携带 AUTOSELECT=YES,CHARACTERISTICS="public.accessibility.describes-video"For HLS v7 and above (format=m3u8-cmaf), its playlist would carry AUTOSELECT=YES,CHARACTERISTICS="public.accessibility.describes-video" when the audio description track is signaled.

示例Example

有关详细信息,请参阅如何发出音频描述轨道信号For more information, see How to signal audio description tracks.

动态清单Dynamic manifest

若要控制发送到播放器的曲目数目、格式、比特率和呈现时间范围,可以将动态筛选与媒体服务动态包生成工具配合使用。To control the number of tracks, formats, bitrates, and presentation time windows that are sent to players, you can use dynamic filtering with the Media Services dynamic packager. 有关详细信息,请参阅预筛选清单与动态包生成工具配合使用For more information, see Pre-filtering manifests with the dynamic packager.

动态加密Dynamic encryption

可以使用动态加密借助 AES-128 或两种主要数字版权管理 (DRM) 系统中的任何一种对实时或按需内容进行动态加密:Microsoft PlayReady 和 Apple FairPlay。You can use dynamic encryption to dynamically encrypt your live or on-demand content with AES-128 or any of the two major digital rights management (DRM) systems: Microsoft PlayReady, and Apple FairPlay. 媒体服务还提供用于向已授权客户端传送 AES 密钥和 DRM 许可证的服务。Media Services also provides a service for delivering AES keys and DRM licenses to authorized clients. 有关详细信息,请参阅动态加密For more information, see dynamic encryption.

后续步骤Next steps

上传、编码和流式处理视频Upload, encode, and stream videos