Modifying a Transcoding Template
Function
This API is used to modify a transcoding template.
URI
PUT /v1/{project_id}/template/transcodings
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. For details about how to obtain a project ID, see "Obtaining a Project ID" . |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
User token. The token is obtained by calling the IAM API used to obtain a user token. The token is the value of X-Subject-Token in the response header. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
domain |
Yes |
String |
Streaming domain name |
|
app_name |
Yes |
String |
Application name. |
|
quality_info |
Yes |
Array of QualityInfo objects |
Video quality information |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
templateName |
No |
String |
Template name |
|
quality |
Yes |
String |
Possible values are:
|
|
PVC |
No |
String |
Whether to enable low bitrate HD. PVC in different templates in a template group must be the same.
Default value: off |
|
hdlb |
No |
String |
Whether to enable image enhancement
Default value: off |
|
codec |
No |
String |
Video codec. codec in different templates in a template group must be the same. Possible values are:
The default value is H.264. |
|
width |
Yes |
Integer |
Video width (unit: pixel)
|
|
height |
Yes |
Integer |
Video height (unit: pixel)
|
|
bitrate |
Yes |
Integer |
Bitrate of a transcoded video, in kbit/s Value range: 40–30,000 |
|
video_frame_rate |
No |
Integer |
Frame rate of the transcoded video, in fps. The value ranges from 0 to 30. Value 0 indicates that the frame rate remains unchanged. |
|
protocol |
No |
String |
Output format. RTMP and HLS are supported. protocol in different templates in a template group must be the same.
The default value is RTMP. |
|
iFrameInterval |
No |
Integer |
I-frame interval (unit: frame) Value range: 0–500 Default value: 25 |
|
gop |
No |
Integer |
I-frame interval set by time Value range: 0–10 Default value: 4 |
Response Parameters
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error Code |
|
error_msg |
String |
Error description |
Example Requests
PUT https://{endpoint}/v1/{project_id}/template/transcodings
{
"domain" : "play.example.huawei.com",
"app_name" : "live",
"quality_info" : [ {
"quality" : "SD",
"PVC" : "off",
"codec" : "H264",
"width" : 1920,
"height" : 1080,
"bitrate" : 4500,
"video_frame_rate" : 20,
"protocol" : "HLS"
} ]
}
Example Responses
Status code: 400
Failed to modify the transcoding template.
{
"error_code" : "LIVE.100011001",
"error_msg" : "Request Illegal"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
204 |
Transcoding template modified successfully. |
|
400 |
Failed to modify the transcoding template. |
Error Codes
See Error Codes.
Last Article: Deleting a Transcoding Template
Next Article: Querying Transcoding Templates
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.