All Products
Search
Document Center

ApsaraVideo Media Processing:QueryMediaListByURL

Last Updated:Sep 27, 2024

Queries media files based on the Object Storage Service (OSS) URLs of media files.

Operation description

  • You can call this operation to query up to 10 media files at a time.
  • Before you call this operation, you must call the AddMedia operation to add media files.
  • You can call this operation to query only media files that are processed in a workflow. To obtain comprehensive information about a media file that is newly uploaded to OSS, you can call this operation after the corresponding workflow is complete. To query media files that are not processed in a workflow, you must call the SubmitMediaInfoJob operation to submit a media information analysis job. After the job is complete, you can query the information about the media files.

QPS limit

You can call this API 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 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:QueryMediaListByURLget
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
FileURLsstringYes

The OSS URLs of the media files. To obtain the OSS URL 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 media file whose OSS URL you want to view and click Manage in the Actions column. The OSS URL of the media file is displayed on the Obtain Encoding URL tab. Separate multiple URLs with commas (,). You can query up to 10 media files at a time.

  • The URL complies with RFC 3986 and is encoded in UTF-8, with reserved characters being percent-encoded. The value can be up to 3,200 bytes in size. For more information, see URL encoding.
  • Only OSS HTTP URLs are supported. Alibaba Cloud CDN URLs and HTTPS URLs are not supported.
http://example-bucket-****.oss-cn-shanghai.aliyuncs.com/example.mp4
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.

Note To obtain detailed information about the media files, set this parameter to true.
true
IncludeSummaryListbooleanNo

Specifies whether to include summaries in the returned result.

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

Response parameters

ParameterTypeDescriptionExample
object
MediaListarray<object>

The list of media files.

Mediaobject
CreationTimestring

The time when the media file was created.

2021-07-14T13:05:00Z
CateIdlong

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

123
Heightstring

The height of the queried media file.

360
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.
1
Heightstring

The height of the media file.

10
Bitratestring

The bitrate of the media file.

25.067
Fileobject

The playback file.

Statestring

The status of the media file. Valid values:

  • Normal: The file is normal.
  • Deleted: The file is deleted.
Normal
URLstring

The OSS URL of the playback file.

http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com//example-****.mp4l-test/in/1.mp4
MediaWorkflowIdstring

The ID of the workflow that generates the playback file.

6cc3aa66d1cb4bb2adf14e726c0a****
Widthstring

The width.

11
Sizestring

The size.

100
Fpsstring

The frame rate.

25.0
Durationstring

The duration.

7.965000
ActivityNamestring

The name of the workflow activity.

test name
Formatstring

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

mov
MediaWorkflowNamestring

The name of the workflow that generates the playback file.

example-mediaworkflow-****
Bitratestring

The bitrate.

593.192
MediaIdstring

The ID of the media file.

52d7e98b05e648199612290bb819****
Fileobject

The details of the input file.

Statestring

The status of the media file. Valid values:

  • Normal: The file is normal.
  • Deleted: The file is 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
Gif
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 media file. Valid values:

  • Normal: The file is normal.
  • Deleted: The file is deleted.
Normal
URLstring

The OSS URL of the input file.

http://example-bucket-****.o
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 file is 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.

360
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 of the video stream.

2659.326
CostBandwidthstring

The maximum bandwidth that was consumed.

100
Widthstring

The former number in the video resolution. The number indicates the video width and cannot be negative.

640
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/15360
AvgFPSstring

The average frame rate.

15.0
PixFmtstring

The pixel format of the video stream.

yuv420p
Langstring

The language. For more information, see FFmpeg documentation.

und
CodecLongNamestring

The full name of the encoding format.

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

The total number of frames.

12
Rotatestring

The rotation angle of the video.

90
Bitratestring

The bitrate.

512.701
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.046029
Darstring

The display aspect ratio (DAR) of the video stream.

16:9
CodecNamestring

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

H264
Durationstring

The duration.

79.200000
Fpsstring

The frame rate.

15.0
CodecTagstring

The tag of the encoding format.

0x31637661
CodecTimeBasestring

The codec time base.

1/30
Levelstring

The codec level.

31
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 language definition.

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.

76.356
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.

aac
Durationstring

The duration of the media file.

79.203265
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.

1
Langstring

The language. For more information, see FFmpeg language definition.

und
Formatobject

The format information.

StartTimestring

The start time.

0.000000
NumProgramsstring

The total number of program streams.

0
Sizestring

The size.

5872904
NumStreamsstring

The total number of media streams.

2
FormatLongNamestring

The full name of the encoding format.

QuickTime/MOV
Durationstring

The duration.

79.204000
Bitratestring

The bitrate.

593.192
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.

5872904
Widthstring

The width.

640
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: a single snapshot
  • Sequence: snapshots in sequence
Single
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.

3
MediaWorkflowNamestring

The name of the workflow that generates the snapshot.

example-workflow-****
Fileobject

The snapshot.

Statestring

The status of the file. Valid values:

  • Normal: The file is normal.
  • Deleted: The file is deleted.
Normal
URLstring

The OSS URL of the snapshot.

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

The IDs of the media workflow execution instances.

RunIdstring
9343bd0e7bb54ae19228529908e5****
Durationstring

The duration.

79.204000
Fpsstring

The frame rate.

15.0
Titlestring

The title.

kled.mp4
Formatstring

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

mov
NonExistFileURLsarray

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

FileURLstring
null
RequestIdstring

The ID of the request.

1C8A0AEB-4321-485B-B4CB-DA4E9E6C9B42

Examples

Sample success responses

JSONformat

{
  "MediaList": {
    "Media": [
      {
        "CreationTime": "2021-07-14T13:05:00Z",
        "CateId": 123,
        "Height": "360",
        "CensorState": "Initiated",
        "Tags": {
          "Tag": [
            "tag1,tag2"
          ]
        },
        "PlayList": {
          "Play": [
            {
              "Encryption": "1",
              "Height": "10",
              "Bitrate": "25.067",
              "File": {
                "State": "Normal",
                "URL": "http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com//example-****.mp4l-test/in/1.mp4"
              },
              "MediaWorkflowId": "6cc3aa66d1cb4bb2adf14e726c0a****",
              "Width": "11",
              "Size": "100",
              "Fps": "25.0",
              "Duration": "7.965000",
              "ActivityName": "test name",
              "Format": "mov",
              "MediaWorkflowName": "example-mediaworkflow-****"
            }
          ]
        },
        "Bitrate": "593.192",
        "MediaId": "52d7e98b05e648199612290bb819****",
        "File": {
          "State": "Normal",
          "URL": "http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com//example-****.mp4"
        },
        "SummaryList": {
          "Summary": [
            {
              "Type": "Gif",
              "MediaWorkflowId": "93ab850b4f6f44eab54b6e91d24d****",
              "ActivityName": "example-activity-****",
              "MediaWorkflowName": "example-mediaworkflow-****",
              "File": {
                "State": "Normal",
                "URL": "http://example-bucket-****.o"
              }
            }
          ]
        },
        "PublishState": "Published",
        "MediaInfo": {
          "Streams": {
            "VideoStreamList": {
              "VideoStream": [
                {
                  "Sar": "1:1",
                  "Height": "360",
                  "CodecTagString": "avc1",
                  "NetworkCost": {
                    "PreloadTime": "0.01",
                    "AvgBitrate": "2659.326",
                    "CostBandwidth": "100"
                  },
                  "Width": "640",
                  "Index": "5",
                  "Timebase": "1/15360",
                  "AvgFPS": "15.0",
                  "PixFmt": "yuv420p",
                  "Lang": "und",
                  "CodecLongName": "H.264/AVC/MPEG-4 AVC/MPEG-4 part 10",
                  "NumFrames": "12",
                  "Rotate": "90",
                  "Bitrate": "512.701",
                  "HasBFrames": "2",
                  "Profile": "High",
                  "StartTime": "0.046029",
                  "Dar": "16:9",
                  "CodecName": "H264",
                  "Duration": "79.200000",
                  "Fps": "15.0",
                  "CodecTag": "0x31637661",
                  "CodecTimeBase": "1/30",
                  "Level": "31"
                }
              ]
            },
            "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": "76.356",
                  "CodecTagString": "mp4a",
                  "StartTime": "0.000000",
                  "CodecName": "aac",
                  "Duration": "79.203265",
                  "CodecTag": "0x6134706d",
                  "CodecTimeBase": "1/44100"
                }
              ]
            },
            "SubtitleStreamList": {
              "SubtitleStream": [
                {
                  "Index": "1",
                  "Lang": "und"
                }
              ]
            }
          },
          "Format": {
            "StartTime": "0.000000",
            "NumPrograms": "0",
            "Size": "5872904",
            "NumStreams": "2",
            "FormatLongName": "QuickTime/MOV",
            "Duration": "79.204000",
            "Bitrate": "593.192",
            "FormatName": "mov"
          }
        },
        "Description": "This is description ****",
        "Size": "5872904",
        "Width": "640",
        "CoverURL": "http://example-bucket1-****.oss-cn-hangzhou.aliyuncs.com//example-****.png",
        "SnapshotList": {
          "Snapshot": [
            {
              "Type": "Single",
              "MediaWorkflowId": "6cc3aa66d1cb4bb2adf14e726c0a****",
              "ActivityName": "example-activity1-****",
              "Count": "3",
              "MediaWorkflowName": "example-workflow-****",
              "File": {
                "State": "Normal",
                "URL": "http://example1-bucket1-****.oss-cn-hangzhou.aliyuncs.com//example111-****.png"
              }
            }
          ]
        },
        "RunIdList": {
          "RunId": [
            "9343bd0e7bb54ae19228529908e5****"
          ]
        },
        "Duration": "79.204000",
        "Fps": "15.0",
        "Title": "kled.mp4",
        "Format": "mov"
      }
    ]
  },
  "NonExistFileURLs": {
    "FileURL": [
      "null"
    ]
  },
  "RequestId": "1C8A0AEB-4321-485B-B4CB-DA4E9E6C9B42"
}

Error codes

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

Change history

Change timeSummary of changesOperation
No change history