Transcoding

You can transcode live streams into video streams with different resolutions and bitrates to meet a broad range of requirements. Live provides two types of transcoding templates: system presets and custom templates. After transcoding is configured, transcoding is enabled when stream pushing starts.

Figure 1 Transcoding architecture

Function Overview

The transcoding function helps you solve the following problems:

  • Incompatible with certain playback devices. You can transcode source audio and video to one or more formats for playback on a wide range of devices.
  • Unsuitable for different network environments. You can set the output bitrate based on the network bandwidth.
  • High distribution costs. H.265 codec and low bitrate HD can reduce the bitrate by about 20% without changing the resolution, thereby cutting down the distribution costs of live streams.
There are two types of transcoding templates: system presets and custom templates. Both templates support low bitrate HD.
  • System presets: You can select a standard template (LD, SD, HD, or UHD) or low bitrate HD template.
  • Custom templates: You can customize the template ID, resolution, bitrate, and frame rate. If the presets cannot meet your requirements, create a custom transcoding template.

Notes

  • You can configure multiple transcoding templates for one domain name. After stream pushing starts, a transcoding template in which AppName is the same as that in the ingest URL takes effect. If you do not need transcoding, delete the transcoding template before stream pushing
  • The low bitrate HD function is disabled by default. If you enable it, you will be charged based on the rates of low bitrate HD. For details about the price, see Live Pricing Details.
  • Upsampling is not supported. If the resolution set in a transcoding template is higher than source resolution, the video can be played, but the resolution of the played video is source resolution.

Prerequisites

  • Domain names have been added.
  • CNMAE records have been added to your domains' DNS records.

Pricing Notes

The transcoding function is a billing item. You are charged based on a combination of the codec, output resolution, and length of an output video. Standard transcoding and transcoding with low bitrate HD are billed differently. For details about the transcoding output resolution, see the Video Transcoding area in Live Pricing Details. If you use transcoding a lot, you are advised to buy a transcoding package, which is more economical.

Creating a Transcoding Template

You can configure a system preset or custom template on the Live console or by calling a Live API. If you want to play transcoded live TV streams, obtain a transcoded streaming URL. For details, see Transcoded Streaming URL.

  1. Log in to the Live console.
  2. In the navigation pane, choose Domains.
  3. Click Settings in the row containing the target ingest domain name.
  4. In the navigation pane, choose Template Settings > Transcoding to view the transcoding template information.
  5. Click Create Template. A page like Figure 2 is displayed.

    Figure 2 Creating a transcoding template

  6. Set transcoding parameters. Table 1 describes the parameters.

    Table 1 Template parameters

    Area

    Parameter

    Description

    Basic Info

    App Name

    Application name. The default value is live. You can customize the application name. Only letters, digits, underscores (_), and hyphens (-) are allowed.

    Video Coding

    There are two options: H.264 and H.265.

    Low Bitrate HD

    Low bitrate HD means that the output bitrate is lower 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 Pricing Details.

    Preset Transcoding Templates

    Quality

    There are four options: LD, SD, HD, and UHD. Table 2 lists the resolutions and bitrates at different image qualities.

    Custom Transcoding Templates

    Template ID

    Used for assembling a streaming URL. For details, see Assembling a Streaming URL.

    Resolution (Width x Height)

    Width and height of a video, in pixels. If the width and height are both set to 0, the resolution of an output video is the same as that of the input video. If only one item is set, the other item is autofilled.

    Value range:

    • Width: 32–3,840. The value must be a multiple of 2 or 0.
    • Height: 32–3,840. The value must be a multiple of 2 or 0.

    Bitrate (Unit: kbit/s)

    Average bitrate of a live stream

    Value range: 40 to 30,000

    Frame Rate (Unit: FPS)

    The value ranges from 0 to 60. If it is set to 0, it indicates auto-adaption.

    Table 2 Resolution and bitrate settings in the presets

    Video Quality

    Resolution

    Bitrate (kbit/s)

    LD

    640 x 360

    400

    SD

    854 x 480

    600

    HD

    1280 x 720

    1000

    UHD

    1920 x 1080

    2000

  7. Click Add.

    As shown in Figure 3, the added template is displayed in the template list.

    Figure 3 New transcoding template

  8. Obtain a transcoded streaming URL if you need to stream your video via a transcoded streaming URL. For details, see Transcoded Streaming URL.

Transcoding Template Management

You can perform the following operations on your transcoding template:

  • Edit a transcoding template.

    Click Edit in the Operation column to modify parameters in the template. The value of AppName cannot be changed.

    Figure 4 Editing a transcoding template
  • Delete a transcoding template.

    Click Delete in the Operation column.

    Figure 5 Deleting a transcoding template