查询任务详情

最近更新时间:2019-01-30 15:54:18

接口名称

GetTaskInfo

功能说明

  1. 该接口用于获取任务的执行情况。
  2. 只能查询到三天(72小时)内的任务。

请求方式

请求域名

vod.api.qcloud.com

最高调用频率

100次/分钟

参数说明

参数名称 必填 类型 说明
vodTaskId String 任务 ID
COMMON_PARAMS 参见 公共参数

请求示例

https://vod.api.qcloud.com/v2/index.php?Action=GetTaskInfo
&vodTaskId=1251989944-Procedure-d7c9631c15ecf653b1ff67e34cb04692
&COMMON_PARAMS

接口应答

参数说明

参数名称 类型 说明
code Integer 错误码, 0:成功, 其他值:失败。
message String 错误信息
type String 任务类型,目前有:
  • Procedure(任务流)
  • transcode(转码)
  • clip_media(剪辑)
  • concatFile(拼接)
  • snapShotByTime(截图)
  • imageSprite(雪碧图)
status String 任务状态,有 WAITING/PROCESSING/FINISH 三种。
createTime Integer 任务创建时间(Unix 时间戳)。
beginProcessTime Integer 任务开始执行的时间(Unix 时间戳),若任务还在排队中,该值为0。
finishTime Integer 任务信息最近更新时间(Unix 时间戳),若任务还未完成,该值为0。
data Object 任务详细信息,type 的值不同,data 数据也不相同,当 status 为 WAITING,该字段不存在。

data说明

错误码说明

错误码 含义说明
4000-7000 参见 公共错误码
1000 参数非法
70014 任务不存在
10027 系统内部错误

应答示例-当任务类型为任务流(procedure)

{
    "code": 0,
    "message": "",
    "type": "procedure",
    "status":"PROCESSING",
    "createTime": 1485156352,
    "beginProcessTime": 1485156354,
    "finishTime": 1485156352,
    "data": {
        "errCode": 0,
        "fileId": "24961954183381008",
        "metaData": {
            "size": 10556,
            "container": "m4a",
            "bitrate": 246035,
            "height": 480,
            "width": 640,
            "md5": "b3ae6ed07d9bf4efeeb94ed2d37ff3e3",
            "duration": 3601,
            "videoStreamList": [
                {
                    "bitrate": 246000,
                    "height": 480,
                    "width": 640,
                    "codec": "h264",
                    "fps": 22
                }
            ],
            "audioStreamList": [
                {
                    "codec": "aac",
                    "samplingRate": 44100,
                    "bitrate": 35
                }
            ]
        },
        "drm": {
            "definition": 10,
            "getKeyUrl": "https://123.xxx.com/getkey",
            "keySource": "VodBuildInKMS",
            "edkList": [
                "232abc30"
            ]
        },
        "processTaskList": [
            {
                "taskType": "Transcode",
                "status": "PROCESSING",
                "errCode": 0,
                "message": "",
                "input": {
                    "definition": 10,
                    "watermark": 1
                }
            },
            {
                "taskType": "Transcode",
                "status": "SUCCESS",
                "errCode": 0,
                "message": "",
                "input": {
                    "definition": 20,
                    "watermark": 1
                },
                "output": {
                    "url": "http://125xx.vod2.myqcloud.com/9fcd41e6vodgzp1251953760/7585975f9031868222912340/f20.mp4",
                    "size": 10556,
                    "container": "m4a",
                    "md5": "b3ae6ed07d9bf4efeeb94ed2d37ff3e3",
                    "bitrate": 246035,
                    "height": 480,
                    "width": 640,
                    "duration": 3601,
                    "videoStreamList": [
                        {
                            "bitrate": 246000,
                            "height": 480,
                            "width": 640,
                            "codec": "h264",
                            "fps": 222
                        }
                    ],
                    "audioStreamList": [
                        {
                            "codec": "aac",
                            "samplingRate": 44100,
                            "bitrate": 35
                        }
                    ]
                }
            },
            {
                "taskType": "SampleSnapshot",
                "status": "SUCCESS",
                "errCode": 0,
                "message": "",
                "input": {
                    "definition": 10
                },
                "output": {
                    "imageUrls": [
                        "http://125xx.vod2.myqcloud.com/vodtrans125xx/14508071098244929440/shotup/xx1.png",
                        "http://125xx.vod2.myqcloud.com/vodtrans125xx/14508071098244929440/shotup/xx2.png",
                        "http://125xx.vod2.myqcloud.com/vodtrans125xx/14508071098244929440/shotup/xx3.png",
                        "http://125xx.vod2.myqcloud.com/vodtrans125xx/14508071098244929440/shotup/xx4.png",
                        "http://125xx.vod2.myqcloud.com/vodtrans125xx/14508071098244929440/shotup/xx5.png",
                        "http://125xx.vod2.myqcloud.com/vodtrans125xx/14508071098244929440/shotup/xx6.png",
                        "http://125xx.vod2.myqcloud.com/vodtrans125xx/14508071098244929440/shotup/xx7.png",
                        "http://125xx.vod2.myqcloud.com/vodtrans125xx/14508071098244929440/shotup/xx8.png",
                        "http://125xx.vod2.myqcloud.com/vodtrans125xx/14508071098244929440/shotup/xx9.png",
                        "http://125xx.vod2.myqcloud.com/vodtrans125xx/14508071098244929440/shotup/xx10.png"
                    ]
                }
            },
            {
                "taskType": "CoverBySnapshot",
                "status": "SUCCESS",
                "errCode": 0,
                "message": "",
                "input": {
                    "definition": 10,
                    "position": 10,
                    "positionType": "Percent"
                },
                "output": {
                    "imageUrl": "http://125xx.vod2.myqcloud.com/vodtrans125xx/14508071098244929440/shotup/xx1.png"
                }
            }
        ]
    }
}

应答示例-当任务类型为转码(transcode)

{
    "code": 0,
    "message": "",
    "type": "transcode",
    "status":"PROCESSING",
    "createTime": 1485156352,
    "beginProcessTime": 1485156354,
    "finishTime": 1485156352,
    "data": {
        "errCode": 0,
        "fileId": "14508071098244931831",
        "fileName": "13425173277_2015-09-06-19-06-11_2015-09-06-19-16-11",
        "duration": 599,
        "coverUrl": "http://p.qpic.cn/videoyun/0/1203_8a5015084d4f47cd9a0bc5ecfe78aecb_1/640",
        "playSet": [
            {
                "url": "http://vcloud1203.tc.qq.com/1203_8a5015084d4f47cd9a0bc5ecfe78aecb.f0.mp4",
                "definition": 0,
                "vbitrate": 246000,
                "vheight": 480,
                "vwidth": 640
            },
            {
                "url": "http://vcloud1203.tc.qq.com/1203_8a5015084d4f47cd9a0bc5ecfe78aecb.f10.mp4",
                "definition": 10,
                "vbitrate": 149193,
                "vheight": 240,
                "vwidth": 320
            },
            {
                "url": "http://vcloud1203.tc.qq.com/1203_8a5015084d4f47cd9a0bc5ecfe78aecb.f20.mp4",
                "definition": 20,
                "vbitrate": 297656,
                "vheight": 480,
                "vwidth": 640
            },
            {
                "url": "http://vcloud1203.tc.qq.com/1203_8a5015084d4f47cd9a0bc5ecfe78aecb.f220.av.m3u8",
                "definition": 220,
                "vbitrate": 524288,
                "vheight": 480,
                "vwidth": 640
            },
            {
                "url": "http://vcloud1203.tc.qq.com/1203_8a5015084d4f47cd9a0bc5ecfe78aecb.f30.mp4",
                "definition": 30,
                "vbitrate": 899976,
                "vheight": 960,
                "vwidth": 1280
            },
            {
                "url": "http://vcloud1203.tc.qq.com/1203_8a5015084d4f47cd9a0bc5ecfe78aecb.f40.mp4",
                "definition": 40,
                "vbitrate": 1746652,
                "vheight": 1440,
                "vwidth": 1920
            }
        ]
    }
}