实时事件类型比较Live Event types comparison

在 Azure 媒体服务中,实时事件可以是下述两种类型之一:实时编码和直通。In Azure Media Services, a Live Event can be one of two types: live encoding and pass-through.

类型比较Types comparison

下表比较了实时事件类型的功能。The following table compares features of the Live Event types. 这些类型是在创建期间使用 LiveEventEncodingType 设置的:The types are set during creation using LiveEventEncodingType:

  • LiveEventEncodingType.None - 本地实时编码器发送多比特率流。LiveEventEncodingType.None - An on-premises live encoder sends a multiple bitrate stream. 引入的流通过实时事件传递,而不会经过任何进一步的处理。The ingested streams passes through the Live Event without any further processing.
  • LiveEventEncodingType.Standard - 本地实时编码器将单比特率流发送到实时事件,媒体服务创建多比特率流。LiveEventEncodingType.Standard - An on-premises live encoder sends a single bitrate stream to the Live Event and Media Services creates multiple bitrate streams. 如果贡献源的分辨率为 720p 或更高,则 Default720p 预设将编码一组 6 分辨率/比特率对(本文稍后会提供详细信息)。If the contribution feed is of 720p or higher resolution, the Default720p preset will encode a set of 6 resolution/bitrate pairs (details follow later in the article).
  • LiveEventEncodingType.Premium1080p - 本地实时编码器将单比特率流发送到实时事件,媒体服务创建多比特率流。LiveEventEncodingType.Premium1080p - An on-premises live encoder sends a single bitrate stream to the Live Event and Media Services creates multiple bitrate streams. Default1080p 预设指定分辨率/比特率对的输出集(本文稍后会提供详细信息)。The Default1080p preset specifies the output set of resolution/bitrate pairs (details follow later in the article).
功能Feature 直通直播活动Pass-through Live Event Standard 或 Premium1080p 实时事件Standard or Premium1080p Live Event
单比特率输入在云中被编码为多比特率Single bitrate input is encoded into multiple bitrates in the cloud No Yes
贡献源的最大视频分辨率Maximum video resolution for contribution feed 4K(4096x2160,60 帧/秒)4K (4096x2160 at 60 frames/sec) 1080p(1920x1088,30 帧/秒)1080p (1920x1088 at 30 frames/sec)
贡献源中建议的最大层数Recommended maximum layers in contribution feed 最大为 12Up to 12 1 个音频One audio
输出中的最大层数Maximum layers in output 与输入相同Same as input 最多 6 个(请参阅下面的“系统预设”)Up to 6 (see System Presets below)
贡献源的最大聚合带宽Maximum aggregate bandwidth of contribution feed 60 Mbps60 Mbps 不适用N/A
贡献中单个层的最大比特率Maximum bitrate for a single layer in the contribution 20 Mbps20 Mbps 20 Mbps20 Mbps
支持多语言音轨Support for multiple language audio tracks Yes No
支持的输入视频编解码器Supported input video codecs H.264/AVC 和 H.265/HEVCH.264/AVC and H.265/HEVC H.264/AVCH.264/AVC
支持的输出视频编解码器Supported output video codecs 与输入相同Same as input H.264/AVCH.264/AVC
支持的视频位深、输入和输出Supported video bit depth, input, and output 最多 10 位,包括 HDR 10/HLGUp to 10-bit including HDR 10/HLG 8 位8-bit
支持的输入音频编解码器Supported input audio codecs AAC-LC、HE-AAC v1、HE-AAC v2AAC-LC, HE-AAC v1, HE-AAC v2 AAC-LC、HE-AAC v1、HE-AAC v2AAC-LC, HE-AAC v1, HE-AAC v2
支持的输出音频编解码器Supported output audio codecs 与输入相同Same as input AAC-LCAAC-LC
输出视频的最大视频分辨率Maximum video resolution of output video 与输入相同Same as input Standard - 720p,Premium1080p - 1080pStandard - 720p, Premium1080p - 1080p
输入视频的最大帧速率Maximum frame rate of input video 60 帧/秒60 frames/second Standard 或 Premium1080p - 30 帧/秒Standard or Premium1080p - 30 frames/second
输入协议Input protocols RTMP、分段 MP4(平滑流式处理)RTMP, fragmented-MP4 (Smooth Streaming) RTMP、分段 MP4(平滑流式处理)RTMP, fragmented-MP4 (Smooth Streaming)
价格Price 请参阅定价页并单击“实时视频”选项卡See the pricing page and click on "Live Video" tab 请参阅定价页并单击“实时视频”选项卡See the pricing page and click on "Live Video" tab
最长运行时间Maximum run time 24 小时 x 365 天,实时线性24 hrs x 365 days, live linear 24 小时 x 365 天,实时线性(预览)24 hrs x 365 days, live linear (preview)
传递嵌入式 CEA 608/708 字幕数据的能力Ability to pass through embedded CEA 608/708 captions data Yes Yes
支持插入静态图像Support for inserting slates No No
支持通过 API 发出广告指示Support for ad signaling via API No No
支持通过带内 SCTE35 消息发出广告指示Support for ad signaling via SCTE-35 in-band messages Yes Yes
能够从贡献源出现的短时停顿中恢复Ability to recover from brief stalls in contribution feed Yes 部分Partial
支持非一致性输入 GOPSupport for non-uniform input GOPs Yes 否 – 输入必须具有固定的 GOP 持续时间No – input must have fixed GOP duration
支持可变帧率输入Support for variable frame rate input Yes 否 - 输入必须是固定的帧速率。No – input must be fixed frame rate. 轻微的帧率变化是容许的,例如在高速运动情况下出现的轻微帧率变化。Minor variations are tolerated, for example, during high motion scenes. 但是,贡献源不能降低帧速率(例如降低到 15 帧/秒)。But the contribution feed cannot drop the frame rate (for example, to 15 frames/second).
输入源丢失时,会自动关闭直播活动Auto-shutoff of Live Event when input feed is lost No 12 小时后,如果没有运行的 LiveOutputAfter 12 hours, if there is no LiveOutput running

系统预设System presets

实时编码器的输出中包含的分辨率和比特率由 presetName 确定。The resolutions and bitrates contained in the output from the live encoder are determined by the presetName. 如果使用 Standard 实时编码器 (LiveEventEncodingType.Standard),则 Default720p 预设将指定如下所述的一组 6 分辨率/比特率对。If using a Standard live encoder (LiveEventEncodingType.Standard), then the Default720p preset specifies a set of 6 resolution/bitrate pairs described below. 否则,如果使用 Premium1080p 实时编码器 (LiveEventEncodingType.Premium1080p),则 Default1080p 预设将指定分辨率/比特率对的输出集。Otherwise, if using a Premium1080p live encoder (LiveEventEncodingType.Premium1080p), then the Default1080p preset specifies the output set of resolution/bitrate pairs.

Note

如果为 Standard 实时编码设置了 Default1080p 预设,则无法将该预设应用到实时事件 - 会出现错误。You cannot apply the Default1080p preset to a Live Event if it has been setup for Standard live encoding - you will get an error. 如果尝试将 Default720p 预设应用到 Premium1080p 实时编码器,也会出现错误。You will also get an error if you try to apply the Default720p preset to a Premium1080p live encoder.

Default720p 的输出视频流Output Video Streams for Default720p

如果贡献源的分辨率为 720p 或更高,则 Default720p 预设会将源编码到以下 6 个层中。If the contribution feed is of 720p or higher resolution, the Default720p preset will encode the feed into the following 6 layers. 在下表中,比特率以 kbps 为单位,MaxFPS 表示允许的最大帧速率(帧/秒),Profile 表示使用的 H.264 配置文件。In the table below, Bitrate is in kbps, MaxFPS represents that maximum allowed frame rate (in frames/second), Profile represents the H.264 Profile used.

比特率Bitrate 宽度Width 高度Height MaxFPSMaxFPS 配置文件Profile
35003500 12801280 720720 3030 High
22002200 960960 540540 3030 High
13501350 704704 396396 3030 High
850850 512512 288288 3030 High
550550 384384 216216 3030 High
200200 340340 192192 3030 High

Note

如果需要自定义实时编码预设,请通过 Azure 门户开具支持票证。If you need to customize the live encoding preset, please open a support ticket via Azure Portal. 你应当指定所需的分辨率和比特率的表。You should specify the desired table of resolution and bitrates. 请确认只有一个 720p 的图层,最多有 6 个图层。Do verify that there is only one layer at 720p, and at most 6 layers. 此外,请务必指定你要请求 Standard 实时编码器的预设。Also do specify that you are requesting a preset for a Standard live encoder. 比特率和分辨率的特定值今后可能会调整The specific values of the bitrates and resolutions may be adjusted over time

Default1080p 的输出视频流Output Video Streams for Default1080p

如果贡献源的分辨率为 1080p,则 Default1080p 预设会将源编码到以下 6 个层中。If the contribution feed is of 1080p resolution, the Default1080p preset will encode the feed into the following 6 layers.

比特率Bitrate 宽度Width 高度Height MaxFPSMaxFPS 配置文件Profile
55005500 19201920 10801080 3030 High
30003000 12801280 720720 3030 High
16001600 960960 540540 3030 High
800800 640640 360360 3030 High
400400 480480 270270 3030 High
200200 320320 180180 3030 High

Note

如果需要自定义实时编码预设,请通过 Azure 门户开具支持票证。If you need to customize the live encoding preset, please open a support ticket via Azure Portal. 你应当指定所需的分辨率和比特率的表。You should specify the desired table of resolution and bitrates. 请务必确认只有一个层的分辨率为 1080p,且最多有 6 个层。Do verify that there is only one layer at 1080p, and at most 6 layers. 此外,请务必指定你要请求 Premium1080p 实时编码器的预设。Also do specify that you are requesting a preset for a Premium1080p live encoder. 比特率和分辨率的特定值今后可能会调整。The specific values of the bitrates and resolutions may be adjusted over time.

Default720p 和 Default1080p 的输出音频流Output Audio Stream for Default720p and Default1080p

对于 Default720pDefault1080p 预设,音频将编码到 128 kbps 的立体声 AAC-LC。For both Default720p and Default1080p presets, audio is encoded to stereo AAC-LC at 128 kbps. 采样率与贡献源中的音频轨迹采样率相同。The sampling rate follows that of the audio track in the contribution feed.

实时编码器的隐式属性Implicit properties of the live encoder

上一部分介绍了可以通过预设显式控制的实时编码器属性 - 例如层数、分辨率和比特率。The previous section describes the properties of the live encoder that can be controlled explicitly, via the preset - such as the number of layers, resolutions, and bitrates. 本部分将阐明隐式属性。This section clarifies the implicit properties.

帧组 (GOP) 持续时间Group of pictures (GOP) duration

实时编码器遵从贡献源的 GOP 结构 - 这意味着,输出层具有相同的 GOP 持续时间。The live encoder follows the GOP structure of the contribution feed - which means the output layers will have the same GOP duration. 因此,我们建议配置本地编码器,生成具有固定 GOP 持续时间(通常为 2 秒)的贡献源。Hence, it is recommended that you configure the on-premises encoder to produce a contribution feed that has fixed GOP duration (typically 2 seconds). 这可以确保服务传出的 HLS 和 MPEG DASH 流也具有固定的 GOP 持续时间。This will ensure that the outgoing HLS and MPEG DASH streams from the service also has fixed GOP durations. 大多数设备可能都会容忍 GOP 持续时间存在较小的变化。Small variations in GOP durations are likely to be tolerated by most devices.

帧速率Frame rate

实时编码器还遵从贡献源中单个视频帧的持续时间 - 这意味着,输出层的帧具有相同的持续时间。The live encoder also follows the durations of the individual video frames in the contribution feed - which means the output layers will have frames with the same durations. 因此,我们建议配置本地编码器,生成具有固定帧速率(最大 30 帧/秒)的贡献源。Hence, it is recommended that you configure the on-premises encoder to produce a contribution feed that has fixed frame rate (at most 30 frames/second). 这可以确保服务传出的 HLS 和 MPEG DASH 流也具有固定的帧速率持续时间。This will ensure that the outgoing HLS and MPEG DASH streams from the service also has fixed frame rates durations. 大多数设备可能都会容忍帧速率存在较小的变化,但不保证实时编码器生成可正常播放的输出。Small variations in frame rates may be tolerated by most devices, but there is no guarantee that the live encoder will produce an output that will play correctly. 本地实时编码器不应丢帧(例如Your on-premises live encoder should not be dropping frames (eg. 在电池电量不足的情况下),或以任何方式改变帧速率。under low battery conditions) or varying the frame rate in any way.

贡献源和输出层的分辨率Resolution of contribution feed and output layers

实时编码器的配置可避免向上转换贡献源。The live encoder is configured to avoid upconverting the contribution feed. 因此,输出层的最大分辨率不会超过贡献源的最大分辨率。As a result the maximum resolution of the output layers will not exceed that of the contribution feed.

例如,如果将 720p 的贡献源发送到为 Default1080p 实时编码配置的实时事件,则输出只包含 5 层,最前面的层的分辨率为 720p,比特率为 3 Mbps,最后面的层的分辨率为 1080p,比特率为 200 kbps。For example, if you send a contribution feed at 720p to a Live Event configured for Default1080p live encoding, the output will only have 5 layers, starting with 720p at 3Mbps, going down to 1080p at 200 kbps. 或者,如果将 360p 的贡献源发送到为 Standard 实时编码配置的实时事件,则输出将包含 3 层(分辨率分别为 288p、216p 和 192p)。Or if you send a contribution feed at 360p into a Live Event configured for Standard live encoding, the output will contain 3 layers (at resolutions of 288p, 216p, and 192p). 在退化的情况下,如果将 160x90 像素(举例而言)的贡献源发送到 Standard 实时编码器,则输出将包含一个 160x90 分辨率的层,其比特率与贡献源的比特率相同。In the degenerate case, if you send a contribution feed of, say, 160x90 pixels to a Standard live encoder, the output will contain one layer at 160x90 resolution at the same bitrate as that of the contribution feed.

贡献源和输出层的比特率Bitrate of contribution feed and output layers

无论贡献源的比特率如何,实时编码器的配置都会遵从预设中的比特率设置。The live encoder is configured to honor the bitrate settings in the preset, irrespective of the bitrate of the contribution feed. 因此,输出层的比特率可能会超过贡献源的比特率。As a result the bitrate of the output layers may exceed that of the contribution feed. 例如,如果传入一个比特率为 1 Mbps、分辨率为 720p 的贡献源,则输出层将与上表中的描述相同。For example, if you send in a contribution feed at a resolution of 720p at 1 Mbps, the output layers will remain the same as in the table above.

后续步骤Next steps

实时传送视频流概述Live streaming overview