All Products
Search
Document Center

ApsaraVideo Media Processing:QueryMediaInfoJobList

更新時間:Sep 27, 2024

Queries the results of media information analysis jobs.

Operation description

  • In asynchronous mode, the media information can be retrieved only after the Message Service (MNS) callback of submitting a media information job is returned. If you have not retrieved the media information for a long period, the job may have failed.
  • You can call this operation to query up to 10 media information analysis jobs at a time.
  • By default, returned jobs are sorted in descending order by CreationTime.

QPS limit

You can call this operation up to 100 times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see QPS limit.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
mts:QueryMediaInfoJobListget
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
MediaInfoJobIdsstringYes

The IDs of the media information analysis jobs.

  • You can query up to 10 jobs at a time. Separate multiple IDs with commas (,).
  • You can obtain the details from the response parameters of the SubmitMediaInfoJob operation.
Note If you do not specify the JobIds parameter, the InvalidParameter error code is returned.
23ca1d184c0e4341e5b665e2a12****

Response parameters

ParameterTypeDescriptionExample
object
NonExistMediaInfoJobIdsarray

Nonexistent media information analysis jobs.

Stringstring

The IDs of the media information analysis jobs that do not exist. If all specified jobs exist, the response does not contain this parameter.

11ce1d184c0e4341e5b665e2a12****
RequestIdstring

The ID of the request.

46A04AA5-B119-41BB-B750-7C5327AC3E7A
MediaInfoJobListarray<object>

The details of each returned media information analysis job.

MediaInfoJobobject
CreationTimestring

The time when the job was created.

2014-01-10T12:00:00Z
Statestring

The status of the job.

  • Analyzing: The job is being run.
  • Success: The job is successful.
  • Fail: The job fails.
Success
JobIdstring

The ID of the job.

23ca1d184c0e4341e5b665e2a12****
UserDatastring

The custom data.

testid-001
Codestring

The error code returned if the job fails.

InvalidParameter.JsonObjectFormatInvalid
Messagestring

The error message returned if the job fails.

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

The ID of the MPS queue.

88c6ca184c0e432bbf5b665e2a15****
Asyncboolean

Indicates whether the job is in asynchronous mode.

true
Inputobject

The information about the job input.

Objectstring

The name of the Object Storage Service (OSS) object that is used as the input file.

example.mp4
Locationstring

The ID of the OSS region.

oss-cn-hangzhou
Bucketstring

The OSS bucket in which the input file is stored.

example-bucket
MNSMessageResultobject

The message sent by MNS to notify you of the job result.

MessageIdstring

The ID of the message returned if the job was successful. This parameter is not returned if the job fails.

123
ErrorMessagestring

The error message returned if the job failed. This parameter is not returned if the job is successful.

The parameter \"Input\" does not conform to the JSON Object specification
ErrorCodestring

The error code returned if the job failed. This parameter is not returned if the job is successful.

InvalidParameter.JsonObjectFormatInvalid
Propertiesobject

The information about the input file. For more information, see AliyunProperties .

Widthstring

The width of the video. Unit: pixel.

1280
Heightstring

The height of the video. Unit: pixel.

720
Durationstring

The duration of the media file.

17.226000
Fpsstring

The frame rate of the media file.

25
Bitratestring

The bitrate of the media file.

1630.045
FileFormatstring

The format of the input media file.

QuickTime/MOV
Streamsobject

The media streams that are contained in the input media file.

VideoStreamListarray<object>

The information about each video stream.

VideoStreamobject
Sarstring

The sample aspect ratio (SAR).

1:1
Heightstring

The height of the video stream in pixels.

1080
CodecTagStringstring

The tag string of the encoding format.

[0][0][0][0]
NetworkCostobject

The network bandwidth that is consumed.

PreloadTimestring

The time consumed to preload the video.

8
AvgBitratestring

The average bitrate of the video stream.

300.34
CostBandwidthstring

The maximum bandwidth that is consumed.

10
Widthstring

The width of the video in pixels.

1920
Indexstring

The sequence number of the video stream. The value indicates the position of the video stream in all video streams.

1
Timebasestring

The time base.

1/1000
AvgFPSstring

The average frame rate.

24000/1001
PixFmtstring

The pixel format.

yuv420p
Langstring

The language.

eng
CodecLongNamestring

The full name of the encoding format.

H.264/AVC/MPEG-4 AVC/MPEG-4 part 10
NumFramesstring

The total number of frames.

100
Rotatestring

The rotation angle of the video.

180
Bitratestring

The bitrate of the media file.

30541090
HasBFramesstring

Indicates whether the video stream contains bidirectional frames (B-frames). A value of 1 indicates that the video stream contains B-frames. A value of 0 indicates that the video stream does not contain B-frames.

0
Profilestring

The codec profile.

High
StartTimestring

The start time.

0.042000
Darstring

The display aspect ratio (DAR).

16:9
CodecNamestring

The short name of the encoding format. Valid values:

  • h264
  • h265
  • gif
  • webp
h264
Durationstring

The duration of the media file.

100
Fpsstring

The frame rate of the media file.

25
CodecTagstring

The tag of the encoding format.

0x0000
CodecTimeBasestring

The codec time base.

1001/48000
Levelstring

The codec level.

41
ColorRangestring

The color range.

700
ColorTransferstring

The color channel.

R255 G83 B170
ColorPrimariesstring

The level of color reconstruction.

700
AudioStreamListarray<object>

The information about each audio stream.

AudioStreamobject
Timebasestring

The time base.

1/1000
Indexstring

The sequence number of the audio stream. The value indicates the position of the audio stream in all audio streams.

1
SampleFmtstring

The sampling format.

fltp
ChannelLayoutstring

The number of sound channels.

5.1(side)
Langstring

The language. For more information, see FFmpeg documentation.

eng
Sampleratestring

The sampling rate.

48000
CodecLongNamestring

The full name of the encoding format.

DCA (DTS Coherent Acoustics)
Channelsstring

The output layout of the sound channels.

2
NumFramesstring

The total number of frames.

123
Bitratestring

The bitrate of the media file.

1536000
CodecTagStringstring

The tag string of the encoding format.

[0][0][0][0]
StartTimestring

The start time.

0.042000
CodecNamestring

The short name of the encoding format. Valid values:

  • acc
  • mp3
  • mp4
  • ogg
  • flac
acc
Durationstring

The duration of the media file.

123
CodecTagstring

The tag of the encoding format.

0x0000
CodecTimeBasestring

The codec time base.

1/48000
SubtitleStreamListarray<object>

The information about each subtitle stream.

SubtitleStreamobject
Timebasestring

The time base.

1/1000
Indexstring

The sequence number of the subtitle stream. The value indicates the position of the subtitle stream in all subtitle streams.

3
StartTimestring

The start time.

0.000000
CodecNamestring

The short name of the encoding format. Valid values:

  • srt
  • ass
ass
Langstring

The language.

eng
CodecLongNamestring

The full name of the encoding format.

ASS (Advanced SSA) subtitle
Durationstring

The duration. Unit: seconds.

1370.116000
CodecTagstring

The tag of the encoding format.

0x0000
CodecTimeBasestring

The codec time base.

0/1
CodecTagStringstring

The tag string of the encoding format.

[0][0][0][0]
Formatobject

The format information.

StartTimestring

The start time.

0.042000
NumProgramsstring

The total number of program streams.

2
Sizestring

The size of the image file.

3509895
NumStreamsstring

The total number of media streams.

1
FormatLongNamestring

The full name of the container format.

QuickTime/MOV
Durationstring

The total duration.

17.226000
Bitratestring

The total bitrate.

1630.045
FormatNamestring

The short name of the container format.

mov
FileSizestring

The size of the image file.

3509895

Callback parameters

When the status of the media information analysis job changes, MPS sends a message to the specified MNS queue. For more information about how to specify an MNS queue for receiving callbacks, see the UpdatePipeline topic. The callback message is a JSON string that contains the parameters described in the following table.

{
  "Type": "MediaInfo",
  "State": "Success",
  "JobId": "bb558c1cc25b45309aab5be44d19****",
  "UserData": "{\"key\":\"value\"}",
  "RequestId": "B52658D4-07AB-43CD-82B0-210958A6****"
}
ParameterTypeDescription
TypeStringThe value is fixed to MediaInfo, which indicates a media information analysis job.
JobIdStringThe unique ID of the job.
StateStringThe current status of the job. The value is the same as the value of the State parameter returned in the QueryMediaInfoJobList operation.
UserDataStringThe user data that was specified for the job in the SubmitMediaInfoJob operation.

Examples

Sample success responses

JSONformat

{
  "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": "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": {
              "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"
                }
              ]
            },
            "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"
          },
          "FileSize": "3509895"
        }
      }
    ]
  }
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2021-05-17Add OperationView Change Details