Last update:2025-03-21 14:37:32
This document explains how our service sends secure notifications about your media processing tasks. We provide a verification mechanism to ensure these notifications are authentic and include detailed information about the processing results.
To protect your security, we include an Authorization
header with every notification request. This allows you to verify that notifications are legitimate and come from our service.
<AccessKey>:URLSAFE_BASE64(HMAC_SHA1(NotifyUrlWithOutQuery + "\n" + NotifyBody, SecretKey))
Where:
AccessKey
is your account’s access keyNotifyBody
is the notification contentSecretKey
is your account’s secret keyImportant: We randomly select one valid pair of AccessKey (AK) and AccessKey Secret (SK) from your account to generate the Authorization value. You should maintain a record of all your Access Keys and Access Key Secrets to authenticate callback notifications by matching the AccessKey used in the request.
When you configure a NotifyUrl
, our service sends JSON-formatted notifications to this endpoint after processing your media. The notification content is URL-safe Base64-encoded and contains comprehensive information about your processing tasks.
Your callback URL must:
Field Name | Type | Description |
---|---|---|
id |
string | The persistentId of your media processing task |
code |
int | Task status code: • 1 - Some tasks still running, others completed • 2 - Some tasks encountered errors, others completed or in progress • 3 - All tasks successful |
desc |
string | Description corresponding to the status code |
separate |
string | Notification type: • 0 - One-time notification • 1 - One of multiple separate notifications |
inputkey |
string | Original file name |
inputbucket |
string | Bucket containing the original file |
inputfsize |
int | Original file size (bytes) |
items |
array | Status information for each operation |
Each item in the items
array contains:
Field Name | Type | Description |
---|---|---|
cmd |
string | Operation command (fops) |
code |
string | Processing result code: • 2 - Failed • 3 - Successful |
costTime |
int | Transcoding time in seconds (defaults to 0) |
desc |
string | Description of the operation result |
error |
string | Error details (if processing failed) |
fsize |
int | Size of the output media (bytes) |
hash |
string | Hash value of the result |
key |
string | Result key (format: bucketName:key ) |
url |
string | Access URL for the transcoded media |
duration |
double | Duration of the transcoded media (seconds) |
bit_rate |
string | Bitrate of the transcoded media |
resolution |
string | Resolution of the transcoded video |
detail |
array | Details for each media output when multiple outputs exist |
Field Name | Type | Description |
---|---|---|
fsize |
int | Size of the transcoded media file (for m3u8 format, size of manifest file) |
tssize |
int | Total size of ts files for m3u8 output (0 for other formats) |
hash |
string | Hash value of the output |
key |
string | Output key (format: bucketName:key ) |
url |
string | Access URL for the output |
duration |
double | Duration of the output (seconds) |
bit_rate |
string | Bitrate of the output |
resolution |
string | Resolution of the output video |
{
"id": "2c90802745ee87870145ef1430f90006",
"code": 3,
"desc": "operate [\"avthumb/flv\"] is finish",
"separate": 0,
"inputkey": "aaa.flv",
"inputbucket": "chenqltesttwo",
"inputfsize": 20000,
"items": [
{
"cmd": "avthumb/flv",
"code": "3",
"costTime": 0,
"desc": "finish",
"error": null,
"fsize": 20000,
"hash": "FlWvHsc-CK6miygKCcLjCaQ5csNO",
"key": "chenqltesttwo:aaa.flv",
"url": "http://chenqltesttwo.com/aaa.flv",
"duration": 198.083,
"bit_rate": "1288025",
"resolution": "1280X720",
"detail": [
{
"fsize": 20000,
"tssize": 1024,
"hash": "FlWvHsc-CK6miygKCcLjCaQ5csNO",
"key": "chenqltesttwo:aaa.flv",
"url": "http://chenqltesttwo.com/aaa.flv",
"duration": 198.083,
"bit_rate": "1288025",
"resolution": "1280X720"
}
]
}
]
}