CreateJustInTimeTranscodeTemplate
1. API Description
Domain name for API request: teo.intl.tencentcloudapi.com.
JIT transcoding already provides preset transcoding templates to meet most needs. If there are personalized transcoding requirements, you can create custom transcoding templates through this API, with up to 100 custom transcoding templates allowed.
This API is used to ensure the consistency of JIT transcoding effect, avoid video output exceptions caused by EO cache or M3U8 sharding template changes during the process, and templates cannot be modified after creation.
This API is used to learn about the detailed capacity of JIT transcoding. EdgeOne video instant processing function introduction (https://www.tencentcloud.comom/document/product/1552/111927?from_cn_redirect=1).
A maximum of 20 requests can be initiated per second for this API.
2. Input Parameters
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
Parameter Name | Required | Type | Description |
---|---|---|---|
Action | Yes | String | Common Params. The value used for this API: CreateJustInTimeTranscodeTemplate. |
Version | Yes | String | Common Params. The value used for this API: 2022-09-01. |
Region | No | String | Common Params. This parameter is not required. |
ZoneId | Yes | String | Specifies the site ID. |
TemplateName | Yes | String | Name of the just in time transcoding template, length limited to 64 characters. |
Comment | No | String | Template description, with a length limit of 256 characters. empty by default. |
VideoStreamSwitch | No | String | Enable video stream. valid values:.on : Enable; |
AudioStreamSwitch | No | String | Enable audio stream switch. valid values:.on : Enable; |
VideoTemplate | No | VideoTemplateInfo | Video stream configuration parameters. this field is required when VideoStreamSwitch is on. |
AudioTemplate | No | AudioTemplateInfo | Audio stream configuration parameters. this field is required when AudioStreamSwitch is on. |
3. Output Parameters
Parameter Name | Type | Description |
---|---|---|
TemplateId | String | Unique identifier of the instant transcoding template for jit transcoding URL concatenation. |
RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
4. Example
Example1 Creating a Just-In-Time Transcoding Template
This example shows you how to create a just-in-time transcoding template.
Input Example
POST / HTTP/1.1
Host: teo.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateJustInTimeTranscodeTemplate
<Common request parameters>
{
"ZoneId": "zone-djuqmq",
"TemplateName": "myTemplate",
"Comment": "This is my template.",
"VideoStreamSwitch": "on",
"AudioStreamSwitch": "on",
"VideoTemplate": {
"Codec": "H.264",
"Bitrate": 2048,
"Fps": 25
},
"AudioTemplate": {
"Codec": "libfdk_aac",
"AudioChannel": 2
}
}
Output Example
{
"Response": {
"TemplateId": "C1LZ7982VgTpYhJ7M",
"RequestId": "12ae8d8e-dce3-4151-9d4b-5594145287e1"
}
}
5. Developer Resources
SDK
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
- Tencent Cloud SDK 3.0 for Python
- Tencent Cloud SDK 3.0 for Java
- Tencent Cloud SDK 3.0 for PHP
- Tencent Cloud SDK 3.0 for Go
- Tencent Cloud SDK 3.0 for Node.js
- Tencent Cloud SDK 3.0 for .NET
- Tencent Cloud SDK 3.0 for C++
Command Line Interface
6. Error Code
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Error Code | Description |
---|---|
FailedOperation.ProductDiscontinued | The product will already be discontinued. operation denied. |
FailedOperation.ProductNotActivated | This product is not enabled. please enable it and try again. |
FailedOperation.TemplateOverLimit | The number of templates under this site exceeds the maximum quantity limit. |
InternalError | Internal error. |
InvalidParameterValue | Invalid parameter value. |
InvalidParameterValue.ZoneNotFound | No corresponding site. please ensure correct information entry. |
InvalidParameterValue.ZonePaused | The site is disabled. check current site status. |
MissingParameter | Missing parameters. |
UnauthorizedOperation | Unauthorized operation. |