任务流状态变更

最近更新时间:2019-05-07 18:25:10

事件名称

ProcedureStateChanged

事件说明

当 App 配置了事件通知后,在任务流的状态发生变更后,App 后台即可通过“普通回调”或“可靠回调”的方式获取该事件通知。事件通知内容为 ProcedureTask 结构

示例

普通回调

如果选择普通回调模式,则回调 URL 会接收到来自点播的 HTTP POST 请求,BODY 内容如下所示。

{
    "EventType":"ProcedureStateChanged",
    "FileUploadEvent":null,
    "ProcedureStateChangeEvent":{
        "TaskId":"1256768367-Procedure-475b72xxxcb177t1",
        "Status":"FINISH",
        "ErrCode":0,
        "Message":"",
        "FileId":"5285890784246869930",
        "FileName":"动物世界",
        "FileUrl":"https://1256768367.vod2.myqcloud.com/xxx/xxx/xxx.mp4",
        "MetaData":{
            "AudioDuration":59.990001678467,
            "AudioStreamSet":[
                {
                    "Bitrate":383854,
                    "Codec":"aac",
                    "SamplingRate":48000
                }
            ],
            "Bitrate":1021028,
            "Container":"mov,mp4,m4a,3gp,3g2,mj2",
            "Duration":60,
            "Height":480,
            "Rotate":0,
            "Size":7700180,
            "VideoDuration":60,
            "VideoStreamSet":[
                {
                    "Bitrate":637174,
                    "Codec":"h264",
                    "Fps":23,
                    "Height":480,
                    "Width":640
                }
            ],
            "Width":640
        },
        "MediaProcessResultSet":[
            {
                "Type":"Transcode",
                "TranscodeTask":{
                    "Status":"SUCCESS",
                    "ErrCode":0,
                    "Message":"SUCCESS",
                    "Input":{
                        "Definition":20,
                        "WatermarkSet":null
                    },
                    "Output":{
                        "Url":"https://1256768367.vod2.myqcloud.com/xxx/xxx/v.f20.mp4",
                        "Size":4189073,
                        "Container":"mov,mp4,m4a,3gp,3g2,mj2",
                        "Height":480,
                        "Width":640,
                        "Bitrate":552218,
                        "Md5":"eff7031ad7877865f9a3240e9ab165ad",
                        "Duration":60.04700088501,
                        "VideoStreamSet":[
                            {
                                "Bitrate":503727,
                                "Codec":"h264",
                                "Fps":24,
                                "Height":480,
                                "Width":640
                            }
                        ],
                        "AudioStreamSet":[
                            {
                                "Bitrate":48491,
                                "Codec":"aac",
                                "SamplingRate":44100
                            }
                        ],
                        "Definition":0
                    }
                },
                "AnimatedGraphicTask":null,
                "SnapshotByTimeOffsetTask":null,
                "SampleSnapshotTask":null,
                "ImageSpriteTask":null,
                "CoverBySnapshotTask":null
            },
            {
                "Type":"CoverBySnapshot",
                "TranscodeTask":null,
                "AnimatedGraphicTask":null,
                "SnapshotByTimeOffsetTask":null,
                "SampleSnapshotTask":null,
                "ImageSpriteTask":null,
                "CoverBySnapshotTask":{
                    "Status":"SUCCESS",
                    "ErrCode":0,
                    "Message":"SUCCESS",
                    "Input":{
                        "Definition":10,
                        "PositionType":"Time",
                        "PositionValue":0,
                        "WatermarkSet":null
                    },
                    "Output":{
                        "CoverUrl":"http://1256768367.vod2.myqcloud.com/xxx/xxx/xxx.100_0.jpg"
                    }
                }
            }
        ],
        "AiContentReviewResultSet":null,
        "AiRecognitionResultSet":null
    },
    "FileDeleteEvent":null,
    "PullCompleteEvent":null,
    "EditMediaComplete":null,
    "WechatPublishComplete":null,
    "TranscodeCompleteEvent":null,
    "ConcatCompleteEvent":null,
    "ClipCompleteEvent":null,
    "CreateImageSpriteCompleteEvent":null,
    "SnapshotByTimeOffsetCompleteEvent":null
}

可靠回调

如果选择可靠回调模式,调用 拉取事件通知 API 会接收到如下形式的 HTTP 应答。

{
    "Response": {
        "EventSet": [
            {
                "EventHandle": "EventHandleX",
                "EventType": "ProcedureStateChanged",
                "FileUploadEvent": null,
                "ProcedureStateChangeEvent": {
                    "TaskId": "1256768367-Procedure-475b72xxxcb177t1",
                    "Status": "FINISH",
                    "FileId": "5285890784246869930",
                    "FileName": "动物世界",
                    "FileUrl": "https://1256768367.vod2.myqcloud.com/xxx/xxx/xxx.mp4",
                    "MetaData": {
                        "AudioDuration": 59.990001678467,
                        "AudioStreamSet": [{
                            "Bitrate": 383854,
                            "Codec": "aac",
                            "SamplingRate": 48000
                        }],
                        "Bitrate": 1021028,
                        "Container": "mov,mp4,m4a,3gp,3g2,mj2",
                        "Duration": 60,
                        "Height": 480,
                        "Rotate": 0,
                        "Size": 7700180,
                        "VideoDuration": 60,
                        "VideoStreamSet": [{
                            "Bitrate": 637174,
                            "Codec": "h264",
                            "Fps": 23,
                            "Height": 480,
                            "Width": 640
                        }],
                        "Width": 640
                    },
                    "MediaProcessResultSet": [{
                            "Type": "Transcode",
                            "TranscodeTask": {
                                "Status": "SUCCESS",
                                "ErrCode": 0,
                                "Message": "SUCCESS",
                                "Input": {
                                    "Definition": 20,
                                    "WatermarkSet": null
                                },
                                "Output": {
                                    "Url": "https://1256768367.vod2.myqcloud.com/xxx/xxx/v.f20.mp4",
                                    "Size": 4189073,
                                    "Container": "mov,mp4,m4a,3gp,3g2,mj2",
                                    "Height": 480,
                                    "Width": 640,
                                    "Bitrate": 552218,
                                    "Md5": "eff7031ad7877865f9a3240e9ab165ad",
                                    "Duration": 60.04700088501,
                                    "VideoStreamSet": [{
                                        "Bitrate": 503727,
                                        "Codec": "h264",
                                        "Fps": 24,
                                        "Height": 480,
                                        "Width": 640
                                    }],
                                    "AudioStreamSet": [{
                                        "Bitrate": 48491,
                                        "Codec": "aac",
                                        "SamplingRate": 44100
                                    }],
                                    "Definition": 0
                                }
                            },
                            "AnimatedGraphicTask": null,
                            "SnapshotByTimeOffsetTask": null,
                            "SampleSnapshotTask": null,
                            "ImageSpriteTask": null,
                            "CoverBySnapshotTask": null
                        },
                        {
                            "Type": "CoverBySnapshot",
                            "TranscodeTask": null,
                            "AnimatedGraphicTask": null,
                            "SnapshotByTimeOffsetTask": null,
                            "SampleSnapshotTask": null,
                            "ImageSpriteTask": null,
                            "CoverBySnapshotTask": {
                                "Status": "SUCCESS",
                                "ErrCode": 0,
                                "Message": "SUCCESS",
                                "Input": {
                                    "Definition": 10,
                                    "PositionType": "Time",
                                    "PositionValue": 0,
                                    "WatermarkSet": null
                                },
                                "Output": {
                                    "CoverUrl": "http://1256768367.vod2.myqcloud.com/xxx/xxx/xxx.100_0.jpg"
                                }
                            }
                        }
                    ],
                    "AiContentReviewResultSet": null,
                    "AiRecognitionResultSet": null
                },
                "FileDeleteEvent": null,
                "PullCompleteEvent": null,
                "EditMediaComplete": null,
                "WechatPublishComplete": null,
                "TranscodeCompleteEvent": null,
                "ConcatCompleteEvent": null,
                "ClipCompleteEvent": null,
                "CreateImageSpriteCompleteEvent": null,
                "SnapshotByTimeOffsetCompleteEvent": null
            }
        ],
        "RequestId": "335bdaa3-db0e-46ce-9946-51941d9cb0f5"
    }
}