使用从本地编码器接收多比特率实时流的频道Working with Channels that receive multi-bitrate live stream from on-premises encoders

备注

自 2018 年 5 月 12 日起,实时频道将不再支持 RTP/MPEG-2 传输流引入协议。Starting May 12, 2018, live channels will no longer support the RTP/MPEG-2 transport stream ingest protocol. 请从 RTP/MPEG-2 迁移到 RTMP 或分段 MP4(平滑流式处理)引入协议。Please migrate from RTP/MPEG-2 to RTMP or fragmented MP4 (Smooth Streaming) ingest protocols.

概述Overview

在 Azure 媒体服务中, 频道 表示用于处理实时传送视频流内容的管道。In Azure Media Services, a channel represents a pipeline for processing live-streaming content. 频道通过以下两种方式之一接收实时输入流:A channel receives live input streams in one of two ways:

  • 本地实时编码器将多比特率 RTMP 或平滑流式处理(分片 MP4)流发送到无法通过媒体服务执行实时编码的频道。An on-premises live encoder sends a multi-bitrate RTMP or Smooth Streaming (fragmented MP4) stream to the channel that is not enabled to perform live encoding with Media Services. 引入流会通过频道,而不会进行任何进一步处理。The ingested streams pass through channels without any further processing. 这种方法称为 直通This method is called pass-through. 实时编码器也可将单比特率流发送到并未启用实时编码的频道,并不建议这样做。A live encoder can also send a single-bitrate stream to a channel that is not enabled for live encoding, but we don't recommend that. 媒体服务会将流传送给请求它的客户。Media Services delivers the stream to customers who request it.

    备注

    实时传送视频流时,使用直通方法是最经济的。Using a pass-through method is the most economical way to do live streaming.

  • 本地实时编码器采用以下格式之一将单比特率流发送至能够使用媒体服务执行实时编码的频道:RTMP 或平滑流式处理(分片 MP4)。An on-premises live encoder sends a single-bitrate stream to the channel that is enabled to perform live encoding with Media Services in one of the following formats: RTMP or Smooth Streaming (fragmented MP4). 然后,频道将对传入的单比特率流执行实时编码,使之转换为多比特率(自适应)视频流。The channel then performs live encoding of the incoming single-bitrate stream to a multi-bitrate (adaptive) video stream. 媒体服务会将流传送给请求它的客户。Media Services delivers the stream to customers who request it.

从媒体服务 2.10 版开始,创建频道时,可以指定频道接收输入流的方式。Starting with the Media Services 2.10 release, when you create a channel, you can specify how you want your channel to receive the input stream. 还可以指定是否想要频道对流执行实时编码。You can also specify whether you want the channel to perform live encoding of your stream. 可以使用两个选项:You have two options:

  • 直通:如果计划使用将多比特率流(直通流)作为输出的本地实时编码器,请指定此值。Pass Through: Specify this value if you plan to use an on-premises live encoder that has a multi-bitrate stream (a pass-through stream) as output. 在这种情况下,传入流无需任何编码即可传递到输出。In this case, the incoming stream passes through to the output without any encoding. 这是 2.10 版以前的频道行为。This is the behavior of a channel before the 2.10 release. 本文提供有关如何使用这种频道的详细信息。This article gives details about working with channels of this type.
  • 实时编码:如果计划使用媒体服务将单比特率实时流编码为多比特率流,请选择此值。Live Encoding: Choose this value if you plan to use Media Services to encode your single-bitrate live stream to a multi-bitrate stream. 使实时编码通道处于“正在运行”状态会产生帐单费用 。Leaving a live encoding channel in a Running state incurs billing charges. 建议在实时传送视频流事件完成之后立即停止正在运行的频道,以避免产生额外的小时费用。We recommend that you immediately stop your running channels after your live-streaming event is complete to avoid extra hourly charges. 媒体服务会将流传送给请求它的客户。Media Services delivers the stream to customers who request it.

备注

本文讨论未启用执行实时编码的频道的属性。This article discusses attributes of channels that are not enabled to perform live encoding. 若要了解如何使用执行实时编码的频道,请参阅使用 Azure 媒体服务创建多比特率流的实时传送视频流For information about working with channels that are enabled to perform live encoding, see Live streaming using Azure Media Services to create multi-bitrate streams.

有关建议的本地编码器的信息,请参阅建议的本地编码器For information about recommended on premises encoders, see Recommended on premises encoders.

下图表示的是一个使用本地实时编码器输出多比特率 RTMP 或分片 MP4(平滑流式处理)流的实时传送视频流工作流。The following diagram represents a live-streaming workflow that uses an on-premises live encoder to have multi-bitrate RTMP or fragmented MP4 (Smooth Streaming) streams as output.

实时工作流

常见的实时流处理方案Common live-streaming scenario

以下步骤介绍创建常见的实时传送视频流应用程序时涉及的任务。The following steps describe tasks involved in creating common live-streaming applications.

  1. 将视频摄像机连接到计算机。Connect a video camera to a computer. 启动并配置输出多比特率 RTMP 或分段 MP4(平滑流式处理)流的本地实时编码器。Start and configure an on-premises live encoder that has a multi-bitrate RTMP or fragmented MP4 (Smooth Streaming) stream as output. 有关详细信息,请参阅 Azure 媒体服务 RTMP 支持和实时编码器For more information, see Azure Media Services RTMP Support and Live Encoders.

    也可以在创建频道后执行此步骤。You can also perform this step after you create your channel.

  2. 创建并启动频道。Create and start a channel.

  3. 检索通道引入 URL。Retrieve the channel ingest URL.

    实时编码器使用引入 URL 将流发送到频道。The live encoder uses the ingest URL to send the stream to the channel.

  4. 检索频道预览 URL。Retrieve the channel preview URL.

    使用此 URL 来验证频道是否正常接收实时流。Use this URL to verify that your channel is properly receiving the live stream.

  5. 创建节目。Create a program.

    使用 Azure 门户时,创建节目的同时还会创建资产。When you use the Azure portal, creating a program also creates an asset.

    使用 .NET SDK 或 REST 时,需要创建一个资产并指定在创建节目时要使用该资产。When you use the .NET SDK or REST, you need to create an asset and specify to use this asset when creating a program.

  6. 发布与节目关联的资产。Publish the asset that's associated with the program.

    备注

    创建 Azure 媒体服务帐户后,会将一个处于“已停止”状态的默认流式处理终结点添加到帐户。 When your Azure Media Services account is created, a default streaming endpoint is added to your account in the Stopped state. 要从中流式传输内容的流式处理终结点必须处于“正在运行”状态。 The streaming endpoint from which you want to stream content has to be in the Running state.

  7. 在准备好开始流式传输和存档时,启动节目。Start the program when you're ready to start streaming and archiving.

  8. (可选)可以向实时编码器发信号,以启动广告。Optionally, the live encoder can be signaled to start an advertisement. 将广告插入到输出流中。The advertisement is inserted in the output stream.

  9. 在要停止对事件进行流式传输和存档时,停止节目。Stop the program whenever you want to stop streaming and archiving the event.

  10. 删除节目(并选择性地删除资产)。Delete the program (and optionally delete the asset).

频道及其相关组件的说明Description of a channel and its related components

频道输入(引入)配置Channel input (ingest) configurations

引入流式传输协议Ingest streaming protocol

媒体服务通过使用多比特率分片 MP4 和多比特率 RTMP 作为流式处理协议支持引入实时源。Media Services supports ingesting live feeds by using multi-bitrate fragmented MP4 and multi-bitrate RTMP as streaming protocols. 选择了 RTMP 引入流式传输协议时,会为频道创建两个引入(输入)终结点:When the RTMP ingest streaming protocol is selected, two ingest (input) endpoints are created for the channel:

  • 主 URL:指定频道的主 RTMP 引入终结点的完全限定 URL。Primary URL: Specifies the fully qualified URL of the channel's primary RTMP ingest endpoint.
  • 辅助 URL(可选):指定频道的辅助 RTMP 引入终结点的完全限定 URL。Secondary URL (optional): Specifies the fully qualified URL of the channel's secondary RTMP ingest endpoint.

如果想要提高引入流的持久性和容错性,并实现编码器故障转移和容错性(尤其在以下情况时),请使用辅助 URL:Use the secondary URL if you want to improve the durability and fault tolerance of your ingest stream (as well as encoder failover and fault tolerance), especially for the following scenarios:

  • 单个编码器双推送到主和辅助 URL:Single encoder double-pushing to both primary and secondary URLs:

    此方案的主要目的是为网络波动和抖动提供更多的复原能力。The main purpose of this scenario is to provide more resiliency to network fluctuations and jitters. 某些 RTMP 编码器无法良好处理网络断开连接情况。Some RTMP encoders don't handle network disconnects well. 当出现网络断开连接时,编码器可能会停止编码,并在重新连接情况发生时,不发送缓冲的数据。When a network disconnect happens, an encoder might stop encoding and then not send the buffered data when a reconnect happens. 这会导致不连续性和数据丢失。This causes discontinuities and data loss. 网络断开连接可能是由错误的网络或 Azure 端的维护导致。Network disconnects can happen because of a bad network or maintenance on the Azure side. 主/辅助 URL 可减少网络问题,并且提供受控的升级过程。Primary/secondary URLs reduce the network problems and provide a controlled upgrade process. 每当计划的网络发生断开连接情况时,媒体服务管理主要和次要断开连接并为两者提供延迟断开连接。Each time a scheduled network disconnect happens, Media Services manages the primary and secondary disconnects and provides a delayed disconnect between the two. 然后,编码器有时间保留发送的数据并再次重新连接。Encoders then have time to keep sending data and reconnect again. 断开连接的顺序可以是随机的,但是在主要/次要或次要/主要 URL 之间始终会存在延迟。The order of the disconnects can be random, but there will always be a delay between primary/secondary or secondary/primary URLs. 在此方案中,编码器仍是单点故障。In this scenario, the encoder is still the single point of failure.

  • 多个编码器中的每个编码器推送到专用点:Multiple encoders, with each encoder pushing to a dedicated point:

    此方案提供编码器并引入冗余。This scenario provides both encoder and ingests redundancy. 在此方案中编码器 1 推送到主 URL,而编码器 2 推送到辅助 URL。In this scenario, encoder1 pushes to the primary URL, and encoder2 pushes to the secondary URL. 当一个编码器发生故障时,其他编码器可以继续发送数据。When an encoder fails, the other encoder can keep sending data. 由于媒体服务不会同时断开主 URL 和辅助 URL 的连接,因此可保持数据冗余。Data redundancy can be maintained because Media Services does not disconnect primary and secondary URLs at the same time. 此方案假设编码器已同步时间,并提供完全相同的数据。This scenario assumes that encoders are time synced and provide exactly the same data.

  • 多个编码器双推送到主和辅助 URL:Multiple encoders double-pushing to both primary and secondary URLs:

    在此方案中这两个编码器将数据推送到主和辅助 URL。In this scenario, both encoders push data to both primary and secondary URLs. 这提供了最佳的可靠性、容错能力以及数据冗余。This provides the best reliability and fault tolerance, as well as data redundancy. 此方案可以容忍两个编码器同时发生故障和断开连接,即使一个编码器停止工作。This scenario can tolerate both encoder failures and disconnects, even if one encoder stops working. 此方案假设编码器已同步时间,并提供完全相同的数据。It assumes that encoders are time synced and provide exactly the same data.

有关 RTMP 实时编码器详细信息,请参阅 Azure 媒体服务的 RTMP 支持和实时编码器For information about RTMP live encoders, see Azure Media Services RTMP Support and Live Encoders.

摄取 URL(终结点)Ingest URLs (endpoints)

频道提供你在实时编码器中指定的输入终结点(引入 URL),因此编码器可以将流推送到你的频道。A channel provides an input endpoint (ingest URL) that you specify in the live encoder, so the encoder can push streams to your channels.

当创建频道时,可以获取摄取 URL。You can get the ingest URLs when you create the channel. 若要获取这些 URL,频道不一定要处于“正在运行” 状态。For you to get these URLs, the channel does not have to be in the Running state. 准备好开始将数据推送到频道时,频道必须处于“正在运行” 状态。When you're ready to start pushing data to the channel, the channel must be in the Running state. 在频道开始引入数据后,可以通过预览 URL 来预览流。After the channel starts ingesting data, you can preview your stream through the preview URL.

可以选择通过 SSL 连接引入分片 MP4(平滑流)实时流。You have an option of ingesting a fragmented MP4 (Smooth Streaming) live stream over an SSL connection. 要通过 SSL 进行引入,请确保将引入 URL 更新为 HTTPS。To ingest over SSL, make sure to update the ingest URL to HTTPS. 当前,无法通过 SSL 引入 RTMP。Currently, you cannot ingest RTMP over SSL.

关键帧间隔Keyframe interval

当使用本地实时编码器生成多比特率流时,关键帧间隔指定外部编码器使用的帧组 (GOP) 的持续时间。When you're using an on-premises live encoder to generate multi-bitrate stream, the keyframe interval specifies the duration of the group of pictures (GOP) as used by that external encoder. 当频道收到此传入流后,可以通过下列任意格式将实时流传送到客户端播放应用程序:平滑流式处理、Dynamic Adaptive Streaming over HTTP (DASH) 和 HTTP Live Streaming (HLS)。After the channel receives this incoming stream, you can deliver your live stream to client playback applications in any of the following formats: Smooth Streaming, Dynamic Adaptive Streaming over HTTP (DASH), and HTTP Live Streaming (HLS). 当执行实时传送视频流时,HLS 始终是动态打包的。When you're doing live streaming, HLS is always packaged dynamically. 默认情况下,媒体服务根据从实时编码器收到的关键帧间隔自动计算 HLS 段打包比率(每段的片数)。By default, Media Services automatically calculates the HLS segment packaging ratio (fragments per segment) based on the keyframe interval that's received from the live encoder.

下表显示了段持续时间是如何计算的:The following table shows how the segment duration is calculated:

关键帧间隔Keyframe interval HLS 段打包比率 (FragmentsPerSegment)HLS segment packaging ratio (FragmentsPerSegment) 示例Example
小于或等于 3 秒Less than or equal to 3 seconds 3:13:1 如果 KeyFrameInterval(或 GOP)为 2 秒,则默认的 HLS 段打包比率是 3 比 1。If KeyFrameInterval (or GOP) is 2 seconds, the default HLS segment packaging ratio is 3 to 1. 这会创建一个 6 秒的 HLS 段。This creates a 6-second HLS segment.
3 到 5 秒3 to 5 seconds 2:12:1 如果 KeyFrameInterval(或 GOP)为 4 秒,则默认的 HLS 段打包比率是 2 比 1。If KeyFrameInterval (or GOP) is 4 seconds, the default HLS segment packaging ratio is 2 to 1. 这会创建一个 8 秒的 HLS 段。This creates an 8-second HLS segment.
大于 5 秒Greater than 5 seconds 1:11:1 如果 KeyFrameInterval(或 GOP)为 6 秒,则默认的 HLS 段打包比率是 1 比 1。If KeyFrameInterval (or GOP) is 6 seconds, the default HLS segment packaging ratio is 1 to 1. 这会创建一个 6 秒的 HLS 段。This creates a 6-second HLS segment.

可以通过配置频道的输出并设置 ChannelOutputHls 上的 FragmentsPerSegment 来更改每段的片数这一比率。You can change the fragments-per-segment ratio by configuring the channel’s output and setting FragmentsPerSegment on ChannelOutputHls.

还可以通过设置 ChannelInput 上的 KeyFrameInterval 属性更改关键帧间隔值。You can also change the keyframe interval value by setting the KeyFrameInterval property on ChannelInput. 如果显式设置了 KeyFrameInterval,则会通过上述规则计算 HLS 段打包比率 FragmentsPerSegment。If you explicitly set KeyFrameInterval, the HLS segment packaging ratio FragmentsPerSegment is calculated via the rules described previously.

如果同时显式设置了 KeyFrameInterval 和 FragmentsPerSegment,则媒体服务使用设置的值。If you explicitly set both KeyFrameInterval and FragmentsPerSegment, Media Services uses the values that you set.

允许的 IP 地址Allowed IP addresses

可以定义允许向此通道发布视频的 IP 地址。You can define the IP addresses that are allowed to publish video to this channel. 可将允许的 IP 地址指定为以下形式之一:An allowed IP address can be specified as one of the following:

  • 单个 IP 地址(例如,10.0.0.1)A single IP address (for example, 10.0.0.1)
  • 使用一个 IP 地址和 CIDR 子网掩码的 IP 范围(例如,10.0.0.1/22)An IP range that uses an IP address and a CIDR subnet mask (for example, 10.0.0.1/22)
  • 使用一个 IP 地址和点分十进制子网掩码的 IP 范围(例如,10.0.0.1(255.255.252.0))An IP range that uses an IP address and a dotted decimal subnet mask (for example, 10.0.0.1(255.255.252.0))

如果未指定 IP 地址并且没有规则定义,则不会允许任何 IP 地址。If no IP addresses are specified and there's no rule definition, then no IP address is allowed. 若要允许任何 IP 地址,请创建规则并设置 0.0.0.0/0。To allow any IP address, create a rule and set 0.0.0.0/0.

通道预览Channel preview

预览 URLPreview URLs

通道还提供了一个预览终结点(预览 URL),可使用它在进一步处理和传递流之前预览流并对其进行验证。Channels provide a preview endpoint (preview URL) that you use to preview and validate your stream before further processing and delivery.

可以在创建频道时获取预览 URL。You can get the preview URL when you create the channel. 若要获取该 URL,频道不一定要处于“正在运行” 状态。For you to get the URL, the channel does not have to be in the Running state. 在频道开始引入数据后,可以预览流。After the channel starts ingesting data, you can preview your stream.

当前,不管指定了哪种输入类型,都只能以分片 MP4(平滑流式处理)流格式来传送预览流。Currently, the preview stream can be delivered only in fragmented MP4 (Smooth Streaming) format, regardless of the specified input type. 可以使用平滑流式处理运行状况监视器播放器来测试平滑流。You can use the Smooth Streaming Health Monitor player to test the smooth stream. 还可以使用 Azure 门户中托管的播放器来查看流。You can also use a player that's hosted in the Azure portal to view your stream.

允许的 IP 地址Allowed IP addresses

可以定义允许连接到预览终结点的 IP 地址。You can define the IP addresses that are allowed to connect to the preview endpoint. 如果未指定 IP 地址,则允许任何 IP 地址。If no IP addresses are specified, any IP address is allowed. 可将允许的 IP 地址指定为以下形式之一:An allowed IP address can be specified as one of the following:

  • 单个 IP 地址(例如,10.0.0.1)A single IP address (for example, 10.0.0.1)
  • 使用一个 IP 地址和 CIDR 子网掩码的 IP 范围(例如,10.0.0.1/22)An IP range that uses an IP address and a CIDR subnet mask (for example, 10.0.0.1/22)
  • 使用一个 IP 地址和点分十进制子网掩码的 IP 范围(例如,10.0.0.1(255.255.252.0))An IP range that uses an IP address and a dotted decimal subnet mask (for example, 10.0.0.1(255.255.252.0))

频道输出Channel output

有关频道输出的信息,请参阅 关键帧间隔 部分。For information about channel output, see the Keyframe interval section.

频道管理的节目Channel-managed programs

频道与节目相关联,可以使用节目控制实时流中的段的发布和存储。A channel is associated with programs that you can use to control the publishing and storage of segments in a live stream. 频道管理节目。Channels manage programs. 频道和节目的关系类似于传统媒体,其中频道具有恒定的内容流,而节目的范围限定为该频道上的一些定时事件。The channel and program relationship is similar to traditional media, where a channel has a constant stream of content and a program is scoped to some timed event on that channel.

可以通过设置 存档窗口 长度,指定希望保留节目录制内容的小时数。You can specify the number of hours you want to retain the recorded content for the program by setting the Archive Window length. 此值的设置范围是最短 5 分钟,最长 25 小时。This value can be set from a minimum of 5 minutes to a maximum of 25 hours. 存档时段长度还决定了客户端能够从当前实时位置向后搜索的最长时间。Archive window length also dictates the maximum number of time clients can seek back in time from the current live position. 超出指定时间长度后,节目也能够运行,但落在时段长度后面的内容会全部被丢弃。Programs can run over the specified amount of time, but content that falls behind the window length is continuously discarded. 此属性的这个值还决定了客户端清单能够增加多长时间。This value of this property also determines how long the client manifests can grow.

每个节目与存储流内容的资产相关联。Each program is associated with an asset that stores the streamed content. 资产将映射到 Azure 存储帐户中的块 Blob 容器,资产中的文件作为 Blob 存储在该容器中。An asset is mapped to a block blob container in the Azure storage account, and the files in the asset are stored as blobs in that container. 若要发布节目,以便客户可以查看该流,必须为关联的资产创建 OnDemand 定位符。To publish the program so your customers can view the stream, you must create an OnDemand locator for the associated asset. 可以使用此定位符生成一个可提供给客户端的流式处理 URL。You can use this locator to build a streaming URL that you can provide to your clients.

一个频道最多支持三个并发运行的节目,因此可为同一传入流创建多个存档。A channel supports up to three concurrently running programs, so you can create multiple archives of the same incoming stream. 可以根据需要发布和存档事件的不同部分。You can publish and archive different parts of an event as needed. 例如,假设业务要求是存档 6 小时的节目,但只广播过去 10 分钟的内容。For example, imagine that your business requirement is to archive 6 hours of a program, but to broadcast only the last 10 minutes. 为了实现此目的,需要创建两个同时运行的节目。To accomplish this, you need to create two concurrently running programs. 一个节目设置为存档六小时的事件,但不发布该节目。One program is set to archive six hours of the event, but the program is not published. 另一个节目设置为存档 10 分钟的事件,并且要发布该节目。The other program is set to archive for 10 minutes, and this program is published.

不应当将现有节目重用于新事件。You should not reuse existing programs for new events. 应针对每个事件创建新节目。Instead, create a new program for each event. 准备好开始流式传输和存档后,启动节目。Start the program when you're ready to start streaming and archiving. 要停止对事件进行流式传输和存档时,停止节目。Stop the program whenever you want to stop streaming and archiving the event.

如果要删除存档的内容,请停止并删除节目,并删除关联的资产。To delete archived content, stop and delete the program, and then delete the associated asset. 如果节目使用该资产,则无法删除该资产。An asset cannot be deleted if a program uses it. 必须先删除该节目。The program must be deleted first.

即使你停止并删除了节目,在删除资产之前,用户可以按需将已存档内容作为视频进行流式传输。Even after you stop and delete the program, users can stream your archived content as a video on demand, until you delete the asset. 如果希望保留已存档内容但不希望其可供流式传输,请删除流式传输定位符。If you want to retain the archived content but not have it available for streaming, delete the streaming locator.

频道状态和计费Channel states and billing

频道的当前状态的可能值包括:Possible values for the current state of a channel include:

  • 已停止:这是频道在创建后的初始状态。Stopped: This is the initial state of the channel after its creation. 在此状态下,可以更新频道属性,但不允许进行流式传输。In this state, the channel properties can be updated but streaming is not allowed.
  • 正在启动:频道正在启动。Starting: The channel is being started. 此状态下不允许进行更新或流式传输。No updates or streaming is allowed during this state. 如果发生错误,则频道会返回到“已停止”状态 。If an error occurs, the channel returns to the Stopped state.
  • 正在运行:频道可以处理实时流。Running: The channel can process live streams.
  • 正在停止:正在停止频道。Stopping: The channel is being stopped. 此状态下不允许进行更新或流式传输。No updates or streaming is allowed during this state.
  • 正在删除:正在删除频道。Deleting: The channel is being deleted. 此状态下不允许进行更新或流式传输。No updates or streaming is allowed during this state.

下表显示通道状态如何映射到计费模式。The following table shows how channel states map to the billing mode.

通道状态Channel state 门户 UI 指示器Portal UI indicators 是否计费?Billed?
正在启动Starting 正在启动Starting 否(暂时状态)No (transient state)
正在运行Running 就绪(没有正在运行的节目)Ready (no running programs)

or

流式处理(至少有一个正在运行的节目)Streaming (at least one running program)

Yes
正在停止Stopping 正在停止Stopping 否(暂时状态)No (transient state)
已停止Stopped 已停止Stopped No

隐藏式字幕和广告插入Closed captioning and ad insertion

下表展示了支持的隐藏式字幕和广告插入标准。The following table demonstrates supported standards for closed captioning and ad insertion.

标准Standard 注释Notes
CEA-708 和 EIA-608 (708/608)CEA-708 and EIA-608 (708/608) CEA-708 和 EIA-608 是适用于美国和加拿大的隐藏式字幕标准。CEA-708 and EIA-608 are closed-captioning standards for the United States and Canada.

当前,只有当编码的输入流中携带了该字幕时才支持该字幕。Currently, captioning is supported only if carried in the encoded input stream. 需要使用可以在发送到媒体服务的编码流中插入 608 或 708 字幕的实时媒体编码器。You need to use a live media encoder that can insert 608 or 708 captions in the encoded stream that's sent to Media Services. 媒体服务会将带有插入的字幕的内容传送到查看器。Media Services delivers the content with inserted captions to your viewers.

ismt 内的 TTML(平滑流式处理文本轨道)TTML inside .ismt (Smooth Streaming text tracks) 媒体服务动态打包功能允许客户端对下列任何格式的内容进行流式传输:DASH、HLS 或平滑流式处理。Media Services dynamic packaging enables your clients to stream content in any of the following formats: DASH, HLS, or Smooth Streaming. 但是,如果引入 .ismt 内带有字幕(平滑流式处理文本轨道)的分片 MP4(平滑流式处理),则只能将该流传送到平滑流式处理客户端。However, if you ingest fragmented MP4 (Smooth Streaming) with captions inside .ismt (Smooth Streaming text tracks), you can deliver the stream to only Smooth Streaming clients.
SCTE-35SCTE-35 SCTE-35 是用来提示广告插入的数字信号系统。SCTE-35 is a digital signaling system that's used to cue advertising insertion. 下游接收器使用该信号来将广告接合到流中并使其占用规定的时间。Downstream receivers use the signal to splice advertising into the stream for the allotted time. SCTE-35 在输入流中必须作为稀疏轨道进行发送。SCTE-35 must be sent as a sparse track in the input stream.

当前唯一受支持的可以携带广告信号的输入流格式是分片 MP4(平滑流式处理)。Currently, the only supported input stream format that carries ad signals is fragmented MP4 (Smooth Streaming). 唯一受支持的输出格式也是 Smooth Streaming.The only supported output format is also Smooth Streaming.

注意事项Considerations

使用本地实时编码器将多比特率流发送到一个频道时,以下限制将适用:When you're using an on-premises live encoder to send a multi-bitrate stream to a channel, the following constraints apply:

  • 确保有足够的空闲 Internet 连接将数据发送到引入点。Make sure you have sufficient free Internet connectivity to send data to the ingest points.
  • 使用辅助引入 URL 需要额外的带宽。Using a secondary ingest URL requires additional bandwidth.
  • 传入多比特率流最多可包含 10 个视频质量级别(层)和最多为 5 个音频轨。The incoming multi-bitrate stream can have a maximum of 10 video quality levels (layers) and a maximum of 5 audio tracks.
  • 任何视频质量级别的最高平均比特率应低于 10 Mbps。The highest average bitrate for any of the video quality levels should be below 10 Mbps.
  • 所有视频和音频流的平均比特率聚合应小于 25 Mbps。The aggregate of the average bitrates for all the video and audio streams should be below 25 Mbps.
  • 当频道或其关联的节目正在运行时,无法更改输入协议。You cannot change the input protocol while the channel or its associated programs are running. 如果需要不同的协议,应当针对每个输入协议创建单独的频道。If you require different protocols, you should create separate channels for each input protocol.
  • 可在频道中引入单比特率。You can ingest a single bitrate in your channel. 但由于频道不处理流,因此客户端应用程序也会接收单比特率流。But because the channel does not process the stream, the client applications will also receive a single bitrate stream. (不建议采用此选项。)(We don't recommend this option.)

下面是与使用频道及其相关组件相关的其他注意事项:Here are other considerations related to working with channels and related components:

  • 每次重新配置实时编码器后,请对通道调用 重置 方法。Every time you reconfigure the live encoder, call the Reset method on the channel. 重置通道之前,必须停止节目。Before you reset the channel, you have to stop the program. 在重置频道后,重新启动节目。After you reset the channel, restart the program.

    备注

    重新启动节目时,需要将其与新资产相关联,并创建新定位符。When you restart the program, you need to associate it with a new asset and create a new locator.

  • 只有当频道处于“正在运行”状态且频道中的所有节目都已停止时,才能停止频道 。A channel can be stopped only when it's in the Running state and all programs on the channel have been stopped.

  • 默认情况下,只能向媒体服务帐户添加五个频道。By default, you can add only five channels to your Media Services account. 有关详细信息,请参阅配额和限制For more information, see Quotas and limitations.

  • 仅当频道处于“正在运行” 状态时才会向你收费。You are billed only when your channel is in the Running state. 有关详细信息,请参阅频道状态和计费部分。For more information, see the Channel states and billing section.

媒体服务学习路径Media Services learning paths

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

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

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

建议的本地编码器Recommended on premises encoders

Azure 媒体服务分片 MP4 实时引入规范Azure Media Services fragmented MP4 lives ingest specification

Azure 媒体服务概述和常见方案Azure Media Services overview and common scenarios

媒体服务概念Media Services concepts