VideoClip

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

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

  • Limit of request rate per user: 300/5min
  • Applicable Products: Cloud VoD
For API authentication details, please refer to: API Authentication Overview

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
1561

The video frame rate parameter is incorrect

200The video frame rate parameter is incorrect
1562

The audio sampling frequency parameter is incorrect

200The audio sampling frequency parameter is incorrect
1563

The video bit rate parameter is incorrect

200The video bit rate parameter is incorrect
1564

The audio bit rate parameter is incorrect

200The audio bit rate parameter is incorrect
1565

Resolution parameter error

200Resolution parameter error
1566

The video does not exist or has been deleted, or is not under your authority

200The video does not exist or has been deleted, or is not under your authority
1567

Video fails to cut

200Video fails to cut
1601

TRANSNO cannot be empty

200TRANSNO cannot be empty
1602

TRANSNO is not legal

200TRANSNO 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": "Operation succeeded"
}
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!