All Products
Search
Document Center

ApsaraVideo Media Processing:QueryMediaList

Last Updated:Dec 26, 2024

Queries media files based on media file IDs.

Operation description

You can call this operation to query up to 10 media files at a time.

QPS limit

You can call this operation up to 100 times per second per account. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. For more information, see QPS limits.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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:QueryMediaListget
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
MediaIdsstringYes

The IDs of the media files. To obtain the ID of a media file, you can perform the following operations in the ApsaraVideo Media Processing (MPS) console: In the left-side navigation pane, choose Media Management > Media List. Find the required video and click Manage. The ID of the video is displayed on the Basics tab. Separate multiple IDs with commas (,). You can query up to 10 media files at a time.

3e1cd21131a94525be55acf65888****,e26cfa29e784402388463f61dbec****
IncludePlayListbooleanNo

Specifies whether to include playback information in the returned result.

  • Valid values: true and false.
  • Default value: false.
true
IncludeSnapshotListbooleanNo

Specifies whether to include snapshot information in the returned result.

  • Valid values: true and false.
  • Default value: false.
true
IncludeMediaInfobooleanNo

Specifies whether to include media information in the returned result.

  • Valid values: true and false.
  • Default value: false.
true
IncludeSummaryListbooleanNo

Specifies whether to include summaries in the returned result.

  • Valid values: true and false.
  • Default value: false.
true

Response parameters

ParameterTypeDescriptionExample
object
NonExistMediaIdsarray

The IDs of the media files that do not exist. This parameter is not returned when all specified media files exist.

MediaIdstring
{"MediaId":[e26cfa29e784402388463f61dbec****]}
MediaListarray<object>

The list of media files.

Mediaobject
CreationTimestring

The time when the media file was created.

2016-09-14T08:30:33Z
CateIdlong

The ID of the category to which the media file belongs.

1
Heightstring

The height of the media file.

1080
CensorStatestring

The review status of the media file. Valid values:

  • Initiated: The media file is uploaded but not reviewed.
  • Pass: The media file is uploaded and passes the review.
Initiated
Tagsarray

The tags of the media file.

Tagstring
tag1,tag2
PlayListarray<object>

The playlist.

Playobject
Encryptionstring

Indicates whether the media file is encrypted. Valid values:

  • 0: The media file is not encrypted.
  • 1: The media file is encrypted.
0
Heightstring

The height.

1080
Bitratestring

The bitrate of the media file.

2659.326
Fileobject

The playback file.

Statestring

The status of the file. Valid values:

  • Normal: normal
  • Deleted: deleted
Normal
URLstring

The Object Storage Service (OSS) URL of the output file.

http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com//example-****.mp4
MediaWorkflowIdstring

The ID of the workflow that generates the playback file.

93ab850b4f6f44eab54b6e91d24d****
Widthstring

The width of the media file.

760
Sizestring

The size of the media file.

2647692
Fpsstring

The frame rate of the media file.

25.0
Durationstring

The duration of the media file.

7.965000
ActivityNamestring

The name of the workflow activity.

example-activity-****
Formatstring

The encoding format of the media file. Valid values: mov, mp4, m4a, 3gp, 3g2, and mj2.

mp4
MediaWorkflowNamestring

The name of the workflow that generates the playback file.

example-mediaworkflow-****
Bitratestring

The bitrate.

2659.326
MediaIdstring

The ID of the media file.

3e1cd21131a94525be55acf65888****
Fileobject

The details of the input file.

Statestring

The status of the input file. Valid values:

  • Normal: normal
  • Deleted: deleted
Normal
URLstring

The OSS URL of the input file.

http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com//example-****.mp4
SummaryListarray<object>

The list of video summaries.

Summaryobject
Typestring

The type of the summary. Valid values:

  • Video: video
  • Gif: dynamic image
Video
MediaWorkflowIdstring

The ID of the workflow that generates the summary.

93ab850b4f6f44eab54b6e91d24d****
ActivityNamestring

The name of the workflow activity.

example-activity-****
MediaWorkflowNamestring

The name of the workflow that generates the summary.

example-mediaworkflow-****
Fileobject

The information about the input file.

Statestring

The status of the file. Valid values:

  • Normal: normal
  • Deleted: deleted
Normal
URLstring

The OSS URL of the input file.

http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com//example-****.mp4
PublishStatestring

The publishing status of the media file. Valid values:

  • Initiated: The media file is in the initial state.
  • UnPublish: The media file has not been published, and the playback permission on the OSS object is Private.
  • Published: The media file has been published, and the playback permission on the OSS object is Default.
  • Deleted: The media file has been deleted.
Published
MediaInfoobject

The media information.

Streamsobject

The stream information.

VideoStreamListarray<object>

The list of video streams.

VideoStreamobject
Sarstring

The sample aspect ratio (SAR).

1:1
Heightstring

The latter number in the video resolution. The number indicates the video height.

1080
CodecTagStringstring

The tag string of the encoding format.

avc1
NetworkCostobject

The network bandwidth consumption.

PreloadTimestring

The amount of preload time.

0.01
AvgBitratestring

The average bitrate.

2659.326
CostBandwidthstring

The maximum bandwidth that was consumed.

100
Widthstring

The former number in the video resolution. The number indicates the video width.

100
Indexstring

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

5
Timebasestring

The time base.

1/30000
AvgFPSstring

The average frame rate.

29.97003
PixFmtstring

The pixel format.

yuv420p
Langstring

The language. For more information, see FFmpeg documentation.

und
CodecLongNamestring

The full name of the encoding format.

QuickTime/MOV
NumFramesstring

The total number of frames.

12
Rotatestring

The video rotation angle.

90
Bitratestring

The bitrate.

2659.326
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 2 indicates that the video stream does not contain B-frames.

2
Profilestring

The codec profile.

High
StartTimestring

The start time.

0.000000
Darstring

The display aspect ratio (DAR).

16:9
CodecNamestring

The short name of the encoding format. Valid values: mov, mp4, m4a, 3gp, 3g2, and mj2.

mov
Durationstring

The duration.

182.683000
Fpsstring

The frame rate.

29.97003
CodecTagstring

The tag of the encoding format.

0x31637661
CodecTimeBasestring

The codec time base.

1001/60000
Levelstring

The codec level.

40
AudioStreamListarray<object>

The list of audio streams.

AudioStreamobject
Timebasestring

The time base.

1/44100
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 output layout of the sound channels.

stereo
Langstring

The language. For more information, see FFmpeg documentation.

und
Sampleratestring

The sampling rate.

44100
CodecLongNamestring

The full name of the encoding format.

AAC(Advanced Audio Coding)
Channelsstring

The number of sound channels.

2
NumFramesstring

The total number of frames.

100
Bitratestring

The bitrate.

160.008
CodecTagStringstring

The tag string of the encoding format.

mp4a
StartTimestring

The start time.

0.000000
CodecNamestring

The short name of the encoding format. Valid values: H264, mov, aac, avc, and mpeg.

mov
Durationstring

The duration.

182.591995
CodecTagstring

The tag of the encoding format.

0x6134706d
CodecTimeBasestring

The codec time base.

1/44100
SubtitleStreamListarray<object>

The list of subtitle streams.

SubtitleStreamobject
Indexstring

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

3
Langstring

The language. For more information, see FFmpeg documentation.

und
Formatobject

The format information.

StartTimestring

The start time.

0.000000
NumProgramsstring

The total number of program streams.

2
Sizestring

The size of the file.

2647692
NumStreamsstring

The total number of media streams.

2
FormatLongNamestring

The full name of the container format.

QuickTime/MOV
Durationstring

The total duration.

7.965000
Bitratestring

The bitrate.

2659.326
FormatNamestring

The short name of the container format. Valid values: mov, mp4, m4a, 3gp, 3g2, and mj2.

mov
Descriptionstring

The description.

This is description ****
Sizestring

The size of the file.

2647692
Widthstring

The width.

1920
CoverURLstring

The OSS URL of the thumbnail.

http://example-bucket1-****.oss-cn-hangzhou.aliyuncs.com//example-****.png
SnapshotListarray<object>

The list of snapshots.

Snapshotobject
Typestring

The type of the snapshot. Valid values:

  • Single
  • Sequence
Sequence
MediaWorkflowIdstring

The ID of the workflow that generates the snapshot.

6cc3aa66d1cb4bb2adf14e726c0a****
ActivityNamestring

The name of the workflow activity that generates the snapshot.

example-activity1-****
Countstring

The number of snapshots. This parameter is valid only when the value of the Type parameter is Sequence.

5
MediaWorkflowNamestring

The name of the workflow that generates the snapshot.

example-workflow-****
Fileobject

The snapshot.

Statestring

The status of the file. Valid values:

  • Normal: normal
  • Deleted: deleted
Normal
URLstring

The OSS URL of the snapshot.

http://example1-bucket1-****.oss-cn-hangzhou.aliyuncs.com//example111-****.png
RunIdListarray

The ID of the instance.

RunIdstring
{"RunId":["47b42486019c4f688bf144c1a6ba****"]}
Durationstring

The duration.

7.965000
Fpsstring

The frame rate.

25.0
Titlestring

The title.

example-title-****
Formatstring

The encoding format. Valid values: mov, mp4, m4a, 3gp, 3g2, and mj2.

mov
RequestIdstring

The ID of the request.

283DC68C-146F-4489-A2A1-2F88F1472A56

Examples

Sample success responses

JSONformat

{
  "NonExistMediaIds": {
    "MediaId": [
      "{\"MediaId\":[e26cfa29e784402388463f61dbec****]}"
    ]
  },
  "MediaList": {
    "Media": [
      {
        "CreationTime": "2016-09-14T08:30:33Z",
        "CateId": 1,
        "Height": "1080",
        "CensorState": "Initiated",
        "Tags": {
          "Tag": [
            "tag1,tag2"
          ]
        },
        "PlayList": {
          "Play": [
            {
              "Encryption": "0",
              "Height": "1080",
              "Bitrate": "2659.326",
              "File": {
                "State": "Normal",
                "URL": "http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com//example-****.mp4"
              },
              "MediaWorkflowId": "93ab850b4f6f44eab54b6e91d24d****",
              "Width": "760",
              "Size": "2647692",
              "Fps": "25.0",
              "Duration": "7.965000",
              "ActivityName": "example-activity-****",
              "Format": "mp4",
              "MediaWorkflowName": "example-mediaworkflow-****"
            }
          ]
        },
        "Bitrate": "2659.326",
        "MediaId": "3e1cd21131a94525be55acf65888****",
        "File": {
          "State": "Normal",
          "URL": "http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com//example-****.mp4"
        },
        "SummaryList": {
          "Summary": [
            {
              "Type": "Video",
              "MediaWorkflowId": "93ab850b4f6f44eab54b6e91d24d****",
              "ActivityName": "example-activity-****",
              "MediaWorkflowName": "example-mediaworkflow-****",
              "File": {
                "State": "Normal",
                "URL": "http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com//example-****.mp4"
              }
            }
          ]
        },
        "PublishState": "Published",
        "MediaInfo": {
          "Streams": {
            "VideoStreamList": {
              "VideoStream": [
                {
                  "Sar": "1:1",
                  "Height": "1080",
                  "CodecTagString": "avc1",
                  "NetworkCost": {
                    "PreloadTime": "0.01",
                    "AvgBitrate": "2659.326",
                    "CostBandwidth": "100"
                  },
                  "Width": "100",
                  "Index": "5",
                  "Timebase": "1/30000",
                  "AvgFPS": "29.97003",
                  "PixFmt": "yuv420p",
                  "Lang": "und",
                  "CodecLongName": "QuickTime/MOV",
                  "NumFrames": "12",
                  "Rotate": "90",
                  "Bitrate": "2659.326",
                  "HasBFrames": "2",
                  "Profile": "High",
                  "StartTime": "0.000000",
                  "Dar": "16:9",
                  "CodecName": "mov",
                  "Duration": "182.683000",
                  "Fps": "29.97003",
                  "CodecTag": "0x31637661",
                  "CodecTimeBase": "1001/60000",
                  "Level": "40"
                }
              ]
            },
            "AudioStreamList": {
              "AudioStream": [
                {
                  "Timebase": "1/44100",
                  "Index": "1",
                  "SampleFmt": "fltp",
                  "ChannelLayout": "stereo",
                  "Lang": "und",
                  "Samplerate": "44100",
                  "CodecLongName": "AAC(Advanced Audio Coding)",
                  "Channels": "2",
                  "NumFrames": "100",
                  "Bitrate": "160.008",
                  "CodecTagString": "mp4a",
                  "StartTime": "0.000000",
                  "CodecName": "mov",
                  "Duration": "182.591995",
                  "CodecTag": "0x6134706d",
                  "CodecTimeBase": "1/44100"
                }
              ]
            },
            "SubtitleStreamList": {
              "SubtitleStream": [
                {
                  "Index": "3",
                  "Lang": "und"
                }
              ]
            }
          },
          "Format": {
            "StartTime": "0.000000",
            "NumPrograms": "2",
            "Size": "2647692",
            "NumStreams": "2",
            "FormatLongName": "QuickTime/MOV",
            "Duration": "7.965000",
            "Bitrate": "2659.326",
            "FormatName": "mov"
          }
        },
        "Description": "This is description ****",
        "Size": "2647692",
        "Width": "1920",
        "CoverURL": "http://example-bucket1-****.oss-cn-hangzhou.aliyuncs.com//example-****.png",
        "SnapshotList": {
          "Snapshot": [
            {
              "Type": "Sequence",
              "MediaWorkflowId": "6cc3aa66d1cb4bb2adf14e726c0a****",
              "ActivityName": "example-activity1-****",
              "Count": "5",
              "MediaWorkflowName": "example-workflow-****",
              "File": {
                "State": "Normal",
                "URL": "http://example1-bucket1-****.oss-cn-hangzhou.aliyuncs.com//example111-****.png"
              }
            }
          ]
        },
        "RunIdList": {
          "RunId": [
            "{\"RunId\":[\"47b42486019c4f688bf144c1a6ba****\"]}"
          ]
        },
        "Duration": "7.965000",
        "Fps": "25.0",
        "Title": "example-title-****",
        "Format": "mov"
      }
    ]
  },
  "RequestId": "283DC68C-146F-4489-A2A1-2F88F1472A56"
}

Error codes

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

Change history

Change timeSummary of changesOperation
No change history