Video Translation API Reference

Video Translation Submission API

GET/POST/ai/video/translation

Introduction

Video translation product translates both on-screen text (such as subtitles and embedded selling points) and speech.

Request Parameters

Parameter
Parameter Name
Type
Required
Description

paramJson

Object

Yes

Parameter

videoData

String

Yes

Video URL. Supported specifications:

  • Video formats: mp4, mov, webm, avi, mkv

  • Video file size limit: up to 200MB

  • Video duration limit: up to 6 minutes

  • Maximum resolution supported: 1080P

sourceLanguage

String

Yes

Source language code

mode

String

Yes

"translate_audio_only": Translates only the speech; suitable for videos with only voice and no on-screen text.

"translate_video_only": Translates only the on-screen text; suitable for videos with on-screen text but no voice or only music.

"translate_audio_and_video": Translates both the speech and on-screen text simultaneously.

"remove_video_and_translate_audio": Removes on-screen text and then translates the speech; can enable the captions parameter to generate new subtitles.

targetLanguage

String

Yes

Target language code

captions

String

No

Effective only when translating speech.

By default, subtitles are not embedded;

If "embed" is provided, generate embedded subtitles based on the speech translation results.

artificialTextOnly

Boolean

No

Effective only when translating on-screen text.

Default: true. Only manually added text, such as subtitles and selling points, will be translated.

If set to false, all text will be translated, including natural text on products.

keepFontSize

Boolean

No

Effective only when translating on-screen text.

Default: false. The translated text will maintain the original text box's size and position as closely as possible, though the font size may vary. This setting is ideal for promotional text. Sample video link

If set to true, the translated text will match the original video's font size. However, this may cause the text to exceed the original boundaries or overlap. This setting is suitable for subtitling. Sample video link

Sample Request

The API's maximum response time is 30s. When calling the API, it's recommended to set the request timeout to no more than 30s.

For other programming languages, please refer to Quick Start.

/*The domain url of the API.
 *for api purchased on global site. set api_domain to "https://api.aidc-ai.com"
 *for api purchased on chinese site. set api_domain to "https://cn-api.aidc-ai.com"*/
IopClient client = new IopClientImpl("domain url", "your key", "your secret");
IopRequest request = new IopRequest();
request.setApiName("/ai/video/translation");
request.addHeaderParameter("x-iop-ai-partner-type", "aidge_video_share");
JSONObject jsonObject = new JSONObject();
jsonObject.put("videoData", "https://pro-video.lazcdn.com/gv/lzd_gsp_assortment/video_target/gv93-76454756-a1aafe28-92707877-5efa/trans/d1941c18-8d80-4fb6-bc67-133cb7ebeec8-hd.mp4");
jsonObject.put("sourceLanguage", "zh");
jsonObject.put("targetLanguage", "en");
jsonObject.put("mode", "translate_video_only");
jsonObject.put("artificialTextOnly", "true");
jsonObject.put("keepFontSize", "true");
request.addApiParameter("paramJson", jsonObject.toString());
IopResponse response = client.execute(request);
System.out.println(response.getBody());
Thread.sleep(10);

Response Parameters

Parameter
Type
Description

resCode

Number

Response code; 200 indicates a successful call, other response codes can be referred to the error code information.

data

Object

Structured information of the returned translation result.

requestId

String

Request ID: used to identify a unique request call.

resMessage

String

Error message, like "content has sensitive data, please try other input".

{
    "data": {
        "usage": 0,
        "result": {
            "taskId": "40b8e4d2-67ea-402e-a2c6-95d8d1925a75"
        }
    },
    "resCode": 200,
    "resMessage": "success",
    "code": "0",
    "request_id": "0babebb817566948704458239",
    "_trace_id_": "213ee07a17566948703137706e19eb"
}

Video Translation Query API

GET/POST/ai/video/translation/result

Request Parameters

Parameter
Type
Required
Description

taskId

String

Yes

Task ID.

Response Parameters

Parameter
Type
Description

resCode

Number

Response code; 200 indicates a successful call, other response codes can be referred to the error code information.

data

Object

Structured information of the returned translation result.

taskStatus: submitted、running、finished、failed (Enum Value)

requestId

String

Request ID: used to identify a unique request call.

resMessage

String

Error message,like "content has sensitive data, please try other input".

Response Example

{
    "data": {
        "usage": 0,
        "taskId": "4bb69361-e916-4554-9f97-8234f2e19a8e",
        "taskStatus": "finished",
        "taskResult": [
            {
                "usage": 1,
                "taskStatus": "finished",
                "taskResult": "{\"result\":\"{\\\"data\\\":{\\\"message\\\":[],\\\"usageMap\\\":\\\"{\\\\\\\"usage\\\\\\\":2,\\\\\\\"translateVideo\\\\\\\":8}\\\",\\\"structData\\\":{\\\"data\\\":{\\\"audio_url\\\":\\\"\\\",\\\"video_url\\\":\\\"https://aib-image.oss-ap-southeast-1.aliyuncs.com/video-trans%2Fa206818a-86e1-11f0-85e3-00163e17520f.mp4?OSSAccessKeyId=LTAI5tSEGjGp5wixZgHLc3bV&Expires=1759288409&Signature=DVqQJ%2B0ckQ3Pn%2BFR6IZurs0RMh8%3D\\\"},\\\"usageMap\\\":\\\"{\\\\\\\"translateVideo\\\\\\\": 8, \\\\\\\"usage\\\\\\\": 2}\\\"}},\\\"success\\\":true,\\\"requestId\\\":\\\"21010e4c17566964095115037d1038\\\"}\",\"usage\":1,\"usageMap\":\"{\\\"usage\\\":2,\\\"translateVideo\\\":8}\"}"
            }
        ]
    },
    "resCode": 200,
    "resMessage": "success",
    "code": "0",
    "request_id": "2151f8e017566964111023733",
    "_trace_id_": "213ee07a17566964109492286e19cc"
}

Error Code

Error Code
Error Message
Description

500

system error

System error.

501

rate limit exceed

The current interface has reached the current limit. Please contact us via Discord or email us ([email protected]) to increase the current limit value.

700

video duration exceeds the limit

Video duration exceeds the limit.

701

the video file size exceeds the limit

Video file size exceeds the limit.

702

video format not supported

Video format is not supported.

703

video resolution is not supported

Video resolution is not supported.

801

model failed

Internal call exception. please contact us via Discord or email us ([email protected]) for troubleshooting.

1000

content has sensitive data, please try other input

The request parameters contain sensitive information and cannot be processed at this time. Please try a different input.

1001

content control failed, please retry

The risk control service failed. Please contact us via Discord or email us ([email protected]) .

1002

content risk filter failed, please contact us

Content risk filter failed. Please contact us via Discord or email us ([email protected]) .

Languages Supported for On-screen text translation

Source Language Code
Target Language Code

zh

en

en

zh

zh/en

ar

zh/en

bn

zh/en

de

zh/en

es

zh/en

fr

zh/en

he

zh/en

hi

zh/en

id

zh/en

it

zh/en

ja

zh/en

ko

zh/en

ms

zh/en

nl

zh/en

pl

zh/en

pt

zh/en

ru

zh/en

th

zh/en

tl

zh/en

tr

zh/en

uk

zh/en

ur

zh/en

vi

Languages Supported for Speech translation (AI dubbing)

Source Language Code
Target Language Code

zh

en

en

zh

zh/en

ar

zh/en

bn

zh/en

cs

zh/en

da

zh/en

de

zh/en

es

zh/en

et

zh/en

fa

zh/en

fi

zh/en

fr

zh/en

hi

zh/en

id

zh/en

it

zh/en

ja

zh/en

ko

zh/en

mt

zh/en

nl

zh/en

pl

zh/en

pt

zh/en

ro

zh/en

ru

zh/en

sk

zh/en

sv

zh/en

sw

zh/en

te

zh/en

th

zh/en

tl

zh/en

tr

zh/en

uk

zh/en

ur

zh/en

uz

zh/en

vi

ar

zh/en

az

zh/en

bg

zh/en

bn

zh/en

ca

zh/en

cs

zh/en

cy

zh/en

da

zh/en

de

zh/en

el

zh/en

es

zh/en

et

zh/en

fa

zh/en

fi

zh/en

fr

zh/en

he

zh/en

hi

zh/en

hr

zh/en

hu

zh/en

id

zh/en

it

zh/en

ja

zh/en

kn

zh/en

ko

zh/en

la

zh/en

lt

zh/en

lv

zh/en

mi

zh/en

mk

zh/en

ml

zh/en

ms

zh/en

nl

zh/en

no

zh/en

pl

zh/en

pt

zh/en

ro

zh/en

ru

zh/en

sk

zh/en

sl

zh/en

sr

zh/en

sv

zh/en

ta

zh/en

te

zh/en

th

zh/en

tr

zh/en

uk

zh/en

ur

zh/en

vi

zh/en

Appendix

Language
Language Code

Arabic

ar

Azerbaijani

az

Bulgarian

bg

Bengali

bn

Catalan

ca

Czech

cs

Welsh

cy

Danish

da

German

de

Greek

el

English

en

Spanish

es

Estonian

et

Persian

fa

Finnish

fi

French

fr

Hebrew

he

Hindi

hi

Croatian

hr

Hungarian

hu

Indonesian

id

Italian

it

Japanese

ja

Kannada

kn

Korean

ko

Latin

la

Lithuanian

lt

Latvian

lv

Māori

mi

Macedonian

mk

Malayalam

ml

Malay

ms

Maltese

mt

Dutch

nl

Norwegian

no

Polish

pl

Portuguese

pt

Romanian

ro

Russian

ru

Slovak

sk

Slovenian

sl

Serbian

sr

Swedish

sv

Swahili

sw

Tamil

ta

Telugu

te

Thai

th

Tagalog

tl

Turkish

tr

Ukrainian

uk

Urdu

ur

Uzbek

uz

Vietnamese

vi

Chinese

zh

Last updated

Was this helpful?