tencent cloud

APIs

CreateSmartSubtitleTemplate

Mode fokus
Ukuran font
Terakhir diperbarui: 2026-04-08 17:39:15

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.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

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
Length limit: 64 characters.

VideoSrcLanguage Yes String

Smart subtitling video source language
OCR recognition supports the following languages:
zh_en: Chinese-English
multi: Other
ASR recognition and pure caption translation currently support the following languages:
auto: Auto-identification
zh: Simplified Chinese
en: English
ja: Japanese
ko: Korean
zh-PY: Chinese-English-Cantonese
zh_medical: Chinese health care
vi: Vietnamese
ms: Malay
id: Indonesian
fil: Filipino
th: Thai
pt: Portuguese
tr: Turkish
ar: Arabic
es: Spanish
hi: Hindi
fr: French
de: German
it: Italian
zh_dialect: Chinese dialect
zh_en: Chinese-English
yue: Cantonese
ru: Russian
prime_zh: Chinese-English dialect
af-ZA: Afrikaans (South Africa)
sq-AL: Albanian (Albania)
am-ET: Amharic (Ethiopia)
ar-DZ: Arabic (Algeria)
ar-BH: Arabic (Bahrain)
ar-EG: Arabic (Egypt)
ar-IQ: Arabic (Iraq)
ar-IL: Arabic (Israel)
ar-JO: Arabic (Jordan)
ar-KW: Arabic (Kuwait)
ar-LB: Arabic (Lebanon)
ar-MR: Arabic (Mauritania)
ar-MA: Arabic (Morocco)
ar-OM: Arabic (Oman)
ar-QA: Arabic (Qatar)
ar-SA: Arabic (Saudi Arabia)
ar-PS: Arabic (State of Palestine)
ar-SY: Arabic (Syria)
ar-TN: Arabic (Tunisia)
ar-AE: Arabic (United Arab Emirates)
ar-YE: Arabic (Yemen)
hy-AM: Armenian (Armenia)
az-AZ: Azerbaijani (Azerbaijan)
eu-ES: Basque (Spain)
bn-BD: Bengali (Bangladesh)
bn-IN: Bengali (India)
bs-BA: Bosnian (Bosnia and Herzegovina)
bg-BG: Bulgarian (Bulgaria)
my-MM: Burmese (Myanmar)
ca-ES: Catalan (Spain)
hr-HR: Croatian (Croatia)
cs-CZ: Czech (Czech Republic)
da-DK: Danish (Denmark)
nl-BE: Dutch (Belgium)
nl-NL: Dutch (Netherlands)
en-AU: English (Australia)
en-CA: English (Canada)
en-GH: English (Ghana)
en-HK: English (Hong Kong (China))
en-IN: English (India)
en-IE: English (Ireland)
en-KE: English (Kenya)
en-NZ: English (New Zealand)
en-NG: English (Nigeria)
en-PK: English (Pakistan)
en-PH: English (Philippines)
en-SG: English (Singapore)
en-ZA: English (South Africa)
en-TZ: English (Tanzania)
en-GB: English (UK)
en-US: English (United States)
et-EE: Estonian (Estonia)
fil-PH: Filipino (Philippines)
fi-FI: Finnish (Finland)
fr-BE: French (Belgium)
fr-CA: French (Canada)
fr-FR: French (France)
fr-CH: French (Switzerland)
gl-ES: Galician (Spain)
ka-GE: Georgian (Georgia)
el-GR: Greek (Greece)
gu-IN: Gujarati (India)
iw-IL: Hebrew (Israel)
hi-IN: Hindi (India)
hu-HU: Hungarian (Hungary)
is-IS: Icelandic (Iceland)
id-ID: Indonesian (Indonesia)
it-IT: Italian (Italy)
it-CH: Italian (Switzerland)
ja-JP: Japanese (Japan)
jv-ID: Javanese (Indonesia)
kn-IN: Kannada (India)
kk-KZ: Kazakh (Kazakhstan)
km-KH: Khmer (Cambodia)
rw-RW: Kinyarwanda (Rwanda)
ko-KR: Korean (South Korea)
lo-LA: Lao (Laos)
lv-LV: Latvian (Latvia)
lt-LT: Lithuanian (Lithuania)
mk-MK: Macedonian (North Macedonia)
ms-MY: Malay (Malaysia)
ml-IN: Malayalam (India)
mr-IN: Marathi (India)
mn-MN: Mongolian (Mongolia)
ne-NP: Nepali (Nepal)
no-NO: Norwegian Bokmål (Norway)
fa-IR: Persian (Iran)
pl-PL: Polish (Poland)
pt-BR: Portuguese (Brazil)
pt-PT: Portuguese (Portugal)
ro-RO: Romanian (Romania)
ru-RU: Russian (Russia)
sr-RS: Serbian (Serbia)
si-LK: Sinhalese (Sri Lanka)
sk-SK: Slovak (Slovakia)
sl-SI: Slovenian (Slovenia)
st-ZA: Southern Sotho (South Africa)
es-AR: Spanish (Argentina)
es-BO: Spanish (Bolivia)
es-CL: Spanish (Chile)
es-CO: Spanish (Colombia)
es-CR: Spanish (Costa Rica)
es-DO: Spanish (Dominican Republic)
es-EC: Spanish (Ecuador)
es-SV: Spanish (El Salvador)
es-GT: Spanish (Guatemala)
es-HN: Spanish (Honduras)
es-MX: Spanish (Mexico)
es-NI: Spanish (Nicaragua)
es-PA: Spanish (Panama)
es-PY: Spanish (Paraguay)
es-PE: Spanish (Peru)
es-PR: Spanish (Puerto Rico)
es-ES: Spanish (Spain)
es-US: Spanish (United States)
es-UY: Spanish (Uruguay)
es-VE: Spanish (Venezuela)
su-ID: Sundanese (Indonesia)
sw-KE: Swahili (Kenya)
sw-TZ: Swahili (Tanzania)
sv-SE: Swedish (Sweden)
ta-IN: Tamil (India)
ta-MY: Tamil (Malaysia)
ta-SG: Tamil (Singapore)
ta-LK: Tamil (Sri Lanka)
te-IN: Telugu (India)
th-TH: Thai (Thailand)
ts-ZA: Tsonga (South Africa)
tr-TR: Turkish (Türkiye)
uk-UA: Ukrainian (Ukraine)
ur-IN: Urdu (India)
ur-PK: Urdu (Pakistan)
uz-UZ: Uzbek (Uzbekistan)
ve-ZA: Venda (South Africa)vi-VN: Vietnamese (Vietnam)
xh-ZA: Xhosa (South Africa)
zu-ZA: Zulu (South Africa)

SubtitleType Yes Integer

Intelligent caption subtitle language type
0: Source language
1: Target language
2: Source language + target language
Only 0 is supported when TranslateSwitch is OFF
Only 1 or 2 is supported when TranslateSwitch is ON

Comment No String

Intelligent caption template description information
Length limit: 256 characters.

SubtitleFormat No String

Intelligent subtitle file format:

  • For ASR recognition translation processing type:
    • vtt: WebVTT format subtitle
    • srt: SRT format subtitle
    • Leave blank or fill in the blank: no subtitle file generated
  • For pure subtitle translation processing type:
    • original: consistent with the source file
    • vtt: WebVTT format subtitle
    • srt: SRT format subtitle
  • For OCR recognition translation processing type:
    • vtt: WebVTT format subtitle
    • srt: SRT format subtitle

Note:

  • For ASR recognition method, do not leave blank or not pass when translating 2 or more languages.
  • For pure subtitle translation method, do not leave blank or not pass.
  • For OCR tasks, it is allowed to leave blank or not pass when suppression is enabled.
AsrHotWordsConfigure No AsrHotWordsConfigure

ASR hot word lexicon parameter

TranslateSwitch No String

Subtitle translation switch
ON: Enable translation
OFF: Disable translation

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 OFF.

TranslateDstLanguage No String

Subtitle target language
Take effect when TranslateSwitch is ON. Translation language list:
ab: Abkhaz
ace: Acehnese
ach: Acholi
af: Afrikaans
ak: Akan
am: Amharic
ar: Arabic
as: Assamese
ay: Aymara
az: Azerbaijani
ba: Bashkir
ban: Balinese
bbc: Batak Toba
bem: Bemba
bew: Betawi
bg: Bulgarian
bho: Bhojpuri
bik: Bikol
bm: Bambara
bn: Bengali
br: Breton
bs: Bosnian
btx: Batak Karo
bts: Batak Simalungun
bua: Buryat
ca: Catalan
ceb: Cebuano
cgg: Kiga
chm: Meadow Mari
ckb: Kurdish (Sorani)
cnh: Hakha Chin
co: Corsican
crh: Crimean Tatar
crs: Seychellois Creole
cs: Czech
cv: Chuvash
cy: Welsh
da: Danish
de: German
din: Dinka
doi: Dogri
dov: Dombe
dv: Dhivehi
dz: Dzongkha
ee: Ewe
el: Greek
en: English
eo: Esperanto
es: Spanish
et: Estonian
eu: Basque
fa: Persian
ff: Fula
fi: Finnish
fil: Filipino (Tagalog)
fj: Fijian
fr: French
fr-CA: French (Canada)
fr-FR: French (France)
fy: Frisian
ga: Irish
gaa: GaLanguage
gd: Scottish Gaelic
gl: Galician
gn: Guarani
gom: Konkani
gu: Gujarati
gv: Manx
ha: Hausa
haw: Hawaiian
he: Hebrew
hi: Hindi
hil: Hiligaynon
hmn: Hmong
hr: Croatian
hrx: Hunsrik
ht: Haitian Creole
hu: Hungarian
hy: Armenian
id: Indonesian
ig: Igbo
ilo: Ilocano
is: Icelandic
it: Italian
iw: Hebrew
ja: Japanese
jv: Javanese
ka: Georgian
kk: Kazakh
km: Khmer
kn: Kannada
ko: Korean
kri: Krio
ku: Kurdish (Kurmanji)
ktu: Kituba
ky: Kyrgyz
la: Latin
lb: Luxembourgish
lg: Ganda (Luganda)
li: Limburgish
lij: Ligurian
lmo: Lombard
ln: Lingala
lo: Lao
lt: Lithuanian
ltg: Latgalian
luo: Luo
lus: Mizo
lv: Latvian
mai: Maithili
mak: Makassar
mg: Malagasy
mi: Maori
min: Minangkabau
mk: Macedonian
ml: Malayalam
mn: Mongolian
mr: Marathi
ms: Malay
mt: Maltese
my: Burmese
ne: Nepali
new: Newari
nl: Dutch
no: Norwegian
nr: Southern Ndebele
nso: Northern Sotho (Sepedi)
nus: Nuer
ny: Chichewa (Nyanja)
oc: Occitan
om: Oromo
or: Odia
pa: Punjabi
pag: Pangasinan
pam: Kapampangan
pap: Papiamento
pl: Polish
ps: Pashto
pt: Portuguese
pt-BR: Portuguese (Brazil)
pt-PT: Portuguese (Portugal)
qu: Quechua
ro: Romanian
rom: Romani
rn: Rundi
ru: Russian
rw: Kinyarwanda
sa: Sanskrit
scn: Sicilian
sd: Sindhi
sg: Sango
shn: Shan
si: Sinhalese
sk: Slovak
sl: Slovenian
sm: Samoan
sn: Shona
so: Somali
sq: Albanian
sr: Serbian
ss: Swati
st: Sesotho
su: Sundanese
sv: Swedish
sw: Swahili
szl: Silesian
ta: Tamil
te: Telugu
tet: Tetum
tg: Tajik
th: Thai
ti: Tigrinya
tk: Turkmen
tn: Tswana
tr: Turkish
ts: Tsonga
tt: Tatar
ug: Uyghur
uk: Ukrainian
ur: Urdu
uz: Uzbek
vi: Vietnamese
xh: Xhosa
yi: Yiddish
yo: Yoruba
yua: Yucatec Maya
yue: Cantonese
zh: Simplified Chinese
zh-TW: Traditional Chinese
zu: Zulu

Note: Use the multilingual method./ to separate, such as en/ja, which indicates English and Japanese.

ProcessType No Integer

Subtitle processing type:

  • 0: ASR recognition subtitle
  • 1: Pure caption translation
  • 2: OCR recognition subtitle

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.

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 Creates a 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": "Create a smart subtitle template"
    "VideoSrcLanguage": "auto",
    "SubtitleType": 0
}

Output Example

{
    "Response": {
        "Definition": 286972,
        "RequestId": "d16800f5-479c-49b9-8ff1-62580cc87712"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

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.

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan