媒体服务的概念Media Services concepts

备注

Google Widevine 目前在中国地区不可用。Google Widevine is not avaliable in China regions now.

本主题简要概述 Azure 媒体服务的术语和概念。This topic gives a brief overview of Azure Media Services terminology and concepts. 本文还会提供深入介绍媒体服务 v3 概念和功能的文章的链接。The article also provides links to articles with in-depth explanation of Media Services v3 concepts and functionality.

在开始开发之前,应该复习这些主题中所述的基本概念。The fundamental concepts described in these topics should be reviewed prior to starting development.

备注

目前,无法使用 Azure 门户来管理 v3 资源。Currently, you cannot use the Azure portal to manage v3 resources. 请使用 REST APICLI 或受支持的 SDK 之一。Use the REST API, CLI, or one of the supported SDKs.

术语Terminology

本部分介绍某些常见行业术语如何对应于媒体服务 v3 API 中的术语。This section shows how some common industry terms map to the Media Services v3 API.

实时事件Live Event

实时事件表示用于引入、转码(可选)以及打包视频、音频和实时元数据的管道。A Live Event represents a pipeline for ingesting, transcoding (optionally), and packaging live streams of video, audio, and real-time metadata.

对于从媒体服务 v2 API 迁移的客户,实时事件取代了 v2 中的频道实体。For customers migrating from Media Services v2 APIs, the Live Event replaces the Channel entity in v2. 有关详细信息,请参阅从 v2 迁移到 v3For more information, see Migrating from v2 to v3.

流式处理终结点(打包和来源)Streaming Endpoint (Packaging and Origin)

流式处理终结点表示动态(实时)打包和源服务,该服务可使用一个常见流式处理媒体协议(HLS 或 DASH)直接将实时和按需内容发送到客户端播放器应用程序。A Streaming Endpoint represents a dynamic (just-in-time) packaging and origin service that can deliver your live and on-demand content directly to a client player application, using one of the common streaming media protocols (HLS or DASH). 此外,流式处理终结点为行业领先的 DRM 提供动态(实时)加密。In addition, the Streaming Endpoint provides dynamic (just-in-time) encryption to industry leading DRMs.

在媒体流行业,此服务通常称为打包器来源In the media streaming industry, this service is commonly referred to as a Packager or Origin. 本行业对此功能使用的其他常见术语包括 JITP(实时打包器)或 JITE(实时加密)。Other common terms in the industry for this capability include JITP (Just-in-time-packager) or JITE (Just-in-time-encryption).

云上传和存储Cloud upload and storage

若要开始管理、加密、编码、分析和流式处理 Azure 中的媒体内容,需要创建一个媒体服务帐户,并将数字文件上传到资产中。To start managing, encrypting, encoding, analyzing, and streaming media content in Azure, you need to create a Media Services account and upload your digital files into Assets.

编码Encoding

将优质数字媒体文件上传到资产中后,可将其编码为可在各种浏览器和设备上播放的格式。Once you upload your high-quality digital media files into Assets, you can encode them into formats that can be played on a wide variety of browsers and devices.

若要使用媒体服务 v3 进行编码,需要创建转换作业To encode with Media Services v3, you need to create Transforms and Jobs.

转换

媒体分析Media analytics

若要分析视频和音频文件,也需要创建转换作业To analyze your video and audio files, you also need to create Transforms and Jobs.

打包、传送、保护Packaging, delivery, protection

将内容编码后,可以利用动态打包Once your content is encoded, you can take advantage of Dynamic Packaging. 在媒体服务中,流式处理终结点/来源是用于将媒体内容传送到客户端播放器的动态打包服务。In Media Services, a Streaming Endpoint/Origin is the dynamic packaging service used to deliver media content to client players. 若要使输出资产中的视频可供客户端进行播放,必须创建流定位符,然后生成流 URL。To make videos in the output asset available to clients for playback, you have to create a Streaming Locator and then build streaming URLs.

创建流定位符时,除了资产名称之外,还需要指定流策略When creating the Streaming Locator, in addition to asset's name, you need to specify Streaming Policy. 使用流策略可为流定位符定义流式处理协议和加密选项(如果有)。Streaming Policies enable you to define streaming protocols and encryption options (if any) for your Streaming Locators.

无论流式传输的是直播内容还是点播内容,都要使用动态打包。Dynamic Packaging is used whether you stream your content live or on-demand. 下图演示了如何使用动态打包工作流流式传输点播内容。The following diagram shows the on-demand streaming with dynamic packaging workflow.

动态打包

借助媒体服务,可以传送使用高级加密标准 (AES-128) 或/和以下两个主要数字版权管理 (DRM) 系统中任意一个动态加密的直播和点播内容:Microsoft PlayReady 和 Apple FairPlay。With Media Services, you can deliver your live and on-demand content encrypted dynamically with Advanced Encryption Standard (AES-128) or/and any of the two major digital rights management (DRM) systems: Microsoft PlayReady, and Apple FairPlay. 媒体服务还提供了用于向已授权客户端传送 AES 密钥和 DRM(PlayReady 和 FairPlay)许可证的服务。Media Services also provides a service for delivering AES keys and DRM (PlayReady and FairPlay) licenses to authorized clients.

若要针对流指定加密选项,请创建内容密钥策略并将其与流定位符相关联。If specifying encryption options on your stream, create the Content Key Policy and associate it with your Streaming Locator. 使用内容密钥策略,可以配置如何将内容密钥传送到终端客户端。The Content Key Policy enables you to configure how the content key is delivered to end clients.

下图阐释了媒体服务内容保护工作流:The following image illustrates the Media Services content protection workflow:

保护内容

* 动态加密支持 AES-128“明文密钥”、CBCS 和 CENC。* dynamic encryption supports AES-128 "clear key", CBCS, and CENC.

可以使用媒体服务动态清单来仅流式传输视频的特定再现内容或子剪辑。You can use Media Services Dynamic Manifests to stream only a specific rendition or subclips of your video. 以下示例使用编码器将夹层资产编码成七个 ISO MP4 视频再现内容(从 180p 到 1080p)。In the following example, an encoder was used to encode a mezzanine asset into seven ISO MP4s video renditions (from 180p to 1080p). 编码的资产可以动态打包成以下任一流式处理协议:HLS、MPEG DASH 和平滑流式处理。The encoded asset can be dynamically packaged into any of the following streaming protocols: HLS, MPEG DASH, and Smooth. 图表顶部显示了不包含筛选器的资产的 HLS 清单(包含全部七个再现内容)。At the top of the diagram, the HLS manifest for the asset with no filters is shown (it contains all seven renditions). 左下角显示名为“ott”的筛选器已应用到 HLS 清单。In the bottom left, the HLS manifest to which a filter named "ott" was applied is shown. “ott”筛选器指定要删除所有不低于 1 Mbps 的比特率,因此将最差的两个质量级别从响应中剥除。The "ott" filter specifies to remove all bitrates below 1 Mbps, which resulted in the bottom two quality levels being stripped off in the response. 右下角显示名为“mobile”的筛选器已应用到 HLS 清单。In the bottom right, the HLS manifest to which a filter named "mobile" was applied is shown. “mobile”筛选器指定删除分辨率大于 720p 的再现内容,因此会剥除两个 1080p 再现内容。The "mobile" filter specifies to remove renditions where the resolution is larger than 720p, which resulted in the two 1080p renditions being stripped off.

再现内容筛选

实时传送视频流Live streaming

使用 Azure 媒体服务可将直播活动传送到 Azure 云中的客户。Azure Media Services enables you to deliver live events to your customers on the Azure cloud. 直播活动负责引入和处理实时视频源。Live Events are responsible for ingesting and processing the live video feeds. 创建实时事件时,会创建一个输入终结点,可以使用它来从远程编码器发送实时信号。When you create a Live Event, an input endpoint is created that you can use to send a live signal from a remote encoder. 将流传输到实时事件后,可以通过创建资产实时输出流定位符来启动流事件。Once you have the stream flowing into the Live Event, you can begin the streaming event by creating an Asset, Live Output, and Streaming Locator. 实时输出会将流存档到资产中,使观看者可通过流式处理终结点使用该流。Live Output will archive the stream into the Asset and make it available to viewers through the Streaming Endpoint. 实时事件可以是下述两种类型之一:直通实时编码A Live Event can be one of two types: pass-through and live encoding.

下图演示了直通类型的工作流:The following image illustrates the Pass-through type workflow:

直通

播放器客户端Player clients

可以在各种浏览器和设备上使用 Azure Media Player 播放媒体服务流式传输的媒体内容。You can use Azure Media Player to play back media content streamed by Media Services on a wide variety of browsers and devices. Azure Media Player 采用行业标准(如 HTML5、媒体源扩展 (MSE) 和加密媒体扩展插件 (EME))来提供更丰富的自适应流式处理体验。Azure Media Player utilizes industry standards, such as HTML5, Media Source Extensions (MSE), and Encrypted Media Extensions (EME) to provide an enriched adaptive streaming experience.

后续步骤Next steps