视频转码完成

最后更新时间:2020-10-20 16:56:21

    注意:

    • 本文档为3.0版本的格式回调,2.0版本的历史格式回调请参见 历史格式回调 文档。
    • 建议您将回调版本逐步迁移到3.0格式,2.0格式回调的文档将不再维护。

    事件名称

    TranscodeComplete

    事件说明

    当 App 配置了事件通知,并且在视频转码完成后,App 后台即可通过“普通回调”或“可靠回调”的方式获取该事件通知。事件通知内容为 TranscodeTask2017 结构

    普通回调

    如果选择普通回调模式,则回调 URL 会接收到如下形式的 HTTP 请求。

    {
        "EventType":"TranscodeComplete",
        "FileUploadEvent":null,
        "ProcedureStateChangeEvent":null,
        "FileDeleteEvent":null,
        "PullCompleteEvent":null,
        "EditMediaComplete":null,
        "WechatPublishComplete":null,
        "TranscodeCompleteEvent":{
            "TaskId":"Transcode-f5ac8127b3b6b85cdc13f237c6005d8",
            "ErrCode":0,
            "Message":"SUCCESS",
            "FileId":"24961954183923290",
            "FileName":"动物世界",
            "Duration":599,
            "CoverUrl":"http://125676836723.vod2.myqcloud.com/0/xxx/640.jpg",
            "PlayInfoSet":[
                {
                    "Url":"http://125676836723.vod2.myqcloud.com/xxx/xxx/f0.mp4",
                    "Definition":0,
                    "Bitrate":246000,
                    "Height":480,
                    "Width":640
                },
                {
                    "Url":"http://125676836723.vod2.myqcloud.com/xxx/xxx/f10.mp4",
                    "Definition":10,
                    "Bitrate":149193,
                    "Height":240,
                    "Width":320
                },
                {
                    "Url":"http://125676836723.vod2.myqcloud.com/xxx/xxx/f20.mp4",
                    "Definition":20,
                    "Bitrate":297656,
                    "Height":480,
                    "Width":640
                },
                {
                    "Url":"http://125676836723.vod2.myqcloud.com/xxx/xxx/f30.mp4",
                    "Definition":30,
                    "Bitrate":899976,
                    "Height":960,
                    "Width":1280
                }
            ]
        },
        "ConcatCompleteEvent":null,
        "ClipCompleteEvent":null,
        "CreateImageSpriteCompleteEvent":null,
        "SnapshotByTimeOffsetCompleteEvent":null
    }

    可靠回调

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

    {
        "Response":{
            "EventSet":[
                {
                    "EventHandle":"EventHandle.N",
                    "EventType":"TranscodeComplete",
                    "FileUploadEvent":null,
                    "ProcedureStateChangeEvent":null,
                    "FileDeleteEvent":null,
                    "PullCompleteEvent":null,
                    "EditMediaComplete":null,
                    "WechatPublishComplete":null,
                    "TranscodeCompleteEvent":{
                        "TaskId":"Transcode-f5ac8127b3b6b85cdc13f237c6005d8",
                        "ErrCode":0,
                        "Message":"SUCCESS",
                        "FileId":"24961954183923290",
                        "FileName":"动物世界",
                        "Duration":599,
                        "CoverUrl":"http://125676836723.vod2.myqcloud.com/0/xxx/640.jpg",
                        "PlayInfoSet":[
                            {
                                "Url":"http://125676836723.vod2.myqcloud.com/xxx/xxx/f0.mp4",
                                "Definition":0,
                                "Bitrate":246000,
                                "Height":480,
                                "Width":640
                            },
                            {
                                "Url":"http://125676836723.vod2.myqcloud.com/xxx/xxx/f10.mp4",
                                "Definition":10,
                                "Bitrate":149193,
                                "Height":240,
                                "Width":320
                            },
                            {
                                "Url":"http://125676836723.vod2.myqcloud.com/xxx/xxx/f20.mp4",
                                "Definition":20,
                                "Bitrate":297656,
                                "Height":480,
                                "Width":640
                            },
                            {
                                "Url":"http://125676836723.vod2.myqcloud.com/xxx/xxx/f30.mp4",
                                "Definition":30,
                                "Bitrate":899976,
                                "Height":960,
                                "Width":1280
                            }
                        ]
                    },
                    "ConcatCompleteEvent":null,
                    "ClipCompleteEvent":null,
                    "CreateImageSpriteCompleteEvent":null,
                    "SnapshotByTimeOffsetCompleteEvent":null
                }
            ],
            "RequestId": "335bdaa3-db0e-46ce-9946-51941d9cb0f5"
        }
    }