CDNetworks Documentation Cloud Storage Audio/Video Processing (avthumb)

Audio/Video Processing (avthumb)

Last update:2020-07-06 14:00:18

Description

This interface allows you to perform encoding and format conversion operations for audio/video resources stored on the platform.

Request Description

POST /fops
Host: < MgrDomain>
Authorization:< AccessToken>

Header Description

Parameter Description

Request parameters are organized in the following format and submitted as request content:

bucket=<Urlsafe_Base64_Encoded_Bucket>&key=<Urlsafe_Base64_Encoded_Key>&fops=<Urlsafe_Base64_Encoded_Fops>&notifyURL=<Urlsafe_Base64_Encoded_PersistentNotifyUrl>&force=<Force>&separate=<Separate>

Parameter Required Description
bucket Yes Bucket name.
key Yes File name.
fops Yes List of processing parameters. For the meanings of the parameters, see the [Audio/Video Processing Ops Parameter Format] (#/help/details/31/3703#goto_Audio/Video Processing); processing multiple requests simultaneously is supported. Parameter lists are separated with the semicolon ;.
notifyURL No URL for receiving notifications on processing results. See the [Notification Data Content Description] (#/help/details/31/3701#goto_Notification Data Description).
force No Whether or not to force execution of data processing. Setting the following values is supported:
0: If the specified data processing result exists, then the return file already exists and no processing is performed. This can avoid a waste of resources due to repeated processing.
1: Forces the execution of data processing and overwrites the existing file.
0 by default.
separate No Whether or not to provide separate processing notifications. Setting the following values is supported:
0: Indicates that notifyURL is notified in one go upon the completion of the execution of all transcoding instructions.
1: Indicates that notifyURL is notified upon the completion of the execution of each transcoding instruction.
0 by default.
fops Parameter Example

Video transcoding:

fops=Urlsafe_Base64_Encode(avthumb/mp4/vb/64k;avthumb/flv/vb/64k)

Video cropping:

fops=Urlsafe_Base64_Encode(avthumb/m4a/gravity/CENTER/vcrop/100x200;avthumb/flv/gravity/CENTER/vcrop/100x200)

Response Description
If a request is successful, a JSON string of the following content will be returned:

{ "persistentId": <persistentId> }

Field name Required Description
persistentId Yes Uploads preprocessing or process ID that triggers persistent processing.
If a request fails, a JSON character string of the following content will be returned:

{
    "code":     "<httpCode  int>",
    "message":   "<errMsg string>"
}

Field name Required Description
code Yes HTTP request response code. Refer to the [HTTP Response Status Codes] (#/help/details/31/3705)
message Yes Prompt message when audio/video processing fails.
Example
curl -v -X POST -d"bucket=aW1hZ2Vz&key=bGVodS5tcDQ==&fops=YXZ0aHVtYi9mbHYvcy80ODB4Mzg0fHNhdmVhcy9hVzFoWjJWek9tZHFhQzVtYkhZPQ==&force=1&separate=1" -H “Authorization:86622e227a50d49d858c2494a935bc2e4ac543a7:Y2JmMGY0YTNhZmQxZmVlZGM2ZTA0YTdjNTcyOWQ1NjRkNTExYjg0Yg==” --url “http://mgrDomain/fops”

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!