Querying Transcoding Templates
Function
This API is used to query transcoding templates.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions. For details about the required permissions, see Permissions Policies and Supported Actions.
URI
GET /v2/{project_id}/asset/template/transcodings
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
group_id |
No |
String |
Template ID. |
|
is_default |
No |
Boolean |
Whether the template is the default template. |
|
offset |
No |
Integer |
Offset. The default value is 0. This parameter is invalid when group_id is specified. |
|
limit |
No |
Integer |
Number of records on each page. The value defaults to 10 and ranges from 1 to 100. This parameter is invalid when group_id is specified. |
|
query_string |
No |
String |
String used for fuzzy matching against template names and descriptions. This parameter is invalid when group_id is specified. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
No |
String |
User token. This parameter is mandatory when token authentication is used. It 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 a request is sent. This parameter is mandatory for AK/SK authentication. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
template_group_list |
Array of TransTemplateRsp objects |
Template group information. |
|
total |
Integer |
Total number of records. |
|
Parameter |
Type |
Description |
|---|---|---|
|
group_id |
String |
Template group ID. |
|
name |
String |
Template group name. |
|
is_default |
Boolean |
Whether the template is set as the default transcoding template. |
|
type |
String |
Template group type.
|
|
is_auto_encrypt |
Boolean |
Whether to encrypt the output audio/video. The default value is false (not encrypted). Only HLS audio/video streams can be encrypted before being output. Original audio/video streams are not encrypted. This field is unavailable for non-HLS transcoded audio/video. Before enabling this function, obtain the key URL by referring to section "HLS Encryption Settings" in VOD User Guide. |
|
quality_info_list |
Array of QualityInfoList objects |
Image quality configuration. |
|
watermark_template_ids |
Array of strings |
Array of IDs for the associated watermark templates |
|
description |
String |
Template description. |
|
common |
CommonInfo object |
Parameters shared by the low-bitrate HD transcoding switch, low-bitrate HD transcoding version, and multi-stream encoding format. |
|
Parameter |
Type |
Description |
|---|---|---|
|
video |
VideoInfo object |
Video template information. Configure at least one of the video and audio parameters. |
|
audio |
AudioInfo object |
Audio template information. |
|
Parameter |
Type |
Description |
|---|---|---|
|
quality |
String |
Image quality.
|
|
width |
Integer |
Video width. H.264 encoding: The value can be 0 or an integer multiple of 2 from 32 to 4,096. H.265 encoding: The value can be 0 or an integer multiple of 2 from 160 to 4,096. |
|
height |
Integer |
Video height. H.264 encoding: The value can be 0 or an integer multiple of 2 from 32 to 2,880. H.265 encoding: The value can be 0 or an integer multiple of 2 from 160 to 2,880. |
|
bitrate |
Integer |
Average bitrate, in kbit/s. The value can be 0 or an integer from 40 to 30,000. |
|
frame_rate |
Integer |
Frame rate, in frames per second (FPS). The value is an integer from 0 to 75. If the value is lower than 5 or higher than 60, the frame rate is adaptive. |
|
Parameter |
Type |
Description |
|---|---|---|
|
sample_rate |
String |
Audio sampling rate. Possible options:
|
|
bitrate |
Integer |
Audio bitrate, in kbit/s. |
|
channels |
String |
Number of audio channels. The options include:
|
|
Parameter |
Type |
Description |
|---|---|---|
|
pvc |
Boolean |
Low-bitrate HD transcoding switch. |
|
video_codec |
String |
Video encoding format.
|
|
audio_codec |
String |
Audio encoding format.
|
|
is_black_cut |
Boolean |
Black bar cropping type. The default value is false, indicating that black bar cropping is disabled. |
|
format |
String |
Transcoded file format.
|
|
hls_interval |
Integer |
Segment file duration. The value ranges from 2 to 10 (in seconds) and defaults to 5. |
|
upsample |
Boolean |
Whether to enable upsampling. After this function is enabled, video resolution can be improved and the number of sampling points can be increased. The default value is false, indicating that upsampling is disabled. |
|
adaptation |
String |
Resolution adaptation mode of the transcoded media file. The options include:
NOTE:
|
|
preset |
Integer |
Encoding quality level. Value range: [0,2]. 0: default mode; 1: transcoding efficiency first; 2: transcoding quality first. |
|
max_iframes_interval |
Integer |
Maximum I-frame interval. Value range: [2, 10]. Default value: 5, in seconds |
|
hls_audio_separate |
Boolean |
Whether to store the transcoded audio separately. |
|
hls_segment_type |
String |
Packaging format of HLS segments. Currently, TS (default) and fMP4 are supported. |
Status code: 403
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code. |
|
error_msg |
String |
Error description. |
Example Requests
This example queries transcoding templates.
GET https://{endpoint}/v2/{project_id}/asset/template/transcodings?group_id={group_id}
Example Responses
Status code: 200
Returned when the request succeeded.
{
"template_group_list" : [ {
"group_id" : "9751249d25f14587b212544d6fd8dcf8",
"name" : "non_transcoding_template_group",
"is_default" : false,
"type" : "non_transcoding_template_group",
"is_auto_encrypt" : false,
"quality_info_list" : [ {
"video" : {
"quality" : "UNKNOW",
"width" : 0,
"height" : 0,
"bitrate" : 0,
"frame_rate" : 0
},
"audio" : null
} ],
"watermark_template_ids" : null,
"description" : null,
"common" : {
"pvc" : false,
"is_black_cut" : false,
"format" : "UNKNOW",
"upsample" : false,
"adaptation" : "NONE",
"video_codec" : null,
"audio_codec" : "AAC",
"hls_interval" : 0
}
} ],
"total" : 0
}
Status code: 403
Returned when the request failed.
{
"error_code" : "VOD.10053",
"error_msg" : "The request parameter is illegal, illegal field: {xx}."
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Returned when the request succeeded. |
|
403 |
Returned when the request failed. |
Error Codes
See Error Codes.
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