全部产品
Search
文档中心

媒体处理:QueryMediaInfoJobList - 查询媒体信息作业信息

更新时间:Feb 25, 2026

查询媒体信息作业。

接口说明

  • 异步模式需要等到**提交媒体信息作业**的 MNS 回调成功后才能查询到媒体信息。如果长时间查询不到媒体信息,可能是提交媒体信息作业执行失败。

  • 本接口一次最多可查询 10 个媒体信息作业。

  • 本接口返回值默认按 CreationTime 降序排列。

QPS 限制

本接口的单用户 QPS 限制为 100 次/秒。超过限制,API 调用会被限流,这可能会影响您的业务,请合理调用。更多信息,请参见 QPS 限制

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

mts:QueryMediaInfoJobList

get

*全部资源

*

请求参数

名称

类型

必填

描述

示例值

MediaInfoJobIds

string

媒体信息作业 ID。

  • 一次最多查询 10 个,使用半角逗号(,)分隔。

  • 可以从提交媒体信息作业的返回参数中获取。

说明

如果不传入此参数,则会返回 InvalidParameter(参数无效)错误码。

23ca1d184c0e4341e5b665e2a12****

返回参数

名称

类型

描述

示例值

object

NonExistMediaInfoJobIds

object

String

array

不存在的媒体信息作业。

string

不存在的媒体信息作业 ID 列表,无数据时不返回该参数。

11ce1d184c0e4341e5b665e2a12****

RequestId

string

请求 ID。

46A04AA5-B119-41BB-B750-7C5327AC3E7A

MediaInfoJobList

object

MediaInfoJob

array<object>

媒体信息作业列表。

array<object>

CreationTime

string

作业添加时间。

2014-01-10T12:00:00Z

State

string

作业状态。

  • Analyzing:分析中。

  • Success:分析成功。

  • Fail:分析失败。

Success

JobId

string

元信息分析作业 ID。

23ca1d184c0e4341e5b665e2a12****

UserData

string

用户自定义数据。

testid-001

Code

string

元信息分析失败时错误码。

InvalidParameter.JsonObjectFormatInvalid

Message

string

元信息分析失败时错误信息。

The parameter ”*” does not conform to the JSON Object specification

PipelineId

string

管道 ID。

88c6ca184c0e432bbf5b665e2a15****

Async

boolean

是否为异步作业。

true

Input

object

作业输入。

Object

string

OSS 的 Object。

example.mp4

Location

string

OSS 的服务区域。

oss-cn-hangzhou

Bucket

string

输入文件的 OSS Bucket。

example-bucket

MNSMessageResult

object

MNS 通知用户作业完成的消息结果。

MessageId

string

成功时消息 ID。如果失败则不返回此参数。

123

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

object

VideoStream

array<object>

视频流信息列表。

array<object>

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

平均帧率。

23.976025

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

是否有 B 帧。0 表示无,1 表示有。

0

Profile

string

编码预置。

High

StartTime

string

起始时间。

0.042000

Dar

string

编码显示分辨率比。

16:9

CodecName

string

编码格式简述名。可选值:

  • h264

  • h265

  • gif

  • webp

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

DurationInaccurate

string

DolbyVision

object

Profile

string

Level

string

AudioStreamList

object

AudioStream

array<object>

音频流信息列表。

object

Timebase

string

时基。

1/1000

Index

string

音频流序号,标识音频流在整个媒体流中的位置。

1

SampleFmt

string

采样格式。

fltp

ChannelLayout

string

声道数。

5.1(side)

Lang

string

语言。更多信息请参见 FFmpeg 语言定义

eng

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

  • mp3

  • mp4

  • ogg

  • flac

acc

Duration

string

时长。

123

CodecTag

string

编码格式标记。

0x0000

CodecTimeBase

string

编码时基。

1/48000

DurationInaccurate

string

SubtitleStreamList

object

SubtitleStream

array<object>

字幕流信息列表。

object

Timebase

string

时基。

1/1000

Index

string

字幕流序号,标识字幕流在整个媒体流中的位置。

3

StartTime

string

起始时间。

0.000000

CodecName

string

编码格式简述名。可选值:

  • srt

  • ass

ass

Lang

string

语言。

eng

CodecLongName

string

编码格式长述名。

ASS (Advanced SSA) subtitle

Duration

string

时长,单位秒(s)。

1370.116000

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

Tags

object

FileSize

string

文件大小。

3509895

FileMd5

string

回调消息格式定义

当媒体信息任务执行状态改变时,mps 会发送消息到用户指定的 queue 中(如何指定回调 queue 详见 mps 的更新管道接口)。消息体是一个 JSON 字符串,包含字段如下:

{
  "Type": "MediaInfo",
  "State": "Success",
  "JobId": "bb558c1cc25b45309aab5be44d19****",
  "UserData": "{\"key\":\"value\"}",
  "RequestId": "B52658D4-07AB-43CD-82B0-210958A6****"
}
名称类型描述
TypeString固定字符串“MediaInfo”,表示媒体信息任务。
JobIdString任务唯一 ID。
StateString任务当前状态,与 QueryMediaInfoJobList 中的 State 一致。
UserDataString用户在 SubmitMediaInfoJob 中传入的 UserData。

示例

正常返回示例

JSON格式

{
  "NonExistMediaInfoJobIds": {
    "String": [
      "11ce1d184c0e4341e5b665e2a12****"
    ]
  },
  "RequestId": "46A04AA5-B119-41BB-B750-7C5327AC3E7A",
  "MediaInfoJobList": {
    "MediaInfoJob": [
      {
        "CreationTime": "2014-01-10T12:00:00Z",
        "State": "Success",
        "JobId": "23ca1d184c0e4341e5b665e2a12****",
        "UserData": "testid-001",
        "Code": "InvalidParameter.JsonObjectFormatInvalid",
        "Message": "The parameter ”*” does not conform to the JSON Object specification",
        "PipelineId": "88c6ca184c0e432bbf5b665e2a15****",
        "Async": true,
        "Input": {
          "Object": "example.mp4",
          "Location": "oss-cn-hangzhou",
          "Bucket": "example-bucket"
        },
        "MNSMessageResult": {
          "MessageId": "123",
          "ErrorMessage": "The parameter \\\"Input\\\" does not conform to the JSON Object specification",
          "ErrorCode": "InvalidParameter.JsonObjectFormatInvalid"
        },
        "Properties": {
          "Width": "1280",
          "Height": "720",
          "Duration": "17.226000",
          "Fps": "25",
          "Bitrate": "1630.045",
          "FileFormat": "QuickTime/MOV",
          "Streams": {
            "VideoStreamList": {
              "VideoStream": [
                {
                  "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": "23.976025",
                  "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",
                  "DurationInaccurate": "",
                  "DolbyVision": {
                    "Profile": "",
                    "Level": ""
                  }
                }
              ]
            },
            "AudioStreamList": {
              "AudioStream": [
                {
                  "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",
                  "DurationInaccurate": ""
                }
              ]
            },
            "SubtitleStreamList": {
              "SubtitleStream": [
                {
                  "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",
            "Tags": {
              "test": "test",
              "test2": 1
            }
          },
          "FileSize": "3509895",
          "FileMd5": ""
        }
      }
    ]
  }
}

错误码

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情