Updated on 2026-04-22 GMT+08:00

Querying Transcoding Templates

Function

This API is used to query transcoding templates.

Calling Method

For details, see Calling APIs.

URI

GET /v1/{project_id}/template/transcodings

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

domain

Yes

String

Definition

Domain name.

Constraints

N/A

Range

Length: 1 to 255 characters

Default Value

N/A

app_name

No

String

Definition

Application name.

Constraints

N/A

Range

Length: 0 to 128 characters

Default Value

N/A

page

No

Integer

Definition

Page number.

Constraints

N/A

Value range:

≥0

Default value:

0

size

No

Integer

Definition

Number of records on each page.

Constraints

N/A

Value range:

1~100

Default value:

10

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

No

String

User token. This parameter is mandatory when token authentication is used. The token can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Authorization

No

String

Authentication information. This parameter is mandatory for AK/SK authentication.

X-Sdk-Date

No

String

Time when the request is sent. This parameter is mandatory for AK/SK authentication.

X-Project-Id

No

String

Project ID. This parameter is mandatory for AK/SK authentication.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total

Integer

Definition

Number of applications in the query result.

Range

N/A

domain

String

Definition

Ingest domain name.

Range

Length: 1 to 255 characters

templates

Array of AppQualityInfo objects

Definition

Transcoding template.

Table 5 AppQualityInfo

Parameter

Type

Description

app_name

String

Definition

Application name.

Range

Length: 1 to 128 characters

quality_info

Array of QualityInfo objects

Definition

Video quality information.

Table 6 QualityInfo

Parameter

Type

Description

quality

String

Definition

Transcoding specifications.

Constraints

If you set this parameter to userdefine, the templateName field cannot be empty.

Range

  • lud: ultra HD (default name)

  • lhd: HD (default name)

  • lsd: SD (default name)

  • lld: smooth (default name)

  • userdefine: custom video quality If you set this parameter to userdefine, the templateName field cannot be empty.

Default Value

N/A

templateName

String

Definition

Custom template name.

Constraints

  • The name of a custom template can contain a maximum of 32 characters.

  • To customize a template name, set quality to userdefine.

  • The name of each custom template must be unique.

  • A custom template cannot have the same quality settings as any another templates.

  • If quality is not set to userdefine, do not set this parameter.

Range

Length: 0 to 32 characters

Default Value

N/A

PVC

String

Definition

Indicates whether to use narrowband HD transcoding.

Constraints

Note: This field is no longer used. Use hdlb instead.

Range

  • off: disabled

  • on: enabled

Default value:

off

hdlb

String

Definition

Indicates whether to enable low-bitrate HD transcoding. It provides superior image quality compared to PVC.

Constraints

When the hdlb field is used to enable low-bitrate HD, the PVC field does not take effect.

Range

  • off: Low-bitrate HD is disabled.

  • on: Low-bitrate HD is enabled.

Default value:

off

codec

String

Definition

Video encoding format.

Constraints

N/A

Range

  • H264: H.264 is used.

  • H265: H.265 is used.

Default value:

H264

width

Integer

Definition

Long side of the video. For landscape orientation, the width is the long side. For portrait orientation, the height is the long side. Unit: pixel.

Constraints

If both width and height are set to 0, the output resolution matches the input. If either width or height is set to 0, the output video is scaled proportionally based on the specified dimension.

Range

  • When codec is set to H264, the recommended width ranges from 32 to 3840, and the value must be a multiple of 2.

  • When codec is set to H265, the recommended width ranges from 320 to 3840, and the value must be a multiple of 2.

Default Value

0

height

Integer

Definition

Short side of the video. For landscape orientation, the width is the long side. For portrait orientation, the height is the short side. Unit: pixel.

Constraints

If both width and height are set to 0, the output resolution matches the input. If either width or height is set to 0, the output video is scaled proportionally based on the specified dimension.

Range

  • When codec is set to H264, the recommended height ranges from 32 to 2160, and the value must be a multiple of 2.

  • When codec is set to H265, the recommended height ranges from 240 to 2160, and the value must be a multiple of 2.

Default Value

0

bitrate

Integer

Definition

Bitrate of the transcoded video. Unit: kbit/s.

Constraints

N/A

Range

40 to 30000

Default Value

N/A

video_frame_rate

Integer

Definition

Frame rate of the transcoded video. Unit: FPS

Constraints

N/A

Range

0 to 60. The value 0 indicates that the frame rate remains unchanged.

Default Value

0

protocol

String

Definition

Protocol supported by transcoded outputs.

Constraints

Currently, only RTMP is supported.

Range

  • RTMP

Default value:

RTMP

iFrameInterval

Integer

Definition

Maximum I-frame interval, in frames.

Constraints

To set the I-frame interval using iFrameInterval, set gop to 0.

Range

0 to 500

Default Value

50

gop

Integer

Definition

I-frame interval, in seconds.

Constraints

If gop is not 0, the I-frame interval is set based on gop, and the iFrameInterval field does not take effect.

Default Value

2

Value range:

0~10

bitrate_adaptive

String

Definition

Adaptive bitrate parameter.

Constraints

N/A

Range

  • off: Adaptive bitrate is disabled. The output will follow the configured target bitrate.

  • minimum: The output bitrate is the smaller one between the target bitrate and the source bitrate (ensuring no bitrate up-conversion).

  • adaptive: The output bitrate dynamically adapts to the source bitrate.

Default Value

off

i_frame_policy

String

Definition

Policy for outputting I-frames during encoding.

Constraints

For multi-bitrate transcoding, you are advised to use strictSync so outputs at different bitrates share the same I-frame positions.

Range

  • auto: I-frames are output based on the configured GOP duration.

  • strictSync: Output I-frames are strictly aligned with the source. If a source frame is an I-frame, it is encoded as an I-frame. If the source frame is not an I-frame, it is encoded as a non-I-frame. When this option is used, the GOP duration setting is invalid.

Default Value

auto

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Example Requests

Queries transcoding templates.

GET https://{endpoint}/v1/{project_id}/template/transcodings?domain=play.example.com&app_name=live&page=0&size=10

Example Responses

Status code: 200

Transcoding templates queried successfully.

{
  "domain" : "play.example.com",
  "total" : 1,
  "templates" : [ {
    "app_name" : "live",
    "quality_info" : [ {
      "quality" : "lsd",
      "hdlb" : "off",
      "codec" : "H264",
      "width" : 1920,
      "height" : 1080,
      "bitrate" : 4500,
      "video_frame_rate" : 20,
      "gop" : 4
    }, {
      "quality" : "userdefine",
      "templateName" : "yourTemplateName",
      "hdlb" : "off",
      "codec" : "H264",
      "width" : 1920,
      "height" : 1080,
      "bitrate" : 4500,
      "video_frame_rate" : 20,
      "gop" : 4
    } ]
  } ]
}

Status code: 400

Failed to query the transcoding templates.

{
  "error_code" : "LIVE.100011001",
  "error_msg" : "Request Illegal"
}

Status Codes

Status Code

Description

200

Transcoding templates queried successfully.

400

Failed to query the transcoding templates.

Error Codes

See Error Codes.