使用 Haivision KB 实时编码器发送单比特率实时流Use the Haivision KB live encoder to send a single bitrate live stream

本主题说明如何配置 Haivision KB 实时编码器,以便将单比特率流发送到用于实时编码的 AMS 频道。This topic shows how to configure the Havision KB live encoder encoder to send a single bitrate stream to AMS channels that are enabled for live encoding. 有关详细信息,请参阅使用能够通过 Azure 媒体服务执行实时编码的频道For more information, see Working with Channels that are Enabled to Perform Live Encoding with Azure Media Services.

本教程演示了如何通过 Azure 媒体服务浏览器 (AMSE) 工具管理 Azure 媒体服务 (AMS)。This tutorial shows how to manage Azure Media Services (AMS) with Azure Media Services Explorer (AMSE) tool. 此工具仅在 Windows 电脑上运行。This tool only runs on Windows PC. 如果使用的是 Mac 或 Linux,则可使用 Azure 门户创建频道节目If you are on Mac or Linux, use the Azure portal to create channels and programs.

先决条件Prerequisites

提示Tips

  • 尽可能使用硬编码的 Internet 连接。Whenever possible, use a hardwired internet connection.
  • 确定带宽要求时,可以认为它就是将流式处理比特率翻倍。A good rule of thumb when determining bandwidth requirements is to double the streaming bitrates. 虽然此要求不是强制性要求,但它可以减轻网络拥塞的影响。While this is not a mandatory requirement, it helps mitigate the impact of network congestion.
  • 使用基于软件的编码器时,请关闭任何不需要的程序。When using software-based encoders, close out any unnecessary programs.

创建频道Create a channel

  1. 在 AMSE 工具中,导航到“实时”选项卡,并右键单击频道区域。In the AMSE tool, navigate to the Live tab, and right-click within the channel area. 从菜单中选择“创建频道…” Select Create channel… from the menu. HaivisionHaivision
  2. 指定频道名称,说明字段为选填字段。Specify a channel name, the description field is optional. 在“频道设置”下针对“实时编码”选项选择“标准”,将“输入协议”设置为“RTMP”。Under Channel Settings, select Standard for the Live Encoding option, with the Input Protocol set to RTMP. 所有其他设置可保留原样。You can leave all other settings as is. 确保选中“立即启动新频道” 。Make sure the Start the new channel now is selected.
  3. 单击“创建频道” 。Click Create Channel. HaivisionHaivision

备注

启动频道可能需要长达 20 分钟的时间。The channel can take as long as 20 minutes to start.

配置 Haivision KB 编码器Configure the Haivision KB encoder

在本教程中,将使用以下输出设置。In this tutorial, the following output settings are used. 本部分的其余内容介绍更详细的配置步骤。The rest of this section describes configuration steps in more detail.

视频:Video:

  • 编解码器:H.264Codec: H.264
  • 配置文件:高(级别 4.0)Profile: High (Level 4.0)
  • 比特率:5000 kbpsBitrate: 5000 kbps
  • 关键帧:2 秒(60 帧)Keyframe: 2 seconds (60 frames)
  • 帧速率:30Frame Rate: 30

音频:Audio:

  • 编解码器:AAC (LC)Codec: AAC (LC)
  • 比特率:192 kbpsBitrate: 192 kbps
  • 采样率:44.1 kHzSample Rate: 44.1 kHz

配置步骤Configuration steps

  1. 登录到 Haivision KB 用户界面。Log in to the Haivision KB user interface.
  2. 单击频道控制中心的“菜单按钮”,然后选择“添加频道” Click on the Menu Button in the channel control center and select Add Channel
    2017-08-14 上午 9:15:09 屏幕截图Screenshot 2017-08-14 at 9.15.09 AM
  3. 在“名称”字段中键入“频道名”,然后单击“下一步”。Type the Channel Name in the Name field and click next.
    2017-08-14 上午 9:19:07 屏幕截图Screenshot 2017-08-14 at 9.19.07 AM
  4. 从“输入源”下拉列表中选择“频道输入源”,然后单击“下一步” 。Select the Channel Input Source from the Input Source drop-down and click next. 2017-08-14 上午 9:20:44 屏幕截图Screenshot 2017-08-14 at 9.20.44 AM
  5. 从“编码器模板”下拉列表中选择“H264-720-AAC-192”,然后单击“下一步” 。From the Encoder Template drop-down choose H264-720-AAC-192 and click next. 2017-08-14 上午 9:23:15 屏幕截图Screenshot 2017-08-14 at 9.23.15 AM
  6. 从“选择新输出”下拉列表中选择“RTMP”,然后单击“下一步” 。From the Select New Output drop-down choose RTMP and click next.
    2017-08-14 上午 9:27:51 屏幕截图Screenshot 2017-08-14 at 9.27.51 AM
  7. 在“频道输出”窗口,填充 Azure 流信息。From the Channel Output window, populate the Azure stream information. 粘贴“服务器”区域中初始频道设置中的 RTMP 链接 。Paste the RTMP link from the initial channel setup in the Server area. 在“输出名”区域键入频道名。In the Output Name area type in the name of the channel. 在“流名称模板”区域中,使用模板 RTMPStreamName_%video_bitrate% 命名流。In the Stream Name Template area, use the template RTMPStreamName_%video_bitrate% to name the stream. 2017-08-14 上午 9:33:17 屏幕截图Screenshot 2017-08-14 at 9.33.17 AM
  8. 单击“下一步”,然后单击“完成”。Click next and then click Done.
  9. 单击“播放按钮”启动编码器频道。Click the Play Button to start the encoder channel.
    Haivision KB.pngHaivision KB.png

测试播放Test playback

导航回 AMSE 工具,并右键单击要测试的频道。Navigate to the AMSE tool, and right-click the channel to be tested. 在菜单中,将鼠标悬停在“播放预览”上方,然后选择“使用 Azure 媒体播放器”。From the menu, hover over Playback the Preview and select with Azure Media Player.

如果流出现在播放器中,则编码器已正确配置,可以连接到 AMS。If the stream appears in the player, then the encoder has been properly configured to connect to AMS.

如果收到错误,则需重置频道并调整编码器设置。If an error is received, the channel needs to be reset and encoder settings adjusted. 有关指南,请参阅《疑难解答》一文。See the troubleshooting article for guidance.

创建节目Create a program

  1. 确认频道可以播放后,即可创建节目。Once channel playback is confirmed, create a program. 在 AMSE 工具的“实时”选项卡下,右键单击节目区域,并选择“创建新节目”。Under the Live tab in the AMSE tool, right-click within the program area and select Create New Program. HaivisionHaivision
  2. 为节目命名,并根据需要调整“存档时段长度”(默认为 4 小时)。Name the program and, if needed, adjust the Archive Window Length (which defaults to four hours). 还可以指定存储位置,也可以将其保留为默认值。You can also specify a storage location or leave as the default.
  3. 选中“立即启动节目”框。Check the Start the Program now box.
  4. 单击“创建节目”。Click Create Program.
  5. 运行节目以后,可通过下述方式来确认其是否能够播放:右键单击该节目,导航到“播放节目”,并选择“使用 Azure Media Player”。Once the program is running, confirm playback by right-clicking the program and navigating to Play back the program(s) and then selecting with Azure Media Player.
  6. 确认以后,再次右键单击该节目,然后选择“将输出 URL 复制到剪贴板”(也可通过菜单从“节目信息和设置”选项检索此信息)。Once confirmed, right-click the program again and select Copy the Output URL to Clipboard (or retrieve this information from the Program information and settings option from the menu).

现在可以将流嵌入到播放器中,也可将其分发给受众进行实时观看。The stream is now ready to be embedded in a player, or distributed to an audience for live viewing.

备注

创建节目需要的时间比创建频道需要的时间少。Program creation takes less time than channel creation.