TransCode

Update time: 2025-06-06 10:33:45

Use the transCode method to convert the specified video, mainly including transcoding the resolution and adding watermarks.

  • Limit of request rate per user: 300/5min
  • Applicable Products: Cloud VoD
For API authentication details, please refer to: API Authentication Overview

Request

Body Params

NameDescription
*videoIdsString

Please provide the ID of the video(s) you want to view. If there are multiple videos, separate each ID with a comma ,

waterMarkTemplateNameString

By default, there is no watermark added to the video. However, you have the option to select a watermark template from our cloud-based management platform and add it to your video on-demand.

transCodeTemplateNameString

The transcoding combination template name, by default, is set to the template provided by the cloud VOD management platform.

watermarkTemplateIdString

The Watermark template Id is optional and by default no watermark is added to the video. However, you can conveniently choose a template from the cloud-based management platform to easily add a watermark to your videos

transCodeTemplateIdString

Transcoding combination template ID, the default template set by the cloud on-demand management platform is used by default

subtitleIdString

Subtitle ID, corresponding to the material ID of Cloud VOD material management. After successful upload, subtitles will be automatically Transcoding and added; only ass or srt subtitle formats are supported.

subtitleString

Supports multiple subtitles, up to 13 subtitles can be added. Only supports multi- Bitrate adaptive Transcoding. Only supports vtt subtitle format. The format content is: lang: subtitle code, which can be defined according to your needs subtitleId: subtitle ID, corresponding to the material ID of Cloud VOD material management code[{"lang":"cn","subtitleId":"8a36dfe101921000368ac14400000000"},{"lang":"en-US","subtitleId":" 8a38e428019210004d56ef8c00000000"},{"lang":"ko","subtitleId":"8a36dfe101921000368ac14400000000"}] base64 encryption The subtitle language corresponding code of the console player. Language code Chinese: cn English: en-US Japanese:ja Traditional Chinese:zh-tw French:fr German: de Spanish: es Portuguese:pt Russian:ru Korean:ko Thai:th Vietnamese:vt Indonesian:id

Response

Body Params

NameDescription
codeInteger

success

messageString

message

dataString

data

Error code

Error code(code)Description(message)HTTP statusSemantic
1540

videoIds cannot be empty

200videoIds cannot be empty
1541

The videoIds contain special characters

200The videoIds contain special characters
1542

The videoIds provided cannot consist solely of commas.

200The videoIds provided cannot consist solely of commas.
1543

The watermark template name is too lengthy.

200The watermark template name is too lengthy.
1544

The combination name for transcoding exceeds the maximum length limit.

200The combination name for transcoding exceeds the maximum length limit.
1545

The given videoIds do not exist or are not within your scope of access!

200The given videoIds do not exist or are not within your scope of access!
1546

The watermark template does not exist

200The watermark template does not exist
1547

The transcoding combination template does not exist

200The transcoding combination template does not exist
1549

There are blocked videos in the list of videoIds.

200There are blocked videos in the list of videoIds.
1551

The default transcoding combination is non-existent

200The default transcoding combination is non-existent
1636

There are videos whose source files do not exist in videoIds

200There are videos whose source files do not exist in videoIds

Example

JSON
JSON
Request example
Copy Copy success
#!/bin/bash
username='example_username'
apiKey='example_apiKey'
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`
curl -i --url "https://api.cdnetworks.com/vod/videoManage/transCode" \
-X "POST" \
-u "$username:$password" \
-H "Date: $date" \
-H "x-cnc-auth-method: BASIC" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
	"videoIds":"XXXXXXXXXXX,YYYYYYYYYYY",
	"waterMarkTemplateName":"name1",
	"watermarkTemplateId":"id1",
	"transCodeTemplateId":"id2",
	"transCodeTemplateName":"name2"
}'
Response example
Copy Copy success
{
    "code": 200,
    "data": "",
    "message": "Operation succeeded"
}
Is the content of this document helpful to you?
Yes
I have suggestion
Submitted successfully! Thank you very much for your feedback, we will continue to strive to do better!