API Center

VideoClip

Update time: 2024-03-12 17:21:48

Applicable Products

Cloud VoD

API Description

Call videoClip to cut the uploaded video interval and convert key parameters.

Call frequency

Single user trigger frequency: 300/5min

We recommend you to use API Explorer

The API Explorer provides the ability of visual interface online call API, code examples generation, and API documents quickly search .Try it

Request parameter(s)

Body Params

NameDescription
*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

Response parameter(s)

Body Params

NameDescription
codeInteger
code
messageString
message
dataString
data

Error code

Error code(code)Description(message)HTTP statusSemantic
1561The video frame rate parameter is incorrect200The video frame rate parameter is incorrect
1562The audio sampling frequency parameter is incorrect200The audio sampling frequency parameter is incorrect
1563The video bit rate parameter is incorrect200The video bit rate parameter is incorrect
1564The audio bit rate parameter is incorrect200The audio bit rate parameter is incorrect
1565Resolution parameter error200Resolution parameter error
1566The video does not exist or has been deleted, or is not under your authority200The video does not exist or has been deleted, or is not under your authority
1567Video fails to cut200Video fails to cut
1601TRANSNO cannot be empty200TRANSNO cannot be empty
1602TRANSNO is not legal200TRANSNO is not legal

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/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
}'
Response example
Copy Copy success
{
  "code": 200,
  "data": "",
  "message": "操作成功"
}
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!