使用自动生成的比特率阶梯进行编码Encode with an auto-generated bitrate ladder

概述Overview

本文介绍了如何基于输入分辨率和比特率,使用媒体服务中的标准编码器将输入视频编码为自动生成的比特率阶梯(比特率-分辨率对)。This article explains how to use the Standard Encoder in Media Services to encode an input video into an auto-generated bitrate ladder (bitrate-resolution pairs) based on the input resolution and bitrate. 此内置编码器设置或预设绝不会超过输入分辨率和比特率。This built-in encoder setting, or preset, will never exceed the input resolution and bitrate. 例如,如果输入在 3 Mbps 时为 720p,则输出最多会保持 720p,并且会以低于 3 Mbps 的速率开始。For example, if the input is 720p at 3 Mbps, output remains 720p at best, and will start at rates lower than 3 Mbps.

编码用于流式处理Encoding for streaming

在“转换”中使用“AdaptiveStreaming”预设时,会获取适合通过流式处理协议(例如 HLS 和 DASH)传递的输出 。When you use the AdaptiveStreaming preset in Transform, you get an output that is suitable for delivery via streaming protocols like HLS and DASH. 使用此预设时,此服务可智能地确定要生成的视频层数,并确定比特率和分辨率。When using this preset, the service intelligently determines how many video layers to generate and at what bitrate and resolution. 输出内容包含 MP4 文件,其中无 AAC 编码的音频和 H.264 编码的视频交错。The output content contains MP4 files where AAC-encoded audio and H.264-encoded video is not interleaved.

若要查看有关如何使用此预设的示例,请参阅流式传输文件To see an example of how this preset is used, see Stream a file.

输出Output

此部分显示媒体服务编码器生成的输出视频层的三个示例,是使用“AdaptiveStreaming”预设进行编码得来的 。This section shows three examples of the output video layers produced by the Media Services encoder as a result of encoding with the AdaptiveStreaming preset. 在所有情况下,输出包含仅音频 MP4 文件,其中立体声音频以 128 kbps 进行编码。In all cases, the output contains an audio-only MP4 file with stereo audio encoded at 128 kbps.

示例 1Example 1

高度为“1080”,帧速率为“29.970”的源生成 6 个视频层:Source with height "1080" and framerate "29.970" produces 6 video layers:

Layer 高度Height 宽度Width 比特率 (kbps)Bitrate (kbps)
11 10801080 19201920 67806780
22 720720 12801280 35203520
33 540540 960960 22102210
44 360360 640640 11501150
55 270270 480480 720720
66 180180 320320 380380

示例 2Example 2

高度为“720”,帧速率为“23.970”的源生成 5 个视频层:Source with height "720" and framerate "23.970" produces 5 video layers:

Layer 高度Height 宽度Width 比特率 (kbps)Bitrate (kbps)
11 720720 12801280 29402940
22 540540 960960 18501850
33 360360 640640 960960
44 270270 480480 600600
55 180180 320320 320320

示例 3Example 3

高度为“360”,帧速率为“29.970”的源生成 3 个视频层:Source with height "360" and framerate "29.970" produces 3 video layers:

Layer 高度Height 宽度Width 比特率 (kbps)Bitrate (kbps)
11 360360 640640 700700
22 270270 480480 440440
33 180180 320320 230230

后续步骤Next steps