查询任务详情
更新时间:2025-01-14
本接口用于查询任务的执行状态和详细信息。
接口限制:
- 只能查询到最近7天(7*24小时)内的任务。
请求结构
GET /v2/tasks/{taskId} HTTP/1.1
connection: keep-alive
host: vod.bj.baidubce.com
content-type: application/json
x-bce-request-id: <bce-request-id>
x-bce-date: <utc-date-string>
authorization: <bce-authorization-string>
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数 | 类型 | 是否必需 | 参数位置 | 描述 |
---|---|---|---|---|
taskId | string | 否 | Path参数 | 任务ID |
返回头域
除公共头域,无其它特殊头域。
返回参数
参考 MediaTaskDetail 结构定义。
示例
获取工作流处理的任务详情
请求内容
GET /v2/tasks/tsk-emdma8t0xrt5js30 HTTP/1.1
host: vod.bj.baidubce.com
accept: */*
connection: keep-alive
content-type: application/json
x-bce-request-id: 6bae5cb3-97d1-4b1a-b8b6-0ad577c1d481
x-bce-date: 2024-03-24T13:08:44Z
authorization: bce-auth-v1/46bd9968a6194b4bbdf0341f2286ccce/2024-03-24T13:08:44Z/1800/host;x-bce-date/7e21c9cf1e4e2cc6921a407a388fe98df122c53b9f509043d841be76eb09a1f9
返回内容
HTTP/1.1 200 OK
Transfer-Encoding: chunked
x-bce-request-id: 6bae5cb3-97d1-4b1a-b8b6-0ad577c1d481
Cache-Control: no-cache
Date: Tue, 24 Mar 2024 13:08:44 GMT
Content-Type: application/json;charset=UTF-8
{
"taskId": "tsk-emdma8t0xrt5js30",
"type": "WORKFLOW",
"status": "FINISHED",
"createTime": "2024-12-04T03:55:56Z",
"finishTime": "2024-12-04T03:56:38Z",
"mediaWorkflowTaskInfo": {
"mediaId": "mda-emcqauvcuyizbfdd",
"workflowId": "ekup232yp9xy8ga5t1gp",
"startNodeTaskInfo": {
"nodeId": "ekupxv40k2ecti4x1kfc",
"nodeName": "输入",
"status": "SUCCESS"
},
"transcodeNodeTaskInfos": [
{
"nodeId": "ehumx1153asih55hjvnf",
"nodeName": "video_a_hls",
"transcodeTaskInfo": {
"mediaId": "mda-ekwk0jmb1jt91pt5",
"status": "SUCCESS",
"transcodeInput": {
"presetId": "eiymg20ganpbe6gt2pe7"
},
"transcodeOutput": {
"id": "eiymg20ganpbe6gt2pe7",
"url": "http://vod.com/v1/mda-ekwk0jmb1jt91pt5/_output/eiymg20ganpbe6gt2pe7/mda-ekwk0jmb1jt91pt5.m3u8",
"meta": {
"video": {
"durationInSeconds": 19,
"durationInMilliSeconds": 18757,
"sizeInKiloByte": 6495.316406,
"widthInPixel": 720,
"heightInPixel": 1280,
"bitRateInBps": 2836787,
"frameRate": 29,
"gopAlign": false,
"mp4MoovSize": 0
},
"audio": {
"sampleRateInHz": 44100,
"channels": 2
}
}
}
}
}
],
"thumbnailNodeTaskInfos": [
{
"nodeId": "ekupipkr4q2fh5papunh",
"nodeName": "缩略图",
"thumbnailTaskInfo": {
"mediaId": "mda-emcqauvcuyizbfdd",
"status": "SUCCESS",
"thumbnailInput": {
"presetId": "ekupyc90cts7ac0kmmn4"
},
"thumbnailOutput": {
"id": "ekupyc90cts7ac0kmmn4",
"urls": [
"http://vod.com/v1/mda-emcqauvcuyizbfdd/_output/ekupyc90cts7ac0kmmn4/mda-emcqauvcuyizbfdd00000000.jpg",
"http://vod.com/v1/mda-emcqauvcuyizbfdd/_output/ekupyc90cts7ac0kmmn4/mda-emcqauvcuyizbfdd00245685.jpg",
"http://vod.com/v1/mda-emcqauvcuyizbfdd/_output/ekupyc90cts7ac0kmmn4/mda-emcqauvcuyizbfdd00491370.jpg",
"http://vod.com/v1/mda-emcqauvcuyizbfdd/_output/ekupyc90cts7ac0kmmn4/mda-emcqauvcuyizbfdd00737056.jpg",
"http://vod.com/v1/mda-emcqauvcuyizbfdd/_output/ekupyc90cts7ac0kmmn4/mda-emcqauvcuyizbfdd00982741.jpg",
"http://vod.com/v1/mda-emcqauvcuyizbfdd/_output/ekupyc90cts7ac0kmmn4/mda-emcqauvcuyizbfdd01228426.jpg",
"http://vod.com/v1/mda-emcqauvcuyizbfdd/_output/ekupyc90cts7ac0kmmn4/mda-emcqauvcuyizbfdd01474111.jpg",
"http://vod.com/v1/mda-emcqauvcuyizbfdd/_output/ekupyc90cts7ac0kmmn4/mda-emcqauvcuyizbfdd01719796.jpg",
"http://vod.com/v1/mda-emcqauvcuyizbfdd/_output/ekupyc90cts7ac0kmmn4/mda-emcqauvcuyizbfdd01965481.jpg"
]
}
}
}
],
"publishNodeTaskInfo": {
"nodeId": "ekupum6pmu7qvi0yhjxs",
"nodeName": "发布",
"status": "SUCCESS"
}
}
}
获取模板处理的任务详情
请求内容
GET /v2/tasks/tsk-emcriefvt643bsjy HTTP/1.1
host: vod.bj.baidubce.com
accept: */*
connection: keep-alive
content-type: application/json
x-bce-request-id: 6bae5cb3-97d1-4b1a-b8b6-0ad577c1d481
x-bce-date: 2024-03-24T13:08:44Z
authorization: bce-auth-v1/46bd9968a6194b4bbdf0341f2286ccce/2024-03-24T13:08:44Z/1800/host;x-bce-date/7e21c9cf1e4e2cc6921a407a388fe98df122c53b9f509043d841be76eb09a1f9
返回内容
HTTP/1.1 200 OK
Transfer-Encoding: chunked
x-bce-request-id: 6bae5cb3-97d1-4b1a-b8b6-0ad577c1d481
Cache-Control: no-cache
Date: Tue, 24 Mar 2024 13:08:44 GMT
Content-Type: application/json;charset=UTF-8
{
"taskId": "tsk-emcriefvt643bsjy",
"type": "PRESET",
"status": "FINISHED",
"createTime": "2024-12-03T07:20:26Z",
"finishTime": "2024-12-03T07:29:58Z",
"mediaPresetTaskInfo": {
"mediaId": "mda-emcqauvcuyizbfdd",
"transcodeTasks": [
{
"mediaId": "mda-emcqauvcuyizbfdd",
"status": "SUCCESS",
"transcodeInput": {
"presetId": "eiympb162kbybwscbfg6",
"digitalWatermark": {
"digitalWmTextContent": "1a中/",
"digitalWmAlgVersion": 2,
"digitalWmStrength": 0.5
}
},
"transcodeOutput": {
"id": "eiympb162kbybwscbfg6",
"url": "http://vod.com/v1/mda-emcqauvcuyizbfdd/_output/eiympb162kbybwscbfg6/mda-emcqauvcuyizbfdd.mp4",
"meta": {
"video": {
"durationInSeconds": 2211,
"durationInMilliSeconds": 2211166,
"sizeInKiloByte": 76893.198242,
"widthInPixel": 640,
"heightInPixel": 360,
"bitRateInBps": 284876,
"frameRate": 25,
"gopAlign": true,
"mp4MoovSize": 1121018
},
"audio": {
"sampleRateInHz": 44100,
"channels": 2
}
},
"digitalWatermark": {
"digitalWmTextContent": "1a中/",
"digitalWmAlgVersion": 2,
"digitalWmStrength": 0.5
}
}
}
]
}
}
获取视频生成的任务详情
请求内容
GET /v2/tasks/tsk-emdma8t0xrt5js30 HTTP/1.1
host: vod.bj.baidubce.com
accept: */*
connection: keep-alive
content-type: application/json
x-bce-request-id: 6bae5cb3-97d1-4b1a-b8b6-0ad577c1d481
x-bce-date: 2024-03-24T13:08:44Z
authorization: bce-auth-v1/46bd9968a6194b4bbdf0341f2286ccce/2024-03-24T13:08:44Z/1800/host;x-bce-date/7e21c9cf1e4e2cc6921a407a388fe98df122c53b9f509043d841be76eb09a1f9
返回内容
HTTP/1.1 200 OK
Transfer-Encoding: chunked
x-bce-request-id: 6bae5cb3-97d1-4b1a-b8b6-0ad577c1d481
Cache-Control: no-cache
Date: Tue, 24 Mar 2024 13:08:44 GMT
Content-Type: application/json;charset=UTF-8
{
"taskId": "tsk-faikc9dmw8m8saic",
"type": "VIDEO_GENERATE",
"status": "SUCCESS",
"createTime": "2025-01-09T02:04:53Z",
"finishTime": "2025-01-09T02:06:53Z",
"videoGenerateTaskInfo": {
"status": "success",
"videoGenerateTaskInput": {
"type": "图生视频",
"imageToVideoRequest": {
"model": "V15",
"modelV15TaskInput": {
"headtailImages": {
"headImage": {
"imageUrl": "https://test-ss-images.s3.ap-southeast-1.amazonaws.com/tmp/prompt-300k.jpeg"
},
"tailImage": {
"imageUrl": "https://test-ss-images.s3.ap-southeast-1.amazonaws.com/tmp/prompt-300k.jpeg"
}
},
"prompt": "两个人拥抱",
"duration": 4,
"resolution": "720p",
"movementAmplitude": "auto"
}
}
},
"videoGenerateTaskOutput": {
"mediaBasicInfos": [
{
"mediaId": "mda-faimzupjdsztt1mx",
"name": "图生视频_tsk-faikc9dmw8m8saic",
"description": "",
"mediaType": "video",
"banStatus": "NORMAL",
"createTime": "2025-01-09T03:26:12Z",
"categoryId": "system",
"tags": [],
"source": {
"sourceType": "GENERATE",
"sourceUrl": "http://vod.com/v1/mda-faimzupjdsztt1mx/_src/mda-faimzupjdsztt1mx.mp4?authorization=bce-auth-v1%2FALTAKcfr7rzaK44AsMUcaT2dVH%2F2025-01-09T10%3A33%3A01Z%2F3600%2F%2Feef10e12da4fe85f29a726872ec6f68d44e792d278b75221560546914f2ad1d1",
"coverUrl": "http://vod.com/v1/mda-faimzupjdsztt1mx/_output/cover.jpeg?authorization=bce-auth-v1%2FALTAKcfr7rzaK44AsMUcaT2dVH%2F2025-01-09T10%3A33%3A01Z%2F3600%2F%2F6dcc0adceb7f1f6c1d6254a1e0274e0ec48c9daf4227f9a013688d73f8fc839a"
},
"sourceMetadata": {
"fileSizeInByte": 1916539,
"type": "video",
"container": "mov,mp4,m4a,3gp,3g2,mj2",
"durationInSecond": 4,
"durationInMillisecond": 3720,
"video": {
"codec": "h264",
"heightInPixel": 1280,
"widthInPixel": 720,
"bitRateInBps": 4118041,
"frameRate": 32.0
},
"etag": "98c43448a3cb45193e3ba02d60d025b7"
}
}
]
}
}
}
错误码
以下仅列出了接口业务逻辑相关的错误码,其他错误码详见公共错误码。
错误码 | 错误信息 | HTTP状态码 | 描述 |
---|---|---|---|
MediaTaskNotFound | MediaTask xxx not found | 404 Not Found | 没有找到对应的任务 |