Azure 媒体服务中的流式处理终结点(来源)Streaming Endpoints (Origin) in Azure Media Services

在 Azure 媒体服务中,流式处理终结点表示动态(实时)打包和源服务,该服务可使用一个常见流式处理媒体协议(HLS 或 DASH)直接将实时和按需内容发送到客户端播放器应用。In Azure Media Services, 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 app 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.

用户创建媒体服务帐户时,将为用户创建一个处于“已停止”状态的默认 流式处理终结点。When you create a Media Services account, a default Streaming Endpoint is created for you in a stopped state. 无法删除默认流式处理终结点。You can't delete the default Streaming Endpoint. 可以在帐户下创建更多的流式处理终结点(请参阅配额和限制)。More Streaming Endpoints can be created under the account (see Quotas and limits).

备注

若要开始流式处理视频,需启动要从中流式处理视频的流式处理终结点To start streaming videos, you need to start the Streaming Endpoint from which you want to stream the video.

仅当流式处理终结点处于运行状态时才进行计费。You're only billed when your Streaming Endpoint is in the running state.

请确保同时查看动态打包主题。Make sure to also review the Dynamic packaging topic.

命名约定Naming convention

流式处理 URL 的主机名格式为:{servicename}-{accountname}-{regionname}.streaming.media.chinacloudapi.cn,其中 servicename = 流式处理终结点名称或实时事件名称。The host name format of the streaming URL is: {servicename}-{accountname}-{regionname}.streaming.media.chinacloudapi.cn, where servicename = the streaming endpoint name or the live event name.

使用默认的流式处理终结点时,将省略 servicename,因此 URL 为:{accountname}-{regionname}.streaming.chinacloudapi.cnWhen using the default streaming endpoint, servicename is omitted so the URL is: {accountname}-{regionname}.streaming.chinacloudapi.cn.

限制Limitations

  • 流式处理终结点名称的最大值为 24 个字符。The streaming endpoint name has a max value of 24 characters.
  • 该名称应遵循此正则表达式模式:^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$The name should follow this regex pattern: ^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$.

类型Types

有两种类型的流式处理终结点标准(预览版)和高级There are two Streaming Endpoint types: Standard (preview) and Premium. 类型由用户为流式处理终结点分配的缩放单元(scaleUnits)数定义。The type is defined by the number of scale units (scaleUnits) you allocate for the streaming endpoint.

最大流单元限制通常为 10。The maximum streaming unit limit is usually 10.

下表描述了类型:The table describes the types:

类型Type 缩放单元Scale units 说明Description
标准Standard 00 默认的流式处理终结点是“标准”类型,可以通过调整 scaleUnits 更改为“高级”类型。 The default Streaming Endpoint is a Standard type—it can be changed to the Premium type by adjusting scaleUnits.
高级Premium >0>0 “高级” 流式处理终结点适用于高级工作负荷,可提供专用且可缩放的带宽容量。Premium Streaming Endpoints are suitable for advanced workloads and providing dedicated and scalable bandwidth capacity. 可以通过调整 scaleUnits(流单元)转到“高级” 类型。You move to a Premium type by adjusting scaleUnits (streaming units). scaleUnits 提供专用的出口容量,可以按照 200 Mbps 的增量购买。scaleUnits provide you with dedicated egress capacity that can be purchased in increments of 200 Mbps. 使用高级 类型时,每个启用的单元都为应用提供额外的带宽容量。When using the Premium type, each enabled unit provides additional bandwidth capacity to the app.

有关 SLA 的信息,请参阅定价和 SLAFor SLA information, see Pricing and SLA.

比较流式处理类型Comparing streaming types

功能Feature 标准Standard 高级Premium
吞吐量Throughput 最大 600 MbpsUp to 600 Mbps 每个流单元 (SU) 200 Mbps。200 Mbps per streaming unit (SU).
按比例计费Billing is prorated 每日Daily 每日Daily
动态加密Dynamic encryption Yes Yes
动态打包Dynamic packaging Yes Yes
缩放Scale 自动扩展到目标吞吐量。Auto scales up to the targeted throughput. 更多的 SUAdditional SUs
IP 筛选/G20/自定义主机IP filtering/G20/Custom host Yes Yes
渐进式下载Progressive download Yes Yes
建议用途Recommended usage 建议用于绝大多数流式处理方案。Recommended for the vast majority of streaming scenarios. 专业用途。Professional usage.

流式处理终结点属性Streaming Endpoint properties

本部分提供有关某些流式处理终结点属性的详细信息。This section gives details about some of the Streaming Endpoint's properties. 有关如何创建新流式处理终结点和所有属性描述的示例,请参阅流式处理终结点For examples of how to create a new streaming endpoint and descriptions of all properties, see Streaming Endpoint.

  • accessControl:用于为此流式处理终结点配置以下安全设置:Akamai 签名标头身份验证密钥和允许连接到此终结点的 IP 地址。accessControl: Used to configure the following security settings for this streaming endpoint: Akamai Signature Header Authentication keys and IP addresses that are allowed to connect to this endpoint.

  • crossSiteAccessPolicies:用于为各种客户端指定跨站点访问策略。crossSiteAccessPolicies: Used to specify cross site access policies for various clients. 有关详细信息,请参阅跨域策略文件规范提供跨域边界的服务For more information, see Cross-domain policy file specification and Making a Service Available Across Domain Boundaries. 这些设置仅适用于平滑流式处理。The settings only apply to Smooth Streaming.

  • customHostNames:用于配置流式处理终结点以接受定向到自定义主机名的流量。customHostNames: Used to configure a Streaming Endpoint to accept traffic directed to a custom host name. 此属性对“标准”和“高级”流式处理终结点有效。This property is valid for Standard and Premium Streaming Endpoints.

    域名的所有权必须由媒体服务确认。The ownership of the domain name must be confirmed by Media Services. 媒体服务通过要求将包含媒体服务帐户 ID 的 CName 记录作为组件添加到正在使用的域来验证域名所有权。Media Services verifies the domain name ownership by requiring a CName record containing the Media Services account ID as a component to be added to the domain in use. 例如,要将“sports.contoso.com”用作流式处理终结点的自定义主机名,则必须将 <accountId>.contoso.com 的记录配置为指向其中一个媒体服务验证主机名。As an example, for "sports.contoso.com" to be used as a custom host name for the streaming endpoint, a record for <accountId>.contoso.com must be configured to point to one of Media Services verification host names. 验证主机名由 verifydns.<mediaservices-dns-zone> 组成。The verification host name is composed of verifydns.<mediaservices-dns-zone>.

    下面是要在不同 Azure 区域的验证记录中使用的预期 DNS 区域。The following are the expected DNS zones to be used in the verify record for different Azure regions.

    • mediaservices.chinacloudapi.cn
    • verifydns.mediaservices.chinacloudapi.cn

    例如,将“945a4c4e-28ea-45cd-8ccb-a519f6b700ad.contoso.com”映射到“verifydns.mediaservices.chinacloudapi.cn”的 CName 记录证明媒体服务 ID 945a4c4e-28ea-45cd-8ccb- a519f6b700ad 拥有 contoso.com 域的所有权,因此可以将 contoso.com 下的任何名称用作该帐户下的流式处理终结点的自定义主机名。For example, a CName record that maps "945a4c4e-28ea-45cd-8ccb-a519f6b700ad.contoso.com" to "verifydns.mediaservices.chinacloudapi.cn" proves that the Media Services ID 945a4c4e-28ea-45cd-8ccb-a519f6b700ad has the ownership of the contoso.com domain, thus enabling any name under contoso.com to be used as a custom host name for a streaming endpoint under that account. 若要查找媒体服务 ID 值,请转至 Azure 门户,然后选择你的媒体服务帐户。To find the Media Service ID value, go to the Azure portal and select your Media Service account. “帐户 ID”显示在页面的右上方。 The Account ID appears on the top right of the page.

    如果尝试在没有正确验证 CName 记录的情况下设置自定义主机名,则 DNS 响应将失败,然后缓存一段时间。If there's an attempt to set a custom host name without a proper verification of the CName record, the DNS response will fail and then be cached for some time. 拥有适当的记录后,可能需要一段时间才能重新验证缓存的响应。Once a proper record is in place, it might take a while until the cached response is revalidated. 根据自定义域的 DNS 提供程序,重新验证记录需要几分钟到一个小时的时间。Depending on the DNS provider for the custom domain, it takes anywhere from a few minutes to an hour to revalidate the record.

    除了将 <accountId>.<parent domain> 映射到 verifydns.<mediaservices-dns-zone>CName,还必须创建另一个 CName,以将自定义主机名(例如 sports.contoso.com)映射到媒体服务流式处理终结点的主机名(例如 amstest-cne21.streaming.media.chinacloudapi.cn)。In addition to the CName that maps <accountId>.<parent domain> to verifydns.<mediaservices-dns-zone>, you must create another CName that maps the custom host name (for example, sports.contoso.com) to your Media Services Streaming Endpoint's host name (for example, amstest-cne21.streaming.media.chinacloudapi.cn).

    备注

    位于同一数据中心的流式处理终结点不能共享相同的自定义主机名。Streaming Endpoints located in the same data center can't share the same custom host name.

    当前,对于自定义域,媒体服务不支持 TLS。Currently, Media Services doesn't support TLS with custom domains.

  • maxCacheAge - 替代媒体片段和按需清单上的流式处理终结点设置的默认 max-age HTTP 缓存控制标头。maxCacheAge - Overrides the default max-age HTTP cache control header set by the streaming endpoint on media fragments and on-demand manifests. 该值以秒为单位进行设置。The value is set in seconds.

  • resourceState -

    • Stopped:创建后的流式处理终结点的初始状态Stopped: the initial state of a Streaming Endpoint after creation
    • Starting:正在转换为运行状态Starting: is transitioning to the running state
    • Running:可将内容流式传输到客户端Running: is able to stream content to clients
    • Scaling:缩放单元正在增加或减少Scaling: the scale units are being increased or decreased
    • Stopping:正在转换到停止状态Stopping: is transitioning to the stopped state
    • Deleting:正在删除Deleting: is being deleted
  • scaleUnits:提供专用的出口容量,可以按照 200 Mbps 的增量购买。scaleUnits: Provide you with dedicated egress capacity that can be purchased in increments of 200 Mbps. 如果需要转到高级 类型,请调整 scaleUnitsIf you need to move to a Premium type, adjust scaleUnits.

为何要使用多个流式处理终结点?Why use multiple streaming endpoints?

单个流式处理终结点可以同时流式传输直播视频和点播视频,大多数客户只使用一个流式处理终结点。A single streaming endpoint can stream both live and on-demand videos and most customers only use one streaming endpoint. 本部分提供了一些示例,说明了为什么可能需要使用多个流式处理终结点。This section gives some examples of why you may need to use multiple streaming endpoints.

  • 每个预留单位都允许 200 Mbps 的带宽。Each reserved unit allows for 200 Mbps of bandwidth. 如果需要的带宽超过 2,000 Mbps (2 Gbps),则可使用第二个流式处理终结点和负载均衡来提供额外的带宽。If you need more than 2,000 Mbps (2 Gbps) of bandwidth, you could use the second streaming endpoint and load balance to give you additional bandwidth.

  • 流式传输混合内容:直播视频和点播视频。Streaming mixed content: Live and Video on Demand.

    直播内容和点播内容的访问模式有很大差别。The access patterns for live and on-demand content are very different. 直播内容往往会同时收到对同一内容的大量需求。The live content tends to get a lot of demand for the same content all at once. 视频点播内容(例如,长尾存档内容)对同一内容的使用率较低。The video on-demand content (long tail archive content for instance) has low usage on the same content. 因此,缓存非常适合直播内容,但不适合长尾内容。Thus caching works very well on the live content but not as well on the long tail content.

    假设你的客户主要观看直播内容,但只是偶尔观看点播内容,而且是从同一个流式处理终结点接受服务。Consider a scenario in which your customers are mainly watching live content but are only occasionally watching on-demand content and it is served from the same Streaming Endpoint. 低使用率的点播内容会占用缓存空间,这些空间本来可以更好地节省给直播内容使用。The low usage of on-demand content would occupy cache space that would be better saved for the live content. 在这种情况下,建议你从一个流式处理终结点提供直播内容,从另一个流式处理终结点提供长尾内容。In this scenario, we would recommend serving the live content from one Streaming Endpoint and the long tail content from another Streaming Endpoint. 这将提高直播活动内容的性能。This will improve the performance of the live event content.

另请参阅See also

动态打包Dynamic packaging

后续步骤Next steps

管理流式处理终结点Manage streaming endpoints