All Products
Search
Document Center

ApsaraVideo Live:Live stream transcoding

Last Updated:Nov 21, 2025

Live stream transcoding resolves playback issues that are caused by high or low ingest bitrates. This topic describes the scenarios, limits, features, template parameters, transcoding rules, and adaptive width of live stream transcoding.

Scenarios

  • If the ingest bitrate is high and the client bandwidth is limited, video playback may stutter. If the ingest bitrate is low, the playback quality is poor. Live stream transcoding helps you quickly resolve these issues.

  • Player plug-ins must support multi-bitrate switching. To enable bitrate switching on the frontend player, you must provide multiple streaming URLs with different bitrates for the same ingest stream. The real-time transcoding feature of ApsaraVideo Live provides this service.

    • You can ingest a stream with H.264 encoding and transcode it into an H.265 live stream in real time to reduce bandwidth usage.

    • You can ingest a stream with H.265 encoding and transcode it into a low-bitrate H.265 live stream in real time.

    • To resolve the incompatibility of H.265 in browsers, you can transcode the stream into an H.264 live stream in real time.

Important

The live stream transcoding feature incurs transcoding fees. Fees are charged based on the transcoding standard, resolution, and total transcoding length. For more information about the billing rules, see Live stream transcoding fees.

Limits

  • When you configure a transcoding template for a domain name and an AppName, you cannot set the Template Type to both Standard Template and Narrowband HDTM template in the same template.

  • If you configure a transcoding template by AppName, the template takes effect when the AppName in the ingest URL matches the AppName in the template. Sub-streaming domains reuse the transcoding templates of the primary streaming domain. Configurations for sub-streaming domains are invalid.

  • For live centers in Beijing, Shanghai, and Shenzhen, each domain name supports up to 300 concurrent transcoded streams. For other live centers, each domain name supports up to 50 concurrent transcoded streams. For example, if a high-definition (HD) live stream is ingested and transcoded into standard-definition (SD) and low-definition (LD) streams for playback, it counts as two transcoded streams. When the limit is reached, playback connections that exceed the limit play the original stream. You can go to Basic Information in the basic configuration of your streaming domain to view the current usage and increase your quota.

  • If the provided live streaming service does not meet your business requirements, you can contact your Alibaba Cloud account manager or consult us through other channels.

Features

The transcoding feature includes Default Transcoding, Custom Transcoding, Multi-bitrate Transcoding, and HTML5 Auto Transcoding.

Default Transcoding: You can reference system-preset templates, which include the template ID and the output resolution. The output bitrate is preset by the system and cannot be modified.

Custom Transcoding: You can set the encoding format, resolution, bitrate, frame rate, video GOP, transcoding trigger, and transcoding template ID.

Multi-bitrate Transcoding: A transcoding template can contain multiple transcoding configurations. After you configure multi-bitrate transcoding, the player can automatically play the live stream with the appropriate bitrate based on the network bandwidth of the client. This improves the playback experience.

HTML5 Auto Transcoding: This feature resolves issues such as the lack of support for video B-frames and AAC encoding in native browsers for Real-Time Streaming (RTS) (artc://).

System-preset templates

Template details

  • Standard templates

Transcoding template

Quality-priority template ID - H.264

Quality-first template ID - H265

Latency-priority template ID - H.264

Latency-priority template ID - H.265

Resolution

Bitrate

LD (Landscape)

lld

lld265

lld-ll

lld265-ll

Adaptive width, height: 360

≤470

SD (Landscape)

lsd

lsd265

lsd-ll

lsd265-ll

Adaptive width, height: 432

≤680

HD (Landscape)

lhd

lhd265

lhd-ll

lhd265-ll

Adaptive width, height: 648

≤1500

UHD (Landscape)

lud

lud265

lud-ll

lud265-ll

Adaptive width, height: 1080

≤2500

SD (Landscape)

lsd540

lsd265-540

lsd540-ll

lsd265-540-ll

Adaptive width, height: 540

≤680

LD (Portrait)

lld-v

lld265-v

lld-v-ll

lld265-v-ll

Width: 360, adaptive height

≤470

SD (Portrait)

lsd-v

lsd265-v

lsd-v-ll

lsd265-v-ll

Width: 432, adaptive height

≤680

HD (Portrait)

lhd-v

lhd265-v

lhd-v-ll

lhd265-v-ll

Width: 648, adaptive height

≤1500

UHD (Portrait)

lud-v

lud265-v

lud-v-ll

lud265-v-ll

Width: 1080, adaptive height

≤2500

SD (Portrait)

lsd540-v

lsd265-540-v

lsd540-v-ll

lsd265-540-v-ll

Width: 540, adaptive height

≤680

Original quality - Audio-only transcoding

oriopus

Original quality - Audio-only transcoding

oriaac

  • Narrowband HD templates

Transcoding template

Quality-priority template ID - H.264

Quality-priority template ID - H.265

Latency-priority template ID - H.264

Latency-priority template ID - H.265

Resolution

Bitrate

LD (Landscape)

ld

ld265

ld-ll

ld265-ll

Adaptive width, height: 360

≤450

SD (Landscape)

sd

sd265

sd-ll

sd265-ll

Adaptive width, height: 432

≤480

HD (Landscape)

hd

hd265

hd-ll

hd265-ll

Adaptive width, height: 648

≤1200

UHD (Landscape)

ud

ud265

ud-ll

ud265-ll

Adaptive width, height: 1080

≤1300

SD (Landscape)

sd540

sd265-540

sd540-ll

sd265-540-ll

Adaptive width, height: 540

≤480

LD (Portrait)

ld-v

ld265-v

ld-v-ll

ld265-v-ll

Width: 360, adaptive height

≤450

SD (Portrait)

sd-v

sd265-v

sd-v-ll

sd265-v-ll

Width: 432, adaptive height

≤480

HD (Portrait)

hd-v

hd265-v

hd-v-ll

hd265-v-ll

Width: 648, adaptive height

≤1200

UHD (Portrait)

ud-v

ud265-v

ud-v-ll

ud265-v-ll

Width: 1080, adaptive height

≤1300

SD (Portrait)

sd540-v

sd265-540-v

sd540-v-ll

sd265-540-v-ll

Width: 540, adaptive height

≤480

Important
  • The Template ID does not necessarily correspond to the transcoding specification on your bill. The actual transcoding specification on your bill depends on the resolution of the transcoded video. For example, if you configure LD (ld) transcoding and the resolution of the transcoded video has a short side ≤ 480 and a long side ≤ 640, the bill is generated based on the LD specification. If you configure LD (ld) transcoding but the resolution of the transcoded video is 700 × 360, the bill is generated based on the SD specification. For more information, see Live stream transcoding fees.

  • Transcoding uses an adaptive resolution algorithm. The resolution of the transcoded video is adapted based on whether the video is in landscape or portrait mode. For more information, see Adaptive resolution.

Transcoding rules

  • ApsaraVideo Live supports on-demand transcoding by default. The system monitors live transcoded streams. If no one is watching a stream, transcoding is not performed. Transcoding starts when the first viewer begins to watch the stream. If no one is watching the stream for 5 minutes during the transcoding process, transcoding stops.

  • Each transcoded stream is transcoded only once.

  • Transcoding is an optional service that you can configure as needed.

  • The transcoding feature supports the FLV, RTMP, HLS, and RTS protocols.

Adaptive resolution

Transcoding uses an adaptive resolution algorithm based on whether the video is in landscape or portrait mode.

  • For adaptive landscape transcoding, the width of the transcoded video is adapted based on the template height.

  • For adaptive portrait transcoding, the height of the transcoded video is adapted based on the template width.

The following formula describes how the adaptive width is calculated:

高度自适应

For example, if you transcode a 1920 × 1080 video using the LD landscape template (template ID: ld), the resolution has an adaptive width and a height of 360. The resolution of the transcoded video is 640 × 360.

For example, if you transcode a 1920 × 1080 video using the LD portrait template (template ID: ld-v), the resolution has a width of 360 and an adaptive height. The resolution of the transcoded video is 360 × 203.

Important

Currently, only Default Transcoding and Custom Transcoding support adaptive resolution.

Configuration

Default transcoding

You can configure default transcoding in ApsaraVideo Live in two ways:

Configure default transcoding in the console

  1. Log on to the ApsaraVideo Live console.

  2. In the navigation pane on the left, click Feature Management > Transcoding to go to the Live Stream Transcoding page.

  3. Select the domain name that you want to configure, click the Default Transcoding tab, and then click Add to configure a transcoding template.

    image

    The following table describes the parameters of the transcoding template.

    Parameter

    Description

    Application Name

    AppName matching has a priority. The system first tries to match a transcoding template with the same AppName as the ingest URL. If no such template exists, it matches a transcoding template with the AppName set to a single asterisk (*).

    Trigger Transcoding

    • Enabled: Transcoding starts only when the transcoded stream is pulled for the first time.

    • Disabled: Transcoding starts as long as there is a stream ingest, regardless of whether the stream is being pulled.

    Template Type

    • Provides Standard Transcoding and Narrowband HD™ Template. The quality, performance, and price of standard templates and Narrowband HD™ templates are different. The Standard Transcoding provides an Original quality - Audio-only transcoding template. You can select only one template type at a time.

    • You can select multiple transcoding templates at a time.

    • When you use a transcoding template, the Template ID is a parameter used to construct the transcoding URL. For more information about how to construct the URL, see Generate live streaming URLs. For more information about template IDs and other details, see System-preset templates. Transcoding modes include quality-priority and latency-priority. In latency-priority mode, the latency of the transcoded stream is lower.

    • For the same domain name, AppName and Template ID form a composite primary key.

    Encryption

    After you enable this feature, you can configure Alibaba Cloud Proprietary Cryptography or DRM Encryption.

    Note

    DRM encryption is supported only in the Shanghai and Singapore live centers.

    • Alibaba Cloud Proprietary Cryptography

      • Alibaba Cloud video encryption supports only HLS and FLV output formats.

      • KMS CMK ID: The region of the KMS key must be the same as the live center of the domain name. If you do not have a key, go to the KMS service to create one. For more information, see Purchase and enable a KMS instance.

      • CMK Rotation Period: An integer from 60 to 3600.

      • For more information about using Alibaba Cloud video encryption, see Alibaba Cloud video encryption.

    • DRM Encryption

      • Before you enable this feature, you must configure a DRM key. For more information, see Configure DRM encryption.

      • DRM encryption is supported for Widevine and FairPlay over the HLS protocol. For FairPlay, you must upload the certificate obtained from Apple in DRM Certificate Management. For more information, see Request a FairPlay certificate.

  4. After the configuration is complete, click OK.

Configure default transcoding using an API

// This file is auto-generated, don't edit it. Thanks.
package demo;

import com.aliyun.auth.credentials.Credential;
import com.aliyun.auth.credentials.provider.StaticCredentialProvider;
import com.aliyun.core.http.HttpClient;
import com.aliyun.core.http.HttpMethod;
import com.aliyun.core.http.ProxyOptions;
import com.aliyun.httpcomponent.httpclient.ApacheAsyncHttpClientBuilder;
import com.aliyun.sdk.service.live20161101.models.*;
import com.aliyun.sdk.service.live20161101.*;
import com.google.gson.Gson;
import darabonba.core.RequestConfiguration;
import darabonba.core.client.ClientOverrideConfiguration;
import darabonba.core.utils.CommonUtil;
import darabonba.core.TeaPair;

//import javax.net.ssl.KeyManager;
//import javax.net.ssl.X509TrustManager;
import java.net.InetSocketAddress;
import java.time.Duration;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.io.*;

public class AddLiveStreamTranscode {
    public static void main(String[] args) throws Exception {

        // HttpClient Configuration
        /*HttpClient httpClient = new ApacheAsyncHttpClientBuilder()
                .connectionTimeout(Duration.ofSeconds(10)) // Set the connection timeout time, the default is 10 seconds
                .responseTimeout(Duration.ofSeconds(10)) // Set the response timeout time, the default is 20 seconds
                .maxConnections(128) // Set the connection pool size
                .maxIdleTimeOut(Duration.ofSeconds(50)) // Set the connection pool timeout, the default is 30 seconds
                // Configure the proxy
                .proxy(new ProxyOptions(ProxyOptions.Type.HTTP, new InetSocketAddress("<YOUR-PROXY-HOSTNAME>", 9001))
                        .setCredentials("<YOUR-PROXY-USERNAME>", "<YOUR-PROXY-PASSWORD>"))
                // If it is an https connection, you need to configure the certificate, or ignore the certificate(.ignoreSSL(true))
                .x509TrustManagers(new X509TrustManager[]{})
                .keyManagers(new KeyManager[]{})
                .ignoreSSL(false)
                .build();*/

        // Configure Credentials authentication information, including ak, secret, token
        StaticCredentialProvider provider = StaticCredentialProvider.create(Credential.builder()
                // Please ensure that the environment variables ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET are set.
                .accessKeyId(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"))
                .accessKeySecret(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"))
                //.securityToken(System.getenv("ALIBABA_CLOUD_SECURITY_TOKEN")) // use STS token
                .build());

        // Configure the Client
        AsyncClient client = AsyncClient.builder()
                .region("<Your RegionId>") // Region ID
                //.httpClient(httpClient) // Use the configured HttpClient, otherwise use the default HttpClient (Apache HttpClient)
                .credentialsProvider(provider)
                //.serviceConfiguration(Configuration.create()) // Service-level configuration
                // Client-level configuration rewrite, can set Endpoint, Http request parameters, etc.
                .overrideConfiguration(
                        ClientOverrideConfiguration.create()
                                  // For more information about endpoints, see https://api.aliyun.com/product/live
                                .setEndpointOverride("live.aliyuncs.com")
                        //.setConnectTimeout(Duration.ofSeconds(30))
                )
                .build();

        // Parameter settings for API request
        AddLiveStreamTranscodeRequest addLiveStreamTranscodeRequest = AddLiveStreamTranscodeRequest.builder()
                .regionId("<Your RegionId>")
                .domain("<Your Domain>")
                .app("<Your App Name>")
                .template("<Your Template>")
                .encryptParameters("<Your EncryptParameters>")
                // Request-level configuration rewrite, can set Http request parameters, etc.
                // .requestConfiguration(RequestConfiguration.create().setHttpHeaders(new HttpHeaders()))
                .build();

        // Asynchronously get the return value of the API request
        CompletableFuture<AddLiveStreamTranscodeResponse> response = client.addLiveStreamTranscode(addLiveStreamTranscodeRequest);
        // Synchronously get the return value of the API request
        AddLiveStreamTranscodeResponse resp = response.get();
        System.out.println(new Gson().toJson(resp));
        // Asynchronous processing of return values
        /*response.thenAccept(resp -> {
            System.out.println(new Gson().toJson(resp));
        }).exceptionally(throwable -> { // Handling exceptions
            System.out.println(throwable.getMessage());
            return null;
        });*/

        // Finally, close the client
        client.close();
    }

}
Note
  • The preceding example configures transcoding for a live stream with the AppName <AppName>. The transcoding parameters use the system-preset template <ld>. For more information about system-preset templates, see System-preset templates in this topic.

  • setLazy("<true>") indicates that transcoding is triggered only when a stream is pulled. To trigger transcoding during stream ingest, you can set setLazy("false").

  • For more information about the API, see AddLiveStreamTranscode.

You can log on to the ApsaraVideo Live console, choose Stream Management, find the corresponding ingest record, and click Ingest/Streaming URLs in the Actions column to view the transcoded stream URL.

Note
  • The streaming URL includes the original quality (Original) URL and the transcoded stream URL.

  • You can add _Template ID after the StreamName in the original streaming URL to create a custom transcoded stream URL. For more information, see Generate live streaming URLs.

Custom transcoding

If the default transcoding templates do not meet your requirements, you can use Custom Transcoding. Custom Transcoding lets you set the encoding format, resolution, bitrate, frame rate, video GOP, transcoding trigger, and transcoding template ID.

You can configure Custom Transcoding for ApsaraVideo Live in two ways:

Configure custom transcoding in the console

  1. Log on to the ApsaraVideo Live console.

  2. In the navigation pane on the left, click Feature Management > Transcoding to go to the Live Stream Transcoding page.

  3. Select the domain name that you want to configure, click the Custom Transcoding tab, and then click Add to configure a transcoding template.image.png

    The following table describes the parameters of the transcoding template.

    Parameter

    Description

    Application Name

    AppName matching has a priority. The system first tries to match a transcoding template with the same AppName as the ingest URL. If no such template exists, it matches a transcoding template with the AppName set to a single asterisk (*).

    Template ID

    • When you use a transcoding template, the Template ID is a parameter used to construct the transcoding URL. For more information about how to construct the URL, see Generate live streaming URLs.

    • Do not set a template ID that is the same as a system-preset template. For more information about system-preset template IDs, see System-preset templates.

    • For the same domain name, AppName and Template ID form a Composite Primary Key.

    Template Type

    • The options are Standard Transcoding, Narrowband HD™ Template, and Audio-only Transcoding. The quality, performance, and price of standard templates and Narrowband HD™ templates are different.

    • The Audio-only Transcoding removes the video and outputs only the audio stream.

    Encoding Format

    H.264 and H.265 are supported.

    Recommend Parameter Settings

    Four recommended parameter sets are available: LD, SD, UHD, and HD. When you select a tier, the corresponding frame rate, bitrate, and resolution are filled with default system values. You can adjust these values as needed.

    Resolution

    The output resolution of the video in pixels. You can select a fixed resolution or have the resolution follow the source.

    Follow source: If the width and height of the source stream resolution are smaller than the adaptive dimensions, the output resolution is the same as the source. If the width and height of the source stream resolution are larger than the adaptive dimensions, the output resolution is the adaptive dimensions. You can select different adaptation methods:

    • Adaptive short side

    • Adaptive long side

    • Adaptive landscape/portrait

    Fixed resolution: The output has a specified resolution. Different resolution tiers correspond to different prices. The resolution tiers are as follows:

    • LD: (640 × 480) and below.

    • SD: (1280 × 720) and below.

    • HD: (1920 × 1080) and below.

    • 2K: (2560 × 1440) and below.

    • 4K: (3840 × 2160) and below.

    Note

    • Transcoding is billed based on the resolution tier (LD, SD, HD, 2K, 4K). The resolution tier is independent of the template IDs of standard templates (including lld, lsd, lhd, and lud) and Narrowband HD™ templates (including ld, sd, hd, and ud) in the default transcoding templates. Template IDs are used only as identifiers for business calls. Do not confuse them.

    • The console does not support custom settings for resolutions higher than 1080p. If your scenario requires 2K or 4K resolution, you can submit a ticket to request it.

      For more information about how to submit a ticket, see Contact us.

    Resolution tier determination rule: The output specification is determined by whether the long and short sides of the output video resolution fall within the range defined by the output specification.

    Take the SD (1280 × 720) output specification as an example:

    • If the long side of the output video resolution is less than or equal to 1280 and the short side is less than or equal to 720, the video belongs to this output specification.

    • If the long side of the output video is greater than 1280 or the short side is greater than 720, the output video belongs to a higher output specification.

    Video Frame Rate

    Follow source: If the frame rate is within the limit, the output frame rate is the same as the source. If it exceeds the upper limit, the upper limit is used. If it is below the lower limit, the lower limit is used.

    Fixed frame rate: The output has a specified video frame rate in FPS. The value is less than or equal to the input frame rate.

    Video Bitrate

    Follow source: If the bitrate is within the limit, the output bitrate is the same as the source. If it exceeds the upper limit, the upper limit is used. If it is below the lower limit, the lower limit is used. Output by ratio is also supported.

    Fixed bitrate: Use the specified bitrate in kbps. The bitrates specified for each resolution tier are as follows:

    • LD: 100 to 800.

    • SD: 200 to 1500.

    • HD: 500 to 4000.

    • 2K: 2000 to 8000.

    • 4K: 4000 to 30000.

    Video GOP (frames)

    The Group of Pictures (GOP) of the output video, which is the interval between two I-frames. The value must be less than or equal to the input value. To ensure low latency, it cannot be greater than 3 seconds.

    Audio Bitrate (audio-only transcoding)

    This is displayed when you set Template Type to Audio-only Transcoding Template. The unit is kbps. The value ranges from 8 to 1000.

    Profile (Audio-only transcoding)

    This is displayed when you set Template Type to Audio-only Transcoding Template.

    • LC-AAC: Low Complexity Advanced Audio Coding. High transcoding efficiency.

    • HE-AAC: High-Efficiency Advanced Audio Coding. Better sound effect than LC-AAC at low audio bitrates (usually below 128 kbps).

    Sampling Rate (Audio-only transcoding)

    This is displayed when you set Template Type to Audio-only Transcoding Template. Valid values: 22050, 32000, 44100, 48000, and 96000.

    Sound Channels (Audio-only transcoding)

    This is displayed when you set Template Type to Audio-only Transcoding Template. The number of sound tracks. Valid values: 1 or 2.

    Transcoding Mode (Advanced Configuration)

    Supports quality-priority and latency-priority. In latency-priority mode, the latency of the transcoded stream is lower.

    Trigger Transcoding (Advanced Configuration)

    • Enabled: Transcoding starts only when the stream is pulled for the first time.

    • Disabled: Transcoding starts as long as there is a stream ingest, regardless of whether the stream is being pulled.

    Video Encryption (Advanced Configuration)

    After you enable this feature, you can configure Alibaba Cloud Proprietary Cryptography or DRM Encryption.

    Note

    DRM encryption is supported only in the Shanghai and Singapore live centers.

    • Alibaba Cloud Proprietary Cryptography

      • Alibaba Cloud video encryption supports only HLS and FLV output formats.

      • KMS Master Key: The region of the KMS key must be the same as the live center of the domain name. If you do not have a key, go to the KMS service to create one. For more information, see Purchase and enable a KMS instance.

      • Key Rotation Period: An integer from 60 to 3600.

      • For more information about using Alibaba Cloud video encryption, see Alibaba Cloud video encryption.

    • DRM Encryption

      • Before you enable this feature, you must configure a DRM key. For more information, see Configure DRM encryption.

      • DRM encryption is supported for Widevine and FairPlay over the HLS protocol. For FairPlay, you must upload the certificate obtained from Apple in DRM Certificate Management. For more information, see Request a FairPlay certificate.

    All SEI Passed-through (Advanced Configuration)

    If enabled, all SEI types are passed through. If disabled, SEI is not passed through.

    Source-based Keyframe (Advanced Configuration)

    If enabled, the keyframes of the transcoded output stream are consistent with the keyframes of the original stream.

    Source-based PTS (Advanced Configuration)

    If enabled, the PTS of the transcoded output stream is consistent with the PTS of the original stream.

  4. Click OK.

Configure custom transcoding using an API

You can call the AddCustomLiveStreamTranscode API to add Custom Transcoding configuration information for a domain name and AppName.

Because the parameter settings for Custom Transcoding are complex, we recommend that you use the console together with the API to configure Custom Transcoding.

First, you can add a Custom Transcoding configuration in the console.

Note

The console provides a preview of the resolution effect and lets you quickly fill in template parameters for LD, SD, HD, and UHD.

After you adjust the parameters, you can call the DescribeLiveStreamTranscodeInfo API to query the transcoding configuration information.

Multi-bitrate transcoding

Multi-bitrate Transcoding lets you configure multiple transcoding modes in a single transcoding template. In some regions, network environments vary greatly, and network fluctuations can affect the playback experience on clients. Therefore, you need to configure multiple bitrates to match different bandwidth conditions. After you configure Multi-bitrate Transcoding, the player can automatically play the live stream with the appropriate bitrate based on the network bandwidth of the client. This improves the playback experience.

Currently, Multi-bitrate Transcoding can only be configured in the ApsaraVideo Live console.

Configure multi-bitrate transcoding in the console

  1. Log on to the ApsaraVideo Live console.

  2. In the navigation pane on the left, click Feature Management > Transcoding to go to the Live Stream Transcoding page.

  3. Select the domain name that you want to configure, click the Multi-bitrate Transcoding tab, and then click Add to add a Multi-bitrate Transcoding template group.

    1. Click Basic Information to edit the basic information of the Multi-bitrate Transcoding template group.

      多码率转码模板组-基本信息

      The following table describes the parameters:

      Parameter

      Description

      Application Name

      The AppName must match the AppName in the ingest URL for the transcoding template to take effect. For the same domain name, AppName and Template Group ID form a Composite Primary Key.

      Template Group ID

      The ID of the transcoding template group. The template group ID is a parameter used to construct the Multi-bitrate Transcoding URL. It can contain up to 10 characters, including digits, uppercase and lowercase letters, and hyphens.

      Container Format

      Currently, only HLS is supported.

      Trigger Transcoding

      Currently, transcoding can only be triggered by stream ingest. This incurs transcoding fees. Triggering transcoding by stream pulling is not supported.

      Timestamp Alignment

      If enabled, the GOP setting for each template is disabled, and the GOP of the source video is used.

    2. Click + Add to add a template.image

      Click the added template to edit its parameters. The parameters that you need to fill in may vary depending on the template type. The following table describes the parameters:

      Parameter

      Description

      Template ID

      The ID of a single template within the transcoding template group. Template IDs within the same template group must be unique.

      Template Type

      Standard Transcoding, Narrowband HD™ Template, and Audio-only Transcoding.

      The Audio-only Transcoding removes the video and outputs only the audio stream.

      Resolution

      The output resolution of the video in pixels. Different resolution tiers correspond to different prices. The resolution tiers are as follows:

      • LD: (640 × 480) and below.

      • SD: (1280 × 720) and below.

      • HD: (1920 × 1080) and below.

      • 2K: (2560 × 1440) and below.

      • 4K: (3840 × 2160) and below.

      Note

      Transcoding is billed based on the resolution tier (LD, SD, HD, 2K, 4K). This is independent of the template IDs of standard templates (including lld, lsd, lhd, and lud) and Narrowband HD™ template IDs (including ld, sd, hd, and ud) in the default transcoding templates. Do not confuse them.

      Resolution tier determination rule: The output specification is determined by whether the long and short sides of the output video resolution fall within the range defined by the output specification.

      Take the SD (1280 × 720) output specification as an example:

      • If the long side of the output video resolution is less than or equal to 1280 and the short side is less than or equal to 720, the video belongs to this output specification.

      • If the long side of the output video is greater than 1280 or the short side is greater than 720, the output video belongs to a higher output specification.

      Video Bitrate

      The bitrate used for the specified Resolution, in kbps. The bitrates specified for each resolution tier are as follows:

      • LD: 100 to 800.

      • SD: 200 to 1500.

      • HD: 500 to 4000.

      • 2K: 2000 to 8000.

      • 4K: 4000 to 30000.

      Video Frame Rate

      The output video frame rate in FPS. The value is less than or equal to the input frame rate.

      Video GOP (frames)

      The Group of Pictures (GOP) of the output video, which is the interval between two I-frames. The value must be less than or equal to the input value. To ensure low latency, it cannot be greater than 3 seconds.

      Encoding Format

      Currently, only the AAC encoding format is supported.

      Profile (Audio-only transcoding)

      • LC-AAC: Low-Complexity Advanced Audio Coding. Offers high transcoding efficiency.

      • HE-AAC: High-Efficiency Advanced Audio Coding. Offers better audio quality than LC-AAC at low audio bitrates (typically below 128 kbps).

      Bitrate (Audio-only transcoding)

      The audio bitrate. The value ranges from 8 to 1000.

      Sound Channels (Audio-only transcoding)

      The number of sound tracks. Valid values: 1 or 2.

      Maximum Bandwidth

      An integer or decimal from 100 Kbps to 100 Mbps, with up to two decimal places. We recommend setting this to 1.2 to 1.5 times the video bitrate.

  4. After the configuration is complete, click OK.

Important
  • Currently, Multi-bitrate Transcoding streams can provide only HLS transcoded stream URLs.

  • To play a Multi-bitrate Transcoding stream, you must add the aliyunols=on parameter. aliyunols=on is a required fixed field.

The following is an example URL:

http://<DomainName>/<AppName>/<StreamName>_<Template Group ID>.m3u8?aliyunols=on&auth_key=1234****

The following example shows how to use Multi-bitrate Transcoding in a real-world scenario:

For example, you can add a Multi-bitrate Transcoding configuration as shown in the following figure.

image

Note

In this template group, four levels of transcoding configurations are customized. For information about the parameter values for different levels, see System-preset templates in this topic.

Then, you can ingest the stream and use the web-based ApsaraVideo Player for playback. During debugging, you can see that the player automatically plays the transcoded stream with the appropriate bitrate based on the network bandwidth of the client.

image

Note

For more information about using ApsaraVideo Player, see Player SDK.

H5 automatic transcoding

Real-Time Streaming (RTS) is based on Web Real-Time Communication (WebRTC) signaling. Native browser WebRTC does not support video B-frames or AAC encoding. H5 automatic transcoding provides adaptive transcoding to ensure smooth playback.

You can enable H5 automatic transcoding when you activate RTS. For more information, see Step 5: Activate the RTS feature.

Note
  • H5 automatic transcoding is used to handle issues such as video B-frames and AAC encoding in native browser RTS (artc://). To transcode video content, such as by adjusting the bitrate, frame rate, or resolution, you still need to configure it through Default transcoding or Custom Transcoding.

  • H5 automatic transcoding can be used in conjunction with Default transcoding or Custom Transcoding.

  • When you use H5 automatic transcoding, fees for audio-only transcoding are incurred. For more information, see Live stream transcoding fees.

Video encryption

When you configure Default transcoding or Custom Transcoding, you may notice video encryption-related fields. You can implement the Alibaba Cloud Proprietary Cryptography feature through the transcoding configuration. For more information about the Alibaba Cloud video encryption feature and how to implement it, see Alibaba Cloud video encryption.

References

For more information about transcoding-related APIs, see Live stream transcoding.

For more information about using the Java SDK, see Java SDK guide.