Customizes a transcoding template
Function
Customizes a transcoding template
URI
POST /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. |
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 a 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. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Template group name. |
is_default |
No |
Boolean |
Indicates whether the template is the default transcoding template. The default value is false. If the value is not specified, the default value is used. |
is_auto_encrypt |
No |
Boolean |
Indicates whether to encrypt data. The default value is false, indicating that data is not encrypted. |
quality_info_list |
Yes |
Array of QualityInfoList objects |
Image quality configuration list. |
common |
Yes |
CommonInfo object |
Low-bitrate HD transcoding switch, encoding format, and multi-stream common parameters. |
watermark_template_ids |
No |
Array of strings |
ID array of the bound watermark template group. |
description |
No |
String |
Template description. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
video |
Yes |
VideoInfo object |
Video template information. Configure at least one of the video and audio parameters. |
audio |
No |
AudioInfo object |
Audio template information |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
quality |
Yes |
String |
Video quality.
|
width |
No |
Integer |
Video width. |
height |
No |
Integer |
Video height. |
bitrate |
Yes |
Integer |
Bitrate, in kbit/s. |
frame_rate |
Yes |
Integer |
Frame rate (in FPS), which defaults to 0 indicating adaptive frame rate. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
sample_rate |
Yes |
String |
Audio sampling rate. Possible options:
|
bitrate |
No |
Integer |
Audio bitrate, in kbit/s. |
channels |
Yes |
String |
Number of audio channels. Possible options:
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
pvc |
Yes |
Boolean |
Low-bitrate HD transcoding switch. |
video_codec |
Yes |
String |
Video encoding format. |
audio_codec |
No |
String |
Audio encoding format.
|
is_black_cut |
No |
Boolean |
Black bar cropping type. The default value is false, indicating that black bar cropping is disabled. |
format |
Yes |
String |
Format. |
hls_interval |
Yes |
Integer |
Segment file duration. The value ranges from 2 to 10 (in seconds) and defaults to 5. |
upsample |
No |
Boolean |
Upsampling. |
adaptation |
No |
String |
|
Response Parameters
Status code: 201
Parameter |
Type |
Description |
---|---|---|
group_id |
String |
Template group ID. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code |
error_msg |
String |
Error description |
Example Requests
Creates a transcoding template.
POST https://{endpoint}/v2/{project_id}/asset/template/transcodings { "name" : "trans_template_test", "is_default" : true, "is_auto_encrypt" : false, "quality_info_list" : [ { "video" : { "width" : 1280, "height" : 720, "bitrate" : 1000, "quality" : "HD", "frame_rate" : 0 }, "audio" : { "sample_rate" : "AUDIO_SAMPLE_AUTO", "channels" : "AUDIO_CHANNELS_1", "bitrate" : 0 } } ], "watermark_template_ids" : [ ], "common" : { "pvc" : false, "video_codec" : "H264", "audio_codec" : "AAC", "format" : "HLS", "hls_interval" : 5 } }
Example Responses
Status code: 201
The information is returned when the request succeeded.
{ "group_id" : "f9b045e0811c482f9de0d436a5927bb6" }
Status code: 400
The information is returned when the request failed.
{ "error_code" : "VOD.10053", "error_msg" : "The request parameter is illegal, illegal field: {xx}." }
Status Codes
Status Code |
Description |
---|---|
201 |
The information is returned when the request succeeded. |
400 |
The information is 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