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 |
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" }