Creating a Transcoding Template
You can transcode livestreams into video streams with different resolutions and bitrates to meet a broad range of requirements. You can customize a transcoding template. When a channel is created, a transcoding template is configured. When channel content is played, transcoding is performed based on the transcoding template.
Function Overview
The transcoding function allows you to:
- Transcode source audio and video into one or more formats for playback on a wide range of devices.
- Adapt the output bitrate to different network bandwidths.
- Reduce the costs of distributing livestreams. Low-bitrate HD can reduce the bitrate usage by about 20% at the same resolution.
- Customize transcoding templates, such as the transcoding type, video bitrate, resolution, frame rate, and GOP duration.
Notes
- To delete a transcoding template, you need to manually delete it from all channels. Otherwise, the transcoding template still takes effect on the channels.
- The transcoding template of a channel takes effect when the channel playback starts. If the transcoding configuration is modified, the modification takes effect only after the channel is restarted.
- If you enable low-bitrate HD, you will be charged based on the rates of low-bitrate HD. For details about the price, see Live Pricing Details.
- Upsampling transcoding is not supported. If the resolution set in the transcoding template is higher than the original resolution, the transcoded streaming URL can be used for playback, but the played video still uses the original resolution.
- In the AP-Bangkok region, submit a service ticket for review after configuring a template. The configuration takes effect only after it is approved.
Prerequisites
- An ingest domain name has been added.
- CNAME records have been added to your domains' DNS records.
Adding a Media Live Transcoding Template
You can add a Media Live transcoding template on the Live console.
- Log in to the Live console.
- In the navigation pane on the left, choose Media Live > Live Transcoding.
- Click Create Transcoding Template. A page like Figure 1 is displayed.
Configure transcoding parameters as instructed by Table 1.
Table 1 Template parameters Parameter
Description
Template Name
Name of a Media Live transcoding template.
You can customize the name. Only letters, digits, underscores (_), and hyphens (-) are allowed.
Triggered By
Transcoding is triggered by stream push. When a transcoding request is received, the transcoding template whose name is the same as the value of AppName in the request URL takes effect and transcoding starts.
Transcoding Type
Transcoding type of Media Live.
Options:
- Standard transcoding
- Low-bitrate HD
For the same resolution, low-bitrate HD transcoding consumes 20% less bitrate than standard transcoding but costs more.
Low-bitrate HD means a lower output bitrate at a given image quality. If you enable this option, you will be billed based on the rates of low-bitrate HD. For details, see Live Pricing Details.
Video Encoding
Supported video encoding formats:
- H.264
- H.265
NOTICE:
- Select only one encoding format for each channel.
Recommended Resolution
Display resolution.
After the resolution level is selected, the Video Bitrate and Resolution (W x H) parameters are automatically set and the recommended values are provided. You can also change the values as needed.
Video Bitrate
Average bitrate of the transcoded video, in kbit/s.
Value range: 40 to 30,000
Bitrate Control
Bitrate control policy.
Options:
- Disabled: Bitrate adaptation is disabled. The target bitrate is output as specified.
- Not higher than source stream: The target bitrate is the smaller value between the specified bitrate and the bitrate of the source file. That is, the bitrate does not increase.
- Adaptive to source stream: The target bitrate is adaptive to the bitrate of the source file.
Resolution (W x H)
Width and height of the video, in pixel.
If both the width and height are set to 0, the output resolution is the same as the source resolution. If only the width or height is set to 0, the output resolution will be scaled based on the value of the side that is not set to 0.
Value range:
- Width: 32 to 3,840. The value must be 0 or a multiple of 2.
- Height: 32 to 3,840. The value must be 0 or a multiple of 2.
Video Frame Rate
Frame rate of the transcoded video.
Options:
- Retain the original
- Set a new one: If you select this option, you need to enter the frame rate. The value ranges from 0 to 60. If the value is set to 0, the frame rate is adaptive.
Use Source I-Frame
Policy for outputting I-frames during encoding. Enable this function for Media Live.
Options:
- If this function is disabled, I-frames are output based on the configured GOP duration.
- If this function is enabled, the output I-frames are the same as those of the source. That is, if the source contains I-frames, I-frames are output after encoding. If the source does not contain I-frames, non-I-frames are output after encoding.
If this function is enabled, the GOP duration setting is invalid. For multi-bitrate transcoding, you are advised to enable Use Source I-Frame so that videos of different bitrates can have the same I-frame.
GOP Duration
I-frame interval by time, in second.
The value ranges from 0 to 10 and defaults to 2.
If the value is not 0, the I-frame interval is set based on the GOP duration. If the value is 0, the default value is used.
A larger GOP duration value indicates a longer livestreaming latency. A smaller GOP duration value indicates a higher probability of frame freezing.
B-Frame Removal
After this function is enabled, the transcoded video does not contain B-frames.
- Click OK.
A transcoding template is added on the live transcoding page.
Managing Transcoding Templates
You can perform the following operations on your transcoding template:
- Editing a transcoding template
Click Edit in the Operation column to modify parameters in the template. If the channel where the transcoding template is located has been started, you need to restart the channel for the modification to take effect. It takes about 30 seconds to restart the channel. During the channel restart, transcoding will be interrupted. After the channel is restarted, transcoding automatically resumes.
- Deleting a transcoding template
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot