Use the Haivision KB live encoder to send a single bitrate live stream
Warning
Update your Azure Media Services REST API and SDKs to v3 by 29 February 2024. Version 3 of Azure Media Services REST API and client SDKs for .NET and Java offers more capabilities than version 2. We’re retiring version 2 of the Azure Media Services REST API and client SDKs for .NET and Java.
Action Required: To minimize disruption to your workloads, review the migration guide to transition your code from the version 2 API and SDKs to version 3 API and SDK before February 29th, 2024. After February 29th, 2024, Azure Media Services will no longer accept traffic on the version 2 REST API, the ARM account management API version 2015-10-01, or from the version 2 .NET client SDKs. This includes any 3rd party open-source client SDKS that may call the version 2 API. Learn about the latest version, starting with the Media Services v3 Overview.
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. For more information, see Working with Channels that are Enabled to Perform Live Encoding with Azure Media Services.
This tutorial shows how to manage Azure Media Services (AMS) with Azure Media Services Explorer (AMSE) tool. This tool only runs on Windows PC. If you are on Mac or Linux, use the Azure portal to create channels and programs.
Prerequisites
- Access to a Haivision KB encoder, running SW v5.01, or greater.
- Create an Azure Media Services account
- Ensure there is a Streaming Endpoint running. For more information, see Manage Streaming Endpoints in a Media Services Account
- Install the latest version of the AMSE tool.
- Launch the tool and connect to your AMS account.
Tips
- 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
- In the AMSE tool, navigate to the Live tab, and right-click within the channel area. Select Create channel… from the menu. Haivision
- Specify a channel name, the description field is optional. 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.
- Click Create Channel. Haivision
Note
The channel can take as long as 20 minutes to start.
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:
- Codec: H.264
- Profile: High (Level 4.0)
- Bitrate: 5000 kbps
- Keyframe: 2 seconds (60 frames)
- Frame Rate: 30
Audio:
- Codec: AAC (LC)
- Bitrate: 192 kbps
- Sample Rate: 44.1 kHz
Configuration steps
- Log in to the Haivision KB user interface.
- Click on the Menu Button in the channel control center and select Add Channel
- Type the Channel Name in the Name field and click next.
- Select the Channel Input Source from the Input Source drop-down and click next.
- From the Encoder Template drop-down choose H264-720-AAC-192 and click next.
- From the Select New Output drop-down choose RTMP and click next.
- From the Channel Output window, populate the Azure stream information. 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. In the Stream Name Template area, use the template RTMPStreamName_%video_bitrate% to name the stream.
- Click next and then click Done.
- Click the Play Button to start the encoder channel.
Test playback
Navigate to the AMSE tool, and right-click the channel to be tested. From the menu, hover over Playback the Preview and select with Azure Media Player.
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
- Once channel playback is confirmed, create a program. Under the Live tab in the AMSE tool, right-click within the program area and select Create New Program. Haivision
- 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.
- Check the Start the Program now box.
- Click Create Program.
- 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.
- 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.
Note
Program creation takes less time than channel creation.