API Center
Introduction
API-Key Authentication
AK/SK Authentication
APM
Edge Application
CDN Pro
Edge Computing Hosting
IAM
Media Acceleration Live Broadcast
Media Acceleration-Live
Media Acceleration
Cloud Live
Low Latency Streaming
Cloud VoD
Bandwidth Report
StatusCode Report
Upload Assets
Manage Assets
Media Processing
CreateClearAdTask
ClearAdTaskQuery
TransCode
VideoConcatQuery
VideoClip
VideoClipQuery
VideoConcat
StartWorkflow
Playback
API Shield
Application Shield
Web Application Firewall
Flood Shield
Cloud Security 2.0
Bot Shield
Flood Shield 2.0
Dynamic Web Acceleration
Content Acceleration
CloudDNS
Object Storage
Local Storage
Certificate MGMT
Content MGMT
IP Verification
Cloud Monitor
Log Download
Others

TransCode

Update time: 2025-03-27 10:10:52

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

  • Single user trigger frequency: 300/5min
  • Applicable Products: Cloud VoD

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
1540videoIds cannot be empty200videoIds cannot be empty
1541The videoIds contain special characters200The videoIds contain special characters
1542The videoIds provided cannot consist solely of commas.200The videoIds provided cannot consist solely of commas.
1543The watermark template name is too lengthy.200The watermark template name is too lengthy.
1544The combination name for transcoding exceeds the maximum length limit.200The combination name for transcoding exceeds the maximum length limit.
1545The 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!
1546The watermark template does not exist200The watermark template does not exist
1547The transcoding combination template does not exist200The transcoding combination template does not exist
1549There are blocked videos in the list of videoIds.200There are blocked videos in the list of videoIds.
1551The default transcoding combination is non-existent200The default transcoding combination is non-existent
1636There are videos whose source files do not exist in videoIds200There are videos whose source files do not exist in videoIds

Example

JSON
JSON
Request example
Copy
#!/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
{
    "code": 200,
    "data": "",
    "message": "Operation succeeded"
}

Directory

  • Request
  • Response
  • Error code
  • Example
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!