综述
媒体处理中对视频发起的上传、删除、视频处理等操作,都可以被称为一个事件。由于媒体处理的转码、截图等操作属于算力密集型服务,执行任务需要一定的时间。因此在发起一个事件后,用户无法在第一时间获得任务结果,需要在事件结束后,通过回调通知的方式告知执行结果,即为事件通知。
事件通知类型
媒体处理支持以下几种事件通知:
通知类型 | 说明 |
---|
音视频转码完成 | 视频转码任务完成时,触发该事件。 |
审核完成 | 视频审核任务完成时,触发该事件。 |
视频截图完成 | 视频截图完成时,触发该事件。 |
视频拼接完成 | 视频拼接完成时,触发该事件。 |
事件通知详情
音视频转码完成
事件名称
TranscodeComplete
事件说明
音视频转码完成。
示例
{
"eventTime":"2017-03-20T07:49:17Z",
"eventType":"TranscodeComplete",
"workflowId":"1000010",
"taskId":"0003#96ea85118429465b99a794951ffd4310",
"originalFileUrl":"https://sample.gdoss.xstore.ctyun.cn/mediatest/1.mp4",
"status": "SUCCESS",
"taskMessage":"写入文件失败",
"transcodeInfo": {
"transcodeTemplateID": "100000000102",
"watermarkTemplateID": "100000000005",
"md5":"etdj945djdfkj",
"format": "mp4",
"size":1110000,
"bitrate": 925,
"duration": 15,
"transcodeFileUrl": "http://transcode.gdoss.xstore.ctyun.cn/ABEBDE1JSU79FD4D1329/62cb3151eba52js82j2da3b55bc5****.mp4",
"encrypt": false,
"streamInfo":[{
"streamType": "Video",
"fps": 30,
"height": 960,
"width": 540,
"codec":"H264"
},
{
"streamType": "Audio",
"sampleRate":"44100",
"codec":"AAC",
}
]
}
}
返回数据描述
名称 | 示例值 | 描述 |
---|
eventTime | 2017-03-20T07:49:17Z | 事件触发时间,为 UTC 时间,如 yyyy-MM-ddTHH:mm:ssZ。 |
eventType | TranscodeComplete | 回调事件类型。 |
workflowId | 1000010 | 工作流ID。 |
taskId | 0003#96ea85118429465b99a794951ffd4310 | 任务ID。 |
originalFileUrl | https://sample.gdoss.xstore.ctyun.cn/mediatest/1.mp4 | 源文件访问地址(不带签名,若为私有权限需使用带预签名url进行访问)。 |
status | SUCCESS | 任务状态:SUCCESS-成功;FAIL-失败;WARNING-警告(转码任务执行完毕,但可能存在问题。)。 |
taskMessage | 写入文件失败 | 回调信息:任务失败时为失败原因;成功时为:任务成功。 |
transcodeInfo | | 视频拼接结果详情。详细信息见表transcodeInfo。 |
表transcodeInfo
名称 | 示例值 | 描述 |
---|
transcodeTemplateID | 100000000102 | 转码模版ID。 |
watermarkTemplateID | 100000000021 | 水印模板ID,若没有进行水印转码则没有该字段。 |
md5 | etdj945djdfkj | 转码音视频目标文件md5值。 |
format | mp4 | 转码音/视频封装格式。 |
size | 1110000 | 转码音/视频大小,单位byte。 |
bitrate | bitrate | 转码音/视频 音/视频码率。 |
duration | 15 | 转码音/视频时长,单位s。 |
transcodeFileUrl | http://transcode.gdoss.xstore.ctyun.cn/ABEBDE1JSU79FD4D1329/62cb3151eba52js82j2da3b55bc5****.mp4 | 转码音/视频文件访问url。 |
encrypt | false | 是否加密(模板中暂时没有入口设置,均为默认值false,即不加密)。 |
streamInfo | | 音视频文件轨道信息。详细信息见表streamInfo。 |
表streamInfo
名称 | 示例值 | 描述 |
---|
streamType | Video | 音轨/视频轨:Video-视频轨;Audio-音频轨。 |
fps | 30 | 视频帧率,单位fps。 |
height | 960 | 视频分辨率(高)。 |
width | 540 | 视频分辨率(宽)。 |
codec | H264 | 音、视频编码方式。 |
sampleRate | 44100 | 音频采样率。 |
审核完成
事件名称
AIContentReviewComplete
事件说明
视频审核完成。
示例
{
"eventTime":"2017-03-20T07:49:17Z",
"eventType":"AIContentReviewComplete",
"workflowId":"1000010",
"taskId":"0003#fgty85118429465b99a794951ffd4310",
"originalFileUrl":"https://sample.gdoss.xstore.ctyun.cn/mediatest/1.mp4",
"status": "SUCCESS",
"taskMessage":"写入文件失败",
"aiVideoContentReviewInfo":{
"snapshot":{
"aiTimeList":["00.0", "10.0", "20.0"],
"aiSnapshotRegular":"https://sampleout.gdoss.xstore.ctyun.cn/outputdir/test-video-selfdes-{time}.jpg"
},
"porn":{
"status":"SUCCESS",
"output":{
"label":"sexy",
"segmentSet":[{
"confidence":98,
"label":"sexy",
"url":"https://sample.gdoss.xstore.ctyun.cn/xxx/xxx/xx1.jpg"
}]
}
},
"terrorism":{
"status":"SUCCESS",
"output":{
"label":"normal"
}
},
}
}
返回数据描述
名称 | 示例值 | 描述 |
---|
eventTime | 2017-03-20T07:49:17Z | 事件触发时间,为 UTC 时间,如 yyyy-MM-ddTHH:mm:ssZ。 |
eventType | AIContentReviewComplete | 回调事件类型。 |
workflowId | 1000010 | 工作流ID。 |
taskId | 0003#fgty85118429465b99a794951ffd4310 | 任务ID类型。 |
originalFileUrl | https://sample.gdoss.xstore.ctyun.cn/mediatest/1.mp4 | 源文件访问地址(不带签名,若为私有权限需使用带预签名url进行访问)。 |
status | SUCCESS | 任务状态:SUCCESS-成功;FAIL-失败。 |
taskMessage | 写入文件失败 | 回调信息:任务失败时为失败原因;成功时为:任务成功。 |
aiVideoContentReviewInfo | | |
表aiVideoContentReviewInfo
名称 | 示例值 | 描述 |
---|
snapshot | | AI审核截图的完整数据集。详细信息见表snapshot。 |
porn | | 鉴黄结果,若进行鉴黄审核才有该字段。详细信息见表porn。 |
terrorism | | 鉴恐结果,若进行鉴恐审核才有该字段。详细信息见表terrorism。 |
表snapshot
名称 | 示例值 | 描述 |
---|
aiTimeList | ["00.0", "10.0", "20.0"] | 审核时间点。 |
aiSnapshotRegular | https://sampleout.gdoss.xstore.ctyun.cn/outputdir/test-video-selfdes-{time}.jpg | AI审核截图的完整数据集。 |
表porn
名称 | 示例值 | 描述 |
---|
status | SUCCESS | 审核结果状态。 |
output | | 详细的输出结果。详细信息见表porn-output。 |
表porn-output
名称 | 示例值 | 描述 |
---|
label | sexy | 主标签:normal-正常;sexy-性感;porn-色情。 |
segmentSet | | segmentSet中仅会列出高于用户设置类型阈值的图片集。详细信息见表porn-output-segmentSet。 |
表pron-output-segmentSet
名称 | 示例值 | 描述 |
---|
confidence | 98 | 置信区间评分。0-100分 |
label | sexy | 子标签 "根据主标签的二级分类"。 |
url | https://sample.gdoss.xstore.ctyun.cn/xxx/xxx/xx1.jpg | 违规视频的图片地址。需要携带签名访问。 |
表terrorism
名称 | 示例值 | 描述 |
---|
status | SUCCESS | 审核结果状态。 |
output | | 详细的输出结果。详细信息见表terrorism-output。 |
表terrorism-output
名称 | 示例值 | 描述 |
---|
label | normal | 主标签:normal-正常;terrorism-暴恐。 |
segmentSet | | segmentSet中仅会列出高于用户设置类型阈值的图片集。详细信息见表terrorism-output-segmentSet。 |
表terrorism-output-segmentSet
名称 | 示例值 | 描述 |
---|
confidence | 98 | 置信区间评分。0-100分 |
label | normal | 子标签 "根据主标签的二级分类"。 |
url | https://sample.gdoss.xstore.ctyun.cn/xxx/xxx/xx1.jpg | 违规视频的图片地址。需要携带签名访问。 |
视频截图完成
事件名称
SnapshotComplete
事件说明
视频截图完成。
示例
{
"eventTime":"2017-03-20T07:49:17Z",
"eventType":"SnapshotComplete",
"workflowId":"1000010",
"taskId":"0003#de3485118429465b99a794951ffd4310",
"originalFileUrl":"https://sample.gdoss.xstore.ctyun.cn/mediatest/1.mp4",
"status": "SUCCESS",
"taskMessage":"写入文件失败",
"snapshotInfo":{
"snapshotTemplateID": "100000000102",
"watermarkTemplateID": "100000000005",
"snapshotType": "NormalSnapshot",
"timeList": ["00.0", "10.0", "20.0"],
"snapshotRegular": "https://sample.gdoss.xstore.ctyun.cn/990f3820db2948b5b4a13d65d9a4****-{time}.jpg",
"webVTTUrl": "https://sample.gdoss.xstore.ctyun.cn/990f3820db2948b5b4a13d65.vtt"
}
}
返回数据描述
名称 | 示例值 | 描述 |
---|
eventTime | 2017-03-20T07:49:17Z | 事件触发时间,为 UTC 时间,如 yyyy-MM-ddTHH:mm:ssZ。 |
eventType | SnapshotComplete | 回调事件类型。 |
workflowId | 1000010 | 工作流ID。 |
taskId | 0003#fgty85118429465b99a794951ffd4310 | 任务ID类型。 |
originalFileUrl | https://sample.gdoss.xstore.ctyun.cn/mediatest/1.mp4 | 源文件访问地址(不带签名,若为私有权限需使用带预签名url进行访问)。 |
status | SUCCESS | 任务状态:SUCCESS-成功;FAIL-失败。 |
taskMessage | 写入文件失败 | 回调信息:任务失败时为失败原因;成功时为:任务成功。 |
snapshotInfo | | 视频截图结果详情。详细信息见表snapshotInfo。 |
表snapshotInfo
名称 | 示例值 | 描述 |
---|
snapshotTemplateID | 100000000102 | 截图模版ID。 |
watermarkTemplateID | 100000000021 | 水印模板ID,若没有进行水印截图则没有该字段。 |
snapshotType | NormalSnapshot | 截图类型: NormalSnapshot-时间点截图;SpriteSnapshot-雪碧截图;WebVTTSnapshot-WebVTT截图;SampleSnapshot-采样截图。 |
timeList | ["00.0", "10.0", "20.0"] | 截图图片时间点序列。 |
snapshotRegular | https://sample.gdoss.xstore.ctyun.cn/990f3820db2948b5b4a13d65d9a4****-{time}.jpg | 截图访问通用地址,使用timeList中元素替换time即为某时间点图片访问地址。 |
webVTTUrl | https://sample.gdoss.xstore.ctyun.cn/990f3820db2948b5b4a13d65.vtt | WebVTT地址,WebVTT截图时才有该字段。 |
视频拼接完成
事件名称
StitchingComplete
事件说明
视频拼接完成。
示例
{
"eventTime":"2022-10-13T18:06:16Z",
"eventType":"StitchingComplete",
"workflowId":"1000010",
"taskId":"0003#96ea85118429465b99a794951ffd4310",
"originalFileUrl":"https://sample.gdoss.xstore.ctyun.cn/mediatest/1.mp4",
"status": "SUCCESS",
"taskMessage":"写入文件失败",
"stitchingInfo": {
"stitchingTemplateID": "100000000102",
"watermarkTemplateID": "100000000005",
"md5":"etdj945djdfkj",
"format": "mp4",
"size":1110000,
"bitrate": 925,
"duration": 15,
"stitchingFileUrl": "https://transcode.gdoss.xstore.ctyun.cn/ABEBDE1JSU79FD4D1329/62cb3151eba52js82j2da3b55bc5****.mp4",
"streamInfo":[{
"streamType": "Video",
"fps": 30,
"height": 960,
"width": 540,
"codec":"H264"
},
{
"streamType": "Audio",
"codec":"AAC",
}
]
}
}
返回数据描述
名称 | 示例值 | 描述 |
---|
eventTime | 2017-03-20T07:49:17Z | 事件触发时间,为 UTC 时间,如 yyyy-MM-ddTHH:mm:ssZ。 |
eventType | StitchingComplete | 回调事件类型。 |
workflowId | 1000010 | 工作流ID。 |
taskId | 0003#96ea85118429465b99a794951ffd4310 | 任务ID。 |
originalFileUrl | https://sample.gdoss.xstore.ctyun.cn/mediatest/1.mp4 | 源文件访问地址(不带签名,若为私有权限需使用带预签名url进行访问)。 |
status | SUCCESS | 任务状态:SUCCESS-成功;FAIL-失败。 |
taskMessage | 写入文件失败 | 回调信息:任务失败时为失败原因;成功时为:任务成功。 |
stitchingInfo | | 视频拼接结果详情。详细信息见表stitchingInfo。 |
表stitchingInfo
名称 | 示例值 | 描述 |
---|
stitchingTemplateID | 100000000102 | 拼接模版ID。 |
watermarkTemplateID | 100000000021 | 水印模板ID,若没有进行水印拼接则没有该字段。 |
md5 | etdj945djdfkj | 拼接音视频目标文件md5值。 |
format | mp4 | 拼接音/视频封装格式。 |
size | 1110000 | 拼接音/视频大小,单位byte。 |
bitrate | bitrate | 拼接音/视频 音/视频码率。 |
duration | 15 | 拼接音/视频时长,单位s。 |
stitchingFileUrl | http://transcode.gdoss.xstore.ctyun.cn/ABEBDE1JSU79FD4D1329/62cb3151eba52js82j2da3b55bc5****.mp4 | 拼接后音/视频文件访问url。 |
streamInfo | | 音视频文件轨道信息。详细信息见表streamInfo。 |
表streamInfo
名称 | 示例值 | 描述 |
---|
streamType | Video | 音轨/视频轨:Video-视频轨;Audio-音频轨。 |
fps | 30 | 视频帧率,单位fps。 |
height | 960 | 视频分辨率(高)。 |
width | 540 | 视频分辨率(宽)。 |
codec | H264 | 音、视频编码方式。 |
sampleRate | 44100 | 音频采样率。 |
工作流回调
操作步骤
登录媒体存储控制台,点击左侧导航栏的【媒体处理】–【工作流管理】,进入“工作流管理”界面。选择新建或修改一条工作流,在第一步【输入设置】中,找到【工作流回调】的配置入口,填入您需要接收回调的地址即可。回调事件将以HTTP POST方法,以json格式返回回调数据。
重新发起回调
操作步骤
登录媒体存储控制台,点击左侧导航栏的【媒体处理】-【任务管理】-【转码任务】(或【拼接任务】),找到需要重新发起回调的任务。在该任务的操作栏点击【回调重试】即可重新发起回调。
如本次重试回调失败,您可以在【回调状态】栏点击叹号图标,查看由回调接收服务返回的响应信息。请注意,本功能仅在当前页面发起重试时有效。如您在发起重试以后关闭当前页面,则无法再返回本次回调的调试信息。请在发起调测时保持该页面开启。