Video Trimming

最終更新日:2022-01-07 14:31:27

Description

This interface allows us to trim the video with specific duration and to convert the key parameters.

Request Description

Request method POST/GET
Interface Address https://api.cloudv.haplat.net/vod/videoManage/videoClip
If token is needed The verification token is needed

Request Parameter

Parameter Type Required Remarks
transNo string Yes The transaction ID of trimming task, the length of the ID should be less than or equal to 32 charaters. Please ensure that this ID is globally unique.
videoId string Yes The video need to be trimmed.
seekStart int Yes Start timestamp for video trimming. Unit: second
duration int Yes The duration for video trimming. Unit: second.
filename string Yes Output video file name.
resolution string no The output video resolution, the format is width x height, for example: 640x480.
frameRate int no Video frame rate, the number of frames displayed per second, unit: Hertz (Hz). Frequently used frame rates: 24, 25, 30, etc.
videoBitRate int no Video bitrate, unit: kbit/s. Frequently used video bitrates: 128, 1250, 5000, etc.
audioBitRate int no Audio bitrate, unit: kbit/s. Frequently used audio bitrates: 64, 128, 192, 256, 320, etc.
samplingRate int no Audio sampling rate, unit: Hertz (Hz). Frequently used sampling rate: 8000, 12050, 22050, 44100, etc.
Note: flv only supports 44k, 22k, 11k.
notifyUrl string no The address/URL to receive callback information
suffix string no Supported output format :
.flv
.mp4
By default, it is flv

Return parameter

The details of general return results can be found at Return Result.

Example

Input example

curl -X POST http://api.cloudv.haplat.net:8080/vod/videoManage/videoClip
  -H 'content-type: application/x-www-form-urlencoded; charset=utf-8' 
  -H "Host: api.cloudv.haplat.net" 
  <公共的头部参数>
  <自定义的头部参数> -d 'videoId=DB7830C077D1CF9B9155892819DB8B29&transNo=0123456789&seekStart=10&duration=20&filename=testFilename&resolution=100x100&frameRate=15&videoBitRate=300&audioBitRate=64&samplingRate=44100&notifyUrl=http://customer/callback/url'

Notes: For the “public parameter” in the example, please refer to Common Parameters.

Error code

The following error codes are related to interface service logic. And for common code please refer to Return Result.

Error code Description
1561 Video frame rate parameter error
1562 Audio sampling rate parameter error
1563 Video bitrate parameter error
1564 Audio bitrate parameter error
1565 Resolution parameter error
1566 The video does not exist or has been deleted, or you don’t have permission to access to the videos!
1567 The video cannot be trimmed
1601 transNo cannot be empty
1602 transNo is illegal