This case explains how to set up an encoder for a standard use scenario of broadcasting a UDP multicast input source, using a multi-bitrate adaptive streaming format - HLS.
You can instantly view the resulting stream using virtually any device - iOS, Android, Smart-TV, MacOS and Windows. You can view HLS output using an embedded player from the “Output streams” menu page by clicking the output URL.
A schema of typical usage:
1. Create the video template for HLS
First, open the WEB UI of the transcoder: http://IP_address/ and login with your credentials. Then go to the “Templates” menu. You have two options here:
- Download “Reference Cloud Templates."
- Add a new template manually.
For the first option click “Get Reference Cloud Templates”, select needed templates, and click “Install selected”. The chosen templates immediately will be downloaded and installed.
To set up your own template click “Add New Template”.
Enter the template name you want and select the “Codec” for the output stream. The “Description” field is optional. Click a radio button with “Resolution” you need and specify “Bitrate” in kbit/s for your first stream in the template. If you do not want to change the FPS type "0," then type the FPS you need for the output.
Optimization can take one of seven values: "TU1"-"TU7". In most cases, it is enough to set a value between "TU7" (best speed) and "TU4" (balanced). If you set "TU1" (best quality), then the performance decreases and you will be able to set up less number of inputs (sources).
Select “Codec profile” from the dropdown list. The “Baseline” profile is more simple and universal and usually used for mobile applications; use “Main” for digital television with standard resolutions, use “High” profile for high-quality broadcasting with high resolutions and bitrates.
Select “Codec level." Recommended values are "3" or "3.1" for baseline profile, "4" or "4.1" for the main profile and "4.1"-"5.2" for the high profile.
Choose “Rate control” (constant or variable output bitrate) or leave CBR by default.
Set “B-Frames count” from "0" to "2". Use "0" for baseline profile and "1" or "2" for the main or high profiles. A large value of B-frames will decrease the encoder performance.
Set “GOP Length” in frames. The value has to be multiple to the output FPS, for HLS usually FPS*3 or FPS*4.
The Template has “Advanced Template Settings” and if you do not understand these parameters, you should leave their default values.
As soon as you are done with Stream 1, click “Add new stream” and set up the Stream 2 parameters if you need multi-bitrate adaptive HLS output stream.
We recommend sorting the streams in ascending order in terms of “Resolution” and “Bitrate."
2. Create an audio template
To create an audio template go to the “Audio templates” menu from WEB UI and click “Add New Audio Template”.
Select a codec and set «Sample rate» and «Bitrate» parameters. The recommended values are:
- Sample rate: 24000, 44100, 48000
- Bitrate: for AAC - 48, 64, 128, 192; for AAC HE - 48, 64, 128; for MP2, MP3 - 64, 128, 192
3. Setup "Default input interface"
Go to "Settings"->"Network settings" menu and choose "Default input interface" where you have input multicast. The Encoder will know where to find the multicast source.
4. Set up a source
On the “Sources” menu, click “Add New Source”.
Enter the source name.
For UDP multicast input, you have to select from the "Source" drop-down list: “UDP TS stream”.
Enter the values of the “Source address” and “Source port” for the input multicast group.
If you receive a multicast group that is not from the “Default input interface,” you have to set the IP address of the ingress interface of the server before the address of the multicast group via colon (for example 192.168.1.100:220.127.116.11).
When you have set the source address and port, you should click “Scan for available services” to get all services and tracks. Wait for a few seconds, and if there are no any error messages, you will see a window with the list of all services, which the encoder finds:
After the scanning, you will see active services from the "Service ID" drop-down list. They should have the status “on the air”. Select a service you need or choose "auto" to use the first available service:
You can select "Video PID" and "Audio PID" after choosing the Service ID. If you input multicast stream has several audio tracks, you can choose them one by one.
"Data track" (optional) allows you to select PIDs for subtitles or teletext to pass them through to output. Set "disabled" if you do not have any data tracks.
CC Passthrough (optional) – check if you want to passthrough to the output closed captions subtitles.
"Advanced Source Settings" (optional) allows to setup:
- "Interlace mode" - Use auto by default, and try other modes if you see interlace artifacts in the output signal
- "Audio Gain" - Allows to increase or decrease the source volume level in DB
- "Video Cropping" - Cropping the picture from all sides in pixels. Set by four values (pixels to crop from a side) via space - left, right, top, bottom
- "Blackmagic Device Mode" - This setting is used for BlackMagic SDI inputs only, otherwise set it to "Disabled". Select your SDI input format here
- "Backup" - Allows to set up an alternate source stream. The Encoder will migrate to this source in case the main source will be not available
- "Overlay" - Apply overlay, persistent logo/image, text or video to the source stream
5. Set up an output stream
Click on the “Output streams” menu and then “Add New Output Stream”. Type a description if you need.
Start mode – "Auto" for automatic output starting during the source start, "Manual" for manual output starting after the source will start
Channel – select a channel from the drop-down list
Template – select a template you have created for HLS output
Audio template – select an audio template
Format – choose HLSv2, HLSv3, HLSv5, HLSv7 or Advanced HLS:
- HLSv2 - HLS version 2 adaptive bitrate streaming is the oldest and most compatible for various playback platforms.
- HLSv3 - HLS version 3 adaptive bitrate streaming has very good compatibility for various playback platforms, and has several new features in comparison with version 2 (for example introducing the playlist-type (VOD, Event)).
- HLSv5 - HLS version 5 adaptive bitrate streaming provides support for multi-language, subtitles and closed captions
- HLSv7 - HLS version 7 adaptive bitrate streaming. The latest supported version of HLS protocol, provides support for session data, closed-Captions support for CEA-708, AC-3 and eAC-3 audio, supports MPEG-4 Fragmented as a container.
- Advanced HLS - an advanced type of HLS output allows you to make a HLS format «low tunning», customize HLS version, chunks location, folders and playlists naming, structure and so on.
Output – you may specify here some name, for example, the source name. In this case, the encoder takes the “OutputDir” parameter from state.dat configuration file and adds the specified name to it, building the full publication URL. The default value for the “OutputDir” parameter is http://localhost/output/. The Encoder has a built-in WebDAV server with a publishing point. If you specify for «Output URL» some full publication path to WebDAV, FTP or Samba server, like http://WebDAV_server_IP address/output_folder_name or ftp://FTP_server_IP_address/output_folder_name or \\\\SMB_server_IP_address\\output_folder_name, then “OutputDir” parameter in state.dat file will be ignored.
Advanced output settings (optional) allows to set up:
- Encryption key provider, Key provider URL, Key request interval (minutes), DRM content ID – these parameters used for content encryption only.
- Segment length – Length of one chunk (one .ts file) in seconds. The default value is 8 seconds.
6. Check HLS output
You can use built-in Web UI HLS player to check the output stream. Go to "Output streams" in the menu page and click on any running HLS output URL.
Use VLC or any other player which supports HLS on any platform to check output streams.