CreateSmartSubtitleTemplate
1. API Description
Domain name for API request: mps.intl.tencentcloudapi.com.
This API is used to create a custom smart subtitle template.
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: CreateSmartSubtitleTemplate. |
| Version | Yes | String | Common Params. The value used for this API: 2019-06-12. |
| Region | No | String | Common Params. This parameter is not required for this API. |
| Name | Yes | String | Intelligent subtitle template name |
| VideoSrcLanguage | Yes | String | Smart subtitling video source language |
| SubtitleType | Yes | Integer | Intelligent caption subtitle language type |
| Comment | No | String | Intelligent caption template description information |
| SubtitleFormat | No | String | Intelligent subtitle file format:
Note:
|
| AsrHotWordsConfigure | No | AsrHotWordsConfigure | ASR hot word lexicon parameter |
| TranslateSwitch | No | String | Subtitle translation switch Note: For pure subtitle translation mode, the default value is enabled if the field is unspecified. The field cannot be left blank or set to |
| TranslateDstLanguage | No | String | Subtitle target language Note: Use the multilingual method. |
| ProcessType | No | Integer | Subtitle processing type:
Note: The default type is ASR recognition subtitle if the field is unspecified. |
| SelectingSubtitleAreasConfig | No | SelectingSubtitleAreasConfig | Area configurations for the subtitle OCR extraction box |
| SubtitleEmbedId | No | Integer | Suppression Template id. Only allowed to fill in when ProcessType is 0 or 2 (task type is ASR or OCR). Cannot fill in when multiple target languages are enabled. |
| SpeakerMode | No | Integer | Speaker identification switch. Valid values: |
| SpeakerLabel | No | Integer | Indicates whether to output the identified speaker to the subtitle file. Valid values: |
3. Output Parameters
| Parameter Name | Type | Description |
|---|---|---|
| Definition | Integer | Unique identifier of the smart subtitle template. |
| 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 Create Smart Subtitle Template
Input Example
POST / HTTP/1.1
Host: mps.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateSmartSubtitleTemplate
<Common Request Parameters>
{
"Name": "Smart Subtitle Template Test",
"VideoSrcLanguage": "zh",
"SubtitleType": 2,
"SubtitleFormat": "vtt",
"TranslateSwitch": "ON",
"TranslateDstLanguage": "en/ja",
"SubtitleEmbedId": 0
}
Output Example
{
"Response": {
"Definition": 304479,
"RequestId": "92b23ad2-452e-4887-927e-7b4cc9325538"
}
}
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 |
|---|---|
| InvalidParameterValue.AsrHotWordsConfigure | The value of the hotword lexicon configuration parameter is incorrect. |
| InvalidParameterValue.AsrHotWordsLibraryId | The value of the hotword lexicon ID parameter is incorrect. |
| InvalidParameterValue.AsrHotWordsSwitch | The value of the hotword lexicon switch parameter is incorrect. |
| InvalidParameterValue.Comment | Parameter error: template description. |
| InvalidParameterValue.Name | Incorrect parameter value: Name exceeds the length limit. |
| InvalidParameterValue.SubtitleEmbedId | Subtitle suppression ID invalid |
| InvalidParameterValue.SubtitleFormat | Incorrect parameter value: The value of the SubtitleFormat parameter is invalid. |
| InvalidParameterValue.SubtitleType | The value of the subtitle language type is incorrect. |
| InvalidParameterValue.TranslateDstLanguage | The value of the target language parameter is incorrect. |
| InvalidParameterValue.TranslateSwitch | The value of the translation switch parameter is incorrect. |
| InvalidParameterValue.VideoSrcLanguage | The value of the video source language parameter is incorrect. |