Submits a video translation job. You can call this operation to translate subtitles in a video and audio to a specific language. Lip-sync adaptation will be supported in the future.
Operation description
After you call this operation to submit a video translation job, the system returns a job ID. You can call the GetSmartHandleJob operation based on the job ID to obtain the status and result information of the job.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
ice:SubmitVideoTranslationJob | none | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
InputConfig | string | No |
| {"Type":"Video","Media":"https://your-bucket.oss-cn-shanghai.aliyuncs.com/xxx.mp4"} |
EditingConfig | string | No |
| {"SourceLanguage":"zh","TargetLanguage":"en","DetextArea":"Auto"} |
OutputConfig | string | No |
| {"MediaURL": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/your-object.mp4"} |
Title | string | No |
| |
Description | string | No |
| |
UserData | string | No |
| {"NotifyAddress":"http://xx.xx.xxx"} |
ClientToken | string | No |
|
InputConfig
Parameter description
-
Type: the type of the input file. Valid values:
- Video: The input is a video.
- Subtitle: The input is a subtitle file.
-
Media: the video material. This parameter is required if Type is set to Video. Valid values:
- Media asset ID in IMS
- OSS URL
-
Subtitle: the SRT subtitle file. This parameter is required if Type is set to Subtitle. Valid value:
- OSS URL
Examples
The input is a video, with the media asset ID specified.
{
"Type": "Video",
"Media": "*****c80cc0071edbf92f6e7c44*****"
}
The input is a video, with the OSS URL specified.
{
"Type": "Video",
"Media": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/video.mp4"
}
The input is a subtitle file, with the OSS URL specified.
{
"Type": "Subtitle",
"Subtitle": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/subtitle.srt"
}
EditingConfig
Parameter description
-
SourceLanguage: the source language. Valid value:
- zh: Chinese.
-
TargetLanguage: the target language. Valid values:
- en: English.
- Other language codes. For more information, see Machine Translation language code list.
-
DetextArea: the area where the subtitle is erased. If this parameter is not specified, the subtitle is not erased. Valid values:
-
Auto: intelligently identifies the subtitle area.
-
[[x, y, width, height]]: the area where the subtitle is erased. The value is a two-layer array. You can specify multiple areas. The value contains the following options:
- x: the ratio of the horizontal distance from the upper-left corner of the subtitle frame to the upper-left corner of the video. Valid values: [0,1].
- y: the ratio of the vertical distance from the upper-left corner of the subtitle frame to the upper-left corner of the video. Valid values: [0,1].
- width: the ratio of the width of the subtitle frame to the width of the video. Valid values: [0,1].
- height: the ratio of the height of the subtitle frame to the height of the video. Valid values: [0,1].
-
-
SupportEditing: specifies whether to support custom editing. Valid values:
- true: supports custom editing. In this case, all intermediate files generated during processing are retained and an editing project is generated for custom production.
- false: does not support custom editing. This is the default value. In this case, intermediate files are not retained and no editing project is generated.
-
SubtitleTranslate: the subtitle translation configurations.
-
TextSource: the subtitle source. Valid values:
- OCR: The subtitle is obtained from the video by using optical character recognition (OCR). This is the default value.
- SubtitleFile: The subtitle is obtained from the input subtitle file.
-
OcrArea: the OCR area. If you do not specify this parameter, the default value Auto is used.
- Auto: intelligently identifies the subtitle area.
-
SubtitleConfig: the subtitle effect configurations. The parameters are the same as the subtitle parameters in the timeline settings for video editing. For more information.
-
Examples
Translate the subtitle from Chinese into English, with intelligent subtitle erasure enabled.
{
"SourceLanguage": "zh",
"TargetLanguage": "en",
"DetextArea": "Auto"
}
Translate the subtitle from Chinese into English, and specify the area where the subtitle is erased.
{
"SourceLanguage": "zh",
"TargetLanguage": "en",
"DetextArea": "[[0.1,0.85,0.8,0.15]]"
}
Translate the subtitle from Chinese into English without erasing the subtitle, and specify the area where the translated subtitle is displayed.
{
"SourceLanguage": "zh",
"TargetLanguage": "en",
"SubtitleTranslate": {
"TextSource": "OCR",
"OcrArea": "Auto",
"SubtitleConfig": {
"Alignment" : "Center"
"Y": 0.8
}
}
}
OutputConfig
Parameter description
- MediaURL: the URL of the output file, which can be a video file or a subtitle file.
Examples
The output is a video file.
{
"MediaURL": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/video.mp4"
}
The output is a subtitle file.
{
"MediaURL": "https://your-bucket.oss-cn-shanghai.aliyuncs.com/subtitle.srt"
}
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "******3B-0E1A-586A-AC29-742247******",
"Success": true,
"Data": {
"JobId": "****d718e2ff4f018ccf419a7b71****"
}
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|