Call videoClip to cut the uploaded video interval and convert key parameters.
Name | Description |
---|---|
*transNoString | The length of the customer video clipping task must be less than or equal to 32 bits. The customer must ensure that it is globally unique on the customer platform |
*videoIdString | Video that needs to be edited |
*seekStartInteger | Specifies the start time for video interception, in seconds |
*durationInteger | Specifies the length of the video capture, in seconds |
*filenameString | Output video file name |
resolutionString | Output video resolution in wxh format, for example, 640x480 |
frameRateInteger | Video frame rate: The number of frames displayed per second (unit: Hertz). Commonly used frame rates: 24,25,30, etc |
videoBitRateInteger | Video bit rate, unit: kbit/s. Common video bit rate: 128,1250,5000, etc |
audioBitRateInteger | Audio bit rate, unit: kbit/s. Common bit rate: 64,128,192,256,320, etc |
tassamplingRatekIdInteger | Audio sampling frequency (unit: Hertz). Common sampling frequency: 8000,12050,22050,44100, etc. Note: flv only supports 4410220511025 |
notifyUrlString | The completion address used to receive callback information |
suffixString | Output format
Value range:
flv
mp4
Default flv |
enableVideoTranscodeInteger | Start forced transcoding, 1: start. 0: Do not start, the default is 0 |
Name | Description |
---|---|
codeInteger | code |
messageString | message |
dataString | data |
Error code(code) | Description(message) | HTTP status | Semantic |
---|---|---|---|
1561 | The video frame rate parameter is incorrect | 200 | The video frame rate parameter is incorrect |
1562 | The audio sampling frequency parameter is incorrect | 200 | The audio sampling frequency parameter is incorrect |
1563 | The video bit rate parameter is incorrect | 200 | The video bit rate parameter is incorrect |
1564 | The audio bit rate parameter is incorrect | 200 | The audio bit rate parameter is incorrect |
1565 | Resolution parameter error | 200 | Resolution parameter error |
1566 | The video does not exist or has been deleted, or is not under your authority | 200 | The video does not exist or has been deleted, or is not under your authority |
1567 | Video fails to cut | 200 | Video fails to cut |
1601 | TRANSNO cannot be empty | 200 | TRANSNO cannot be empty |
1602 | TRANSNO is not legal | 200 | TRANSNO is not legal |
#!/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/videoClip" \ -X "POST" \ -u "$username:$password" \ -H "Date: $date" \ -H "x-cnc-auth-method: BASIC" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -d '{ "transNo":"NO123456789", "videoId":"XXXXXXXXXXXXXXXXXXX", "seekStart":5, "duration":"25", "filename":"name1", "resolution":"640x480", "frameRate":"24", "videoBitRate":"128", "audioBitRate":"64", "tassamplingRatekId":"8000", "notifyUrl":"http://xxx.com/callback", "suffix":"mp4", "enableVideoTranscode":1 }'
{ "code": 200, "data": "", "message": "Operation succeeded" }