Use the transCode method to convert the specified video, mainly including transcoding the resolution and adding watermarks.
Name | Description |
---|---|
*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 |
Name | Description |
---|---|
codeInteger | success |
messageString | message |
dataString | data |
Error code(code) | Description(message) | HTTP status | Semantic |
---|---|---|---|
1540 | videoIds cannot be empty | 200 | videoIds cannot be empty |
1541 | The videoIds contain special characters | 200 | The videoIds contain special characters |
1542 | The videoIds provided cannot consist solely of commas. | 200 | The videoIds provided cannot consist solely of commas. |
1543 | The watermark template name is too lengthy. | 200 | The watermark template name is too lengthy. |
1544 | The combination name for transcoding exceeds the maximum length limit. | 200 | The combination name for transcoding exceeds the maximum length limit. |
1545 | The given videoIds do not exist or are not within your scope of access! | 200 | The given videoIds do not exist or are not within your scope of access! |
1546 | The watermark template does not exist | 200 | The watermark template does not exist |
1547 | The transcoding combination template does not exist | 200 | The transcoding combination template does not exist |
1549 | There are blocked videos in the list of videoIds. | 200 | There are blocked videos in the list of videoIds. |
1551 | The default transcoding combination is non-existent | 200 | The default transcoding combination is non-existent |
1636 | There are videos whose source files do not exist in videoIds | 200 | There are videos whose source files do not exist in videoIds |
#!/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"
}'
{
"code": 200,
"data": "",
"message": "Operation succeeded"
}