调用QueryMediaInfoJobList查询媒体信息作业。
使用说明
- 本接口一次最多可查询10个媒体信息作业。
- 上传完成后,需要等到分析事件回调成功后才能查询到媒体信息。如果长时间未收到回调,或者没有配置回调但长时间后依旧查询不到媒体信息,可能是提交媒体信息作业执行失败,请提交工单并提供您的UID、区域、VID进行查询。
QPS限制
本接口的单用户QPS限制为100次/秒。超过限制,API调用会被限流,这可能会影响您的业务,请合理调用。更多信息,请参见QPS限制。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
| 名称 | 类型 | 是否必选 | 示例值 | 描述 |
|---|---|---|---|---|
| Action | String | 是 | QueryMediaInfoJobList | 系统规定参数,取值:QueryMediaInfoJobList。 |
| MediaInfoJobIds | String | 是 | 23ca1d184c0e4341e5b665e2a12**** | 媒体信息作业ID列表。半角逗号(,)分隔,一次最多查询10个。 |
返回数据
| 名称 | 类型 | 示例值 | 描述 |
|---|---|---|---|
| NonExistMediaInfoJobIds | Array of String | 11ce1d184c0e4341e5b665e2a12**** | 不存在的媒体信息作业ID列表,无数据时不返回该参数。 |
| RequestId | String | 46A04AA5-B119-41BB-B750-7C5327AC3E7A | 请求ID。 |
| MediaInfoJobList | Array of MediaInfoJob | 媒体信息作业列表。 |
|
| MediaInfoJob | |||
| CreationTime | String | 2014-01-10T12:00:00Z | 作业添加时间。 |
| State | String | Success | 作业状态。
|
| JobId | String | 23ca1d184c0e4341e5b665e2a12**** | 元信息分析作业ID。 |
| UserData | String | testid-001 | 用户自定义数据。 |
| Code | String | InvalidParameter.JsonObjectFormatInvalid | 元信息分析失败时错误码。 |
| Message | String | The parameter ”*” does not conform to the JSON Object specification | 元信息分析失败时错误信息。 |
| PipelineId | String | 88c6ca184c0e432bbf5b665e2a15**** | 管道ID。 |
| Async | Boolean | true | 是否为异步作业。 |
| Input | Object | 作业输入。 |
|
| Object | String | example.mp4 | OSS的Object。 |
| Location | String | oss-cn-hangzhou | OSS的服务区域。 |
| Bucket | String | example-bucket | 输入文件的OSS Bucket。 |
| MNSMessageResult | Object | MNS通知用户作业完成的消息结果。 |
|
| MessageId | String | 123 | 成功时消息ID。如果失败则不返回此参数。 |
| ErrorMessage | String | The parameter \"Input\" does not conform to the JSON Object specification | 失败时错误信息。如果成功则不返回此参数。 |
| ErrorCode | String | InvalidParameter.JsonObjectFormatInvalid | 失败时错误码。如果成功则不返回此参数。 |
| Properties | Object | 媒体详细属性。更多信息请参见数据类型AliyunProperties。 |
|
| Width | String | 1280 | 视频像素宽。 |
| Height | String | 720 | 视频像素长。 |
| Duration | String | 17.226000 | 时长。 |
| Fps | String | 25 | 帧率。 |
| Bitrate | String | 1630.045 | 码率。 |
| FileFormat | String | QuickTime/MOV | 文件格式。 |
| Streams | Object | 流信息。 |
|
| VideoStreamList | Array of VideoStream | 视频流信息列表。 |
|
| VideoStream | |||
| Sar | String | 1:1 | 编码信号分辨率比。 |
| Height | String | 1080 | 视频分辨率长。 |
| CodecTagString | String | [0][0][0][0] | 编码格式标记文本。 |
| NetworkCost | Object | 网络带宽消耗。 |
|
| PreloadTime | String | 8 | 预加载时间。 |
| AvgBitrate | String | 300.34 | 平均码率。 |
| CostBandwidth | String | 10 | 最大消耗带宽。 |
| Width | String | 1920 | 视频分辨率宽。 |
| Index | String | 1 | 视频流序号,标识视频流在整个媒体流中的位置。 |
| Timebase | String | 1/1000 | 时基。 |
| AvgFPS | String | 24000/1001 | 平均帧率。 |
| PixFmt | String | yuv420p | 像素格式。 |
| Lang | String | eng | 语言。 |
| CodecLongName | String | H.264/AVC/MPEG-4 AVC/MPEG-4 part 10 | 编码格式长述名。 |
| NumFrames | String | 100 | 总帧数。 |
| Rotate | String | 180 | 视频旋转角度。 |
| Bitrate | String | 30541090 | 码率。 |
| HasBFrames | String | 0 | 是否有B帧。0表示无,1表示有。 |
| Profile | String | High | 编码预置。 |
| StartTime | String | 0.042000 | 起始时间。 |
| Dar | String | 16:9 | 编码显示分辨率比。 |
| CodecName | String | h264 | 编码格式简述名。可选值:
|
| Duration | String | 100 | 时长。 |
| Fps | String | 25 | 帧率。 |
| CodecTag | String | 0x0000 | 编码格式标记。 |
| CodecTimeBase | String | 1001/48000 | 编码时基。 |
| Level | String | 41 | 编码等级。 |
| ColorRange | String | 700 | 色彩范围。 |
| ColorTransfer | String | R255 G83 B170 | 色彩通道。 |
| ColorPrimaries | String | 700 | 色原。 |
| AudioStreamList | Array of AudioStream | 音频流信息列表。 |
|
| AudioStream | |||
| Timebase | String | 1/1000 | 时基。 |
| Index | String | 1 | 音频流序号,标识音频流在整个媒体流中的位置。 |
| SampleFmt | String | fltp | 采样格式。 |
| ChannelLayout | String | 5.1(side) | 声道数。 |
| Lang | String | eng | 语言。更多信息请参见FFmpeg语言定义。 |
| Samplerate | String | 48000 | 采样率。 |
| CodecLongName | String | DCA (DTS Coherent Acoustics) | 编码格式长述名。 |
| Channels | String | 2 | 声道输出样式。 |
| NumFrames | String | 123 | 总帧数。 |
| Bitrate | String | 1536000 | 码率。 |
| CodecTagString | String | [0][0][0][0] | 编码格式标记文本。 |
| StartTime | String | 0.042000 | 起始时间。 |
| CodecName | String | acc | 编码格式简述名。可取值:
|
| Duration | String | 123 | 时长。 |
| CodecTag | String | 0x0000 | 编码格式标记。 |
| CodecTimeBase | String | 1/48000 | 编码时基。 |
| SubtitleStreamList | Array of SubtitleStream | 字幕流信息列表。 |
|
| SubtitleStream | |||
| Timebase | String | 1/1000 | 时基。 |
| Index | String | 3 | 字幕流序号,标识字幕流在整个媒体流中的位置。 |
| StartTime | String | 0.000000 | 起始时间。 |
| CodecName | String | ass | 编码格式简述名。可选值:
|
| Lang | String | eng | 语言。 |
| CodecLongName | String | ASS (Advanced SSA) subtitle | 编码格式长述名。 |
| Duration | String | 1370.116000 | 时长,单位秒(s)。 |
| CodecTag | String | 0x0000 | 编码格式标记。 |
| CodecTimeBase | String | 0/1 | 编码时基。 |
| CodecTagString | String | [0][0][0][0] | 编码格式标记文本。 |
| Format | Object | 格式信息。 |
|
| StartTime | String | 0.042000 | 起始时间。 |
| NumPrograms | String | 2 | 节目流总数。 |
| Size | String | 3509895 | 文件大小。 |
| NumStreams | String | 1 | 媒体流总数。 |
| FormatLongName | String | QuickTime/MOV | 容器、封装格式长述名。 |
| Duration | String | 17.226000 | 总时长。 |
| Bitrate | String | 1630.045 | 总码率。 |
| FormatName | String | mov | 容器、封装格式简述名。 |
| FileSize | String | 3509895 | 文件大小。 |
回调消息格式定义
当媒体信息任务执行状态改变时,mps会发送消息到用户指定的queue中(如何指定回调queue详见mps的更新管道接口)。消息体是一个JSON字符串,包含字段如下:
{
"Type": "MediaInfo",
"State": "Success",
"JobId": "bb558c1cc25b45309aab5be44d19****",
"UserData": "{\"key\":\"value\"}",
"RequestId": "B52658D4-07AB-43CD-82B0-210958A6****"
}
名称 |
类型 |
描述 |
|---|---|---|
Type |
String |
固定字符串“MediaInfo”,表示媒体信息任务。 |
JobId |
String |
任务唯一ID。 |
State |
String |
任务当前状态,与QueryMediaInfoJobList中的State一致。 |
UserData |
String |
用户在SubmitMediaInfoJob中传入的UserData。 |
示例
请求示例
http(s)://mts.cn-hangzhou.aliyuncs.com/?Action=QueryMediaInfoJobList
&MediaInfoJobIds=23ca1d184c0e4341e5b665e2a12****
&<公共请求参数>
正常返回示例
XML格式
HTTP/1.1 200 OK
Content-Type:application/xml
<QueryMediaInfoJobListResponse>
<NonExistMediaInfoJobIds>11ce1d184c0e4341e5b665e2a12****</NonExistMediaInfoJobIds>
<RequestId>46A04AA5-B119-41BB-B750-7C5327AC3E7A</RequestId>
<MediaInfoJobList>
<CreationTime>2014-01-10T12:00:00Z</CreationTime>
<State>Success</State>
<JobId>23ca1d184c0e4341e5b665e2a12****</JobId>
<UserData>testid-001</UserData>
<PipelineId>88c6ca184c0e432bbf5b665e2a15****</PipelineId>
<Async>true</Async>
<Input>
<Object>example.mp4</Object>
<Location>oss-cn-hangzhou</Location>
<Bucket>example-bucket</Bucket>
</Input>
<MNSMessageResult>
<MessageId>123</MessageId>
</MNSMessageResult>
<Properties>
<Width>1280</Width>
<Height>720</Height>
<Duration>17.226000</Duration>
<Fps>25</Fps>
<Bitrate>1630.045</Bitrate>
<FileFormat>QuickTime/MOV</FileFormat>
<Streams>
<VideoStreamList>
<Sar>1:1</Sar>
<Height>1080</Height>
<CodecTagString>[0][0][0][0]</CodecTagString>
<NetworkCost>
<PreloadTime>8</PreloadTime>
<AvgBitrate>300.34</AvgBitrate>
<CostBandwidth>10</CostBandwidth>
</NetworkCost>
<Width>1920</Width>
<Index>1</Index>
<Timebase>1/1000</Timebase>
<AvgFPS>24000/1001</AvgFPS>
<PixFmt>yuv420p</PixFmt>
<Lang>eng</Lang>
<CodecLongName>H.264/AVC/MPEG-4 AVC/MPEG-4 part 10</CodecLongName>
<NumFrames>100</NumFrames>
<Rotate>180</Rotate>
<Bitrate>30541090</Bitrate>
<HasBFrames>0</HasBFrames>
<Profile>High</Profile>
<StartTime>0.042000</StartTime>
<Dar>16:9</Dar>
<CodecName>h264</CodecName>
<Duration>100</Duration>
<Fps>25</Fps>
<CodecTag>0x0000</CodecTag>
<CodecTimeBase>1001/48000</CodecTimeBase>
<Level>41</Level>
<ColorRange>700</ColorRange>
<ColorTransfer>R255 G83 B170</ColorTransfer>
<ColorPrimaries>700</ColorPrimaries>
</VideoStreamList>
<AudioStreamList>
<Timebase>1/1000</Timebase>
<Index>1</Index>
<SampleFmt>fltp</SampleFmt>
<ChannelLayout>5.1(side)</ChannelLayout>
<Lang>eng</Lang>
<Samplerate>48000</Samplerate>
<CodecLongName>DCA (DTS Coherent Acoustics)</CodecLongName>
<Channels>2</Channels>
<NumFrames>123</NumFrames>
<Bitrate>1536000</Bitrate>
<CodecTagString>[0][0][0][0]</CodecTagString>
<StartTime>0.042000</StartTime>
<CodecName>acc</CodecName>
<Duration>123</Duration>
<CodecTag>0x0000</CodecTag>
<CodecTimeBase>1/48000</CodecTimeBase>
</AudioStreamList>
<SubtitleStreamList>
<Timebase>1/1000</Timebase>
<Index>3</Index>
<StartTime>0.000000</StartTime>
<CodecName>ass</CodecName>
<Lang>eng</Lang>
<CodecLongName>ASS (Advanced SSA) subtitle</CodecLongName>
<Duration>1370.116000</Duration>
<CodecTag>0x0000</CodecTag>
<CodecTimeBase>0/1</CodecTimeBase>
<CodecTagString>[0][0][0][0]</CodecTagString>
</SubtitleStreamList>
</Streams>
<Format>
<StartTime>0.042000</StartTime>
<NumPrograms>2</NumPrograms>
<Size>3509895</Size>
<NumStreams>1</NumStreams>
<FormatLongName>QuickTime/MOV</FormatLongName>
<Duration>17.226000</Duration>
<Bitrate>1630.045</Bitrate>
<FormatName>mov</FormatName>
</Format>
<FileSize>3509895</FileSize>
</Properties>
</MediaInfoJobList>
</QueryMediaInfoJobListResponse>
JSON格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"NonExistMediaInfoJobIds": [
"11ce1d184c0e4341e5b665e2a12****"
],
"RequestId": "46A04AA5-B119-41BB-B750-7C5327AC3E7A",
"MediaInfoJobList": [
{
"CreationTime": "2014-01-10T12:00:00Z",
"State": "Success",
"JobId": "23ca1d184c0e4341e5b665e2a12****",
"UserData": "testid-001",
"PipelineId": "88c6ca184c0e432bbf5b665e2a15****",
"Async": true,
"Input": {
"Object": "example.mp4",
"Location": "oss-cn-hangzhou",
"Bucket": "example-bucket"
},
"MNSMessageResult": {
"MessageId": "123",
},
"Properties": {
"Width": "1280",
"Height": "720",
"Duration": "17.226000",
"Fps": "25",
"Bitrate": "1630.045",
"FileFormat": "QuickTime/MOV",
"Streams": {
"VideoStreamList": [
{
"Sar": "1:1",
"Height": "1080",
"CodecTagString": "[0][0][0][0]",
"NetworkCost": {
"PreloadTime": "8",
"AvgBitrate": "300.34",
"CostBandwidth": "10"
},
"Width": "1920",
"Index": "1",
"Timebase": "1/1000",
"AvgFPS": "24000/1001",
"PixFmt": "yuv420p",
"Lang": "eng",
"CodecLongName": "H.264/AVC/MPEG-4 AVC/MPEG-4 part 10",
"NumFrames": "100",
"Rotate": "180",
"Bitrate": "30541090",
"HasBFrames": "0",
"Profile": "High",
"StartTime": "0.042000",
"Dar": "16:9",
"CodecName": "h264",
"Duration": "100",
"Fps": "25",
"CodecTag": "0x0000",
"CodecTimeBase": "1001/48000",
"Level": "41",
"ColorRange": "700",
"ColorTransfer": "R255 G83 B170",
"ColorPrimaries": "700"
}
],
"AudioStreamList": [
{
"Timebase": "1/1000",
"Index": "1",
"SampleFmt": "fltp",
"ChannelLayout": "5.1(side)",
"Lang": "eng",
"Samplerate": "48000",
"CodecLongName": "DCA (DTS Coherent Acoustics)",
"Channels": "2",
"NumFrames": "123",
"Bitrate": "1536000",
"CodecTagString": "[0][0][0][0]",
"StartTime": "0.042000",
"CodecName": "acc",
"Duration": "123",
"CodecTag": "0x0000",
"CodecTimeBase": "1/48000"
}
],
"SubtitleStreamList": [
{
"Timebase": "1/1000",
"Index": "3",
"StartTime": "0.000000",
"CodecName": "ass",
"Lang": "eng",
"CodecLongName": "ASS (Advanced SSA) subtitle",
"Duration": "1370.116000",
"CodecTag": "0x0000",
"CodecTimeBase": "0/1",
"CodecTagString": "[0][0][0][0]"
}
]
},
"Format": {
"StartTime": "0.042000",
"NumPrograms": "2",
"Size": "3509895",
"NumStreams": "1",
"FormatLongName": "QuickTime/MOV",
"Duration": "17.226000",
"Bitrate": "1630.045",
"FormatName": "mov"
},
"FileSize": "3509895"
}
}
]
}
错误码
访问错误中心查看更多错误码。