API Center
Introduction
API-Key Authentication
AK/SK Authentication
Edge Application
CDN Pro
Edge Computing Hosting
IAM
Media Acceleration Live Broadcast
Media Acceleration-Live
Media Acceleration
Cloud Live
Low Latency Streaming
Cloud VoD
Media Processing
CreateClearAdTask
ClearAdTaskQuery
TransCode
VideoConcatQuery
VideoClip
VideoClipQuery
VideoConcat
Bandwidth Report
StatusCode Report
Upload Assets
Manage Assets
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 Check
Log Download
APM
Others

VideoClip

Update time: 2024-07-29 17:12:45

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

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

Request

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

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
#!/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
{
  "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!