All Products
Search
Document Center

ApsaraVideo VOD:BatchGetMediaInfos

Last Updated:Mar 21, 2025

Obtains the basic information and source file information of multiple media assets.

Operation description

  • You can specify up to 20 audio or video file IDs in each request.
  • After a media file is uploaded, ApsaraVideo VOD processes the source file. Then, information about the media file is asynchronously generated. You can configure notifications for the VideoAnalysisComplete event and call this operation to query information about a media file after you receive notifications for the VideoAnalysisComplete event. For more information, see Overview .

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:
    • For mandatory resource types, indicate with a prefix of * .
    • 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
vod:BatchGetMediaInfosget
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
MediaIdsstringYes

The ID of the media asset. The ID can be the video ID or audio ID. Separate IDs with commas (,). You can specify a maximum of 20 IDs. You can use one of the following methods to obtain the ID of the media asset:

  • Log on to the ApsaraVideo VOD console. In the left-side navigation pane, choose Media Files > Audio/Video. On the Video and Audio page, view the ID of the media asset. This method is applicable to files that are uploaded by using the ApsaraVideo VOD console.
  • Obtain the value of VideoId from the response to the CreateUploadVideo operation that you call to upload media assets.
  • Obtain the value of VideoId from the response to the SearchMedia operation that you call to query the media ID after the media asset is uploaded.
61ccbdb06fa83012be4d8083f6****,7d2fbc380b0e08e55f****

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

9E290613-04F4-47F4-795D30732077****
NonExistMediaIdsarray

The IDs of the media assets that do not exist.

MediaIdstring

The ID of the media assets that do not exist.

["bbc65bba53f6ed90de118a7849****"]
ForbiddenMediaIdsarray

The IDs of the media assets that do not support the operation typically because you are not authorized to perform the operation. For more information, see Overview .

MediaIdstring

The ID of the media asset that does not support the operation typically because you are not authorized to perform the operations. For more information, see Overview .

["bbc65bba53f6ed90de118a7849****"]
MediaInfosarray<object>

Details about media assets.

MediaInfoobject

Details about a media asset.

MediaIdstring

The ID of the media asset.

10a5fa364a5b71ef89246733a78e****
MediaInfoobject

The basic information of the media asset.

StorageLocationstring

The storage address of the media asset.

outin-***.oss-cn-shanghai.aliyuncs.com
CreationTimestring

The time when the media asset was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2017-11-14T09:15:50Z
Statusstring

The status of the video. Valid values:

  • Uploading
  • UploadFail
  • UploadSucc
  • Transcoding
  • TranscodeFail
  • Blocked
  • Normal
Normal
CateIdlong

The ID of the category.

781111****
MediaIdstring

The ID of the media asset.

7753d144efd74d6c45fe0570****
DownloadSwitchstring

Indicates whether the offline download feature is enabled. If you enable the offline download feature, users can download and play videos by using the ApsaraVideo Player on a local PC. For more information, see Configure download settings. Valid values:

  • on
  • off
on
Tagsstring

The tags of the media asset. Separate tags with commas (,).

tag1,tag2
ModificationTimestring

The time when the media asset was last updated. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2017-06-26T06:38:48Z
CateNamestring

The name of the category.

CateName
Descriptionstring

The description of the media asset.

Aliyun VOD Video Description
AppIdstring

The ID of the application.

app-****
CoverURLstring

The thumbnail URL of the media asset.

https://example.aliyundoc.com/****.jpg
TemplateGroupIdstring

The ID of the transcoding template group.

b4039216985f4312a5382a4ed****
Titlestring

The title of the media asset.

Aliyun VOD Video Title
Snapshotsarray

The array of video snapshot URLs.

Snapshotstring

The video snapshot URL.

Note Only information about the thumbnail snapshot is returned. To obtain information about normal, sprite, source sprite, WebVTT snapshots, call the ListSnapshots operation. For more information, see Video snapshots.
["http://example.aliyundoc.com/snapshot/****.jpg?auth_key=1498476426-0-0-f00b9455c49a423ce69cf4e27333****","http://example.aliyundoc.com/snapshot/****.jpg?auth_key=1498476426-0-0-f00b9455c49a423ce69cf4e27243****",...]
StorageClassstring

The storage type. Valid values:

  • Standard: All media assets are stored as Standard objects.
  • IA: All media assets are stored as IA objects.
  • Archive: All media assets are stored as Archive objects.
  • ColdArchive: All media assets are stored as Cold Archive objects.
  • SourceIA: Only the source files are IA objects.
  • SourceArchive: Only the source files are Archive objects.
  • SourceColdArchive: Only the source file is stored as a Cold Archive object.
  • Changing: The storage class of the media asset is being changed.
  • SourceChanging: The storage class of the media asset is being changed.
Standard
RestoreStatusstring

The restoration status of the media asset. Valid values:

  • Processing
  • Success
  • Failed
Success
RestoreExpirationstring

The period of time in which the audio file remains in the restored state.

2023-03-30T10:14:14Z
UserDatastring

The custom parameters.

{"Extend":"xxx","MessageCallback":"xxx"}
MezzanineInfoobject

The source file information.

CreationTimestring

The time when the source file was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2017-11-14T09:15:50Z
Statusstring

The state of the file. Valid values:

  • Uploading: The file is being uploaded. This is the initial status.
  • Normal: The file is uploaded.
  • UploadFail: The file failed to be uploaded.
  • Deleted: The file is deleted.
Normal
FileURLstring

The OSS URL of the source file.

http://example-bucket-****.oss-cn-shanghai.aliyuncs.com/27ffc438-164h67f57ef-0005-6884-51a-1****.mp4
MediaIdstring

The ID of the media asset.

1f1a6fc03ca04814031b8a6559e****
Heightlong

The height of the file. Unit: pixels.

540
Bitratestring

The bitrate of the file. Unit: Kbit/s.

771.2280
FileNamestring

The name of the file.

27ffc438-164h67f57ef-0005-6884-51a-1****.mp4
Widthlong

The width of the file. Unit: pixels.

960
Sizelong

The size of the file. Unit: bytes.

4096477
Durationstring

The duration of the file. Unit: seconds.

42.4930
Fpsstring

The frame rate of the file.

25.0000
AudioStreamListarray<object>

The information about the audio stream.

AudioStreamobject

The details of the audio stream.

Indexstring

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

0
Timebasestring

The time base.

0.000000
SampleFmtstring

The sampling format.

fltp
SampleRatestring

The sampling rate.

44100
ChannelLayoutstring

The output layout of the audio channels. Valid values:

  • mono
  • stereo
mono
Langstring

The language.

und
CodecLongNamestring

The full name of the encoding format.

AAC (Advanced Audio Coding)
Channelsstring

The number of sound tracks.

1
NumFramesstring

The total number of frames.

1
Bitratestring

The bitrate.

62.885
CodecTagStringstring

The tag string of the encoding format.

mp4a
StartTimestring

The start time. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2017-01-11T12:00:00Z
CodecNamestring

The short name of the encoding format.

aac
Durationstring

The duration.

3.227574
CodecTagstring

The tag of the encoding format.

0x6134706d
CodecTimeBasestring

The time base of the encoder.

1/44100
VideoStreamListarray<object>

The information about the video streams.

VideoStreamobject

The information about the video stream.

Timebasestring

The time base.

0.000000
Indexstring

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

1
AvgFPSstring

The average frame rate.

30.0
PixFmtstring

The pixel format of the video stream.

yuv420p
Langstring

The language.

und
Sarstring

The sample aspect ratio (SAR).

0:1
Heightstring

The height of the video stream.

320
CodecLongNamestring

The full name of the encoding format.

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

The total number of frames.

0
Bitratestring

The bitrate of the file. Unit: Kbit/s.

500
Rotatestring

The rotation angle of the video. Valid values: [0,360).

90
CodecTagStringstring

The tag string of the encoding format.

avc1
HasBFramesstring

Indicates whether the video stream contains bidirectional frames (B-frames).

0
Profilestring

The codec profile.

Main
StartTimestring

The start time. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2017-01-11T12:00:00Z
Darstring

The display aspect ratio (DAR).

0:1
CodecNamestring

The short name of the encoding format.

h264
Widthstring

The horizontal resolution of the video.

568
Durationstring

The duration.

3.166667
Fpsstring

The frame rate of the output file.

30.0
CodecTagstring

The tag of the encoding format.

0x31637661
CodecTimeBasestring

The time base of the encoder.

1/60
Levelstring

The codec level.

30
HDRTypestring

The HDR type of the video stream.

HDR
PlayInfoListarray<object>

The information about the audio or video stream.

PlayInfoobject

The audio or video details.

CreationTimestring

The creation time. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2022-04-18T07:37:15Z
Statusstring

The status of the audio or video stream. Valid values:

  • Normal: The latest transcoded stream in each quality and format is in the Normal status.
  • Invisible: If multiple streams are transcoded in the same quality and format, the latest transcoded stream is in the Normal status and other streams are in the Invisible status.
Normal
Specificationstring

The specifications of transcoded audio and video streams. For more information about the valid values, see Output specifications.

H264.LD
NarrowBandTypestring

The transcoding type. Valid values:

  • 0: regular transcoding
  • 1.0: Narrowband HD™ 1.0 transcoding
  • 2.0: Narrowband HD™ 2.0 transcoding
0
Heightlong

The height of the media stream. Unit: pixels.

640
Bitratestring

The bitrate of the media stream. Unit: Kbit/s.

450.878
ModificationTimestring

The update time. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2022-04-20T06:32:19Z
WatermarkIdstring

The ID of the watermark that is associated with the media stream.

dgfn26457856****
Encryptlong

Indicates whether the media stream was encrypted. Valid values:

  • 0: The media stream is not encrypted.
  • 1: The media stream is encrypted.
1
Definitionstring

The quality of the video stream. Valid values:

  • FD: low definition
  • LD: standard definition
  • SD: high definition
  • HD: ultra-high definition
  • OD: original definition
  • 2K
  • 4K
  • SQ: standard sound quality
  • HQ: high sound quality
  • AUTO: adaptive bitrate
LD
EncryptTypestring

The encryption type of the media stream. Valid values:

  • AliyunVoDEncryption: Alibaba Cloud proprietary cryptography
  • HLSEncryption: HTTP Live Streaming (HLS) encryption
Note If the encryption type is AliyunVoDEncryption, only ApsaraVideo Player SDK can be used to play videos.
AliyunVoDEncryption
EncryptModestring

The encryption type of the media stream. Valid values:

  • License: decryption on local devices.
Note If the encryption type is License, only ApsaraVideo Player SDK can be used to play videos.
License
StreamTypestring

The type of the media stream. If the media stream is a video stream, the value is video. If the media stream is an audio-only stream, the value is audio.

video
JobIdstring

The job ID for transcoding the media stream. This ID uniquely identifies a media stream.

80e9c6580e754a798c3c19c59b16****
Sizelong

The size of the media stream. Unit: bytes.

418112
Widthlong

The width of the media stream. Unit: pixels.

360
Fpsstring

The frame rate of the media stream. Unit: frames per second (FPS).

25
Durationstring

The duration of the media stream. Unit: seconds.

9.0464
PlayURLstring

The playback URL of the video stream.

https://example.aliyundoc.com/d52ee123f331466aabf6ab32a93d****/a777f9e24e6e47a2a942467d5c38ea37-8ee8e04293c6657fdda282bc422704****.m3u8
Formatstring

The format of the media stream.

  • If the media file is a video file, the valid values are mp4 and m3u8.
  • If the media asset is an audio-only file, the value is mp3.
m3u8
HDRTypestring

The HDR type of the media stream. Valid values:

  • HDR
  • HDR10
  • HLG
  • DolbyVision
  • HDRVivid
  • SDR+
HLG
BitDepthinteger

The color depth. This value is an integer.

8
JobTypeinteger

The type of the digital watermark. Valid values:

  • 1: user-tracing watermark
  • 2: copyright watermark
2
JobExtstring

The custom watermark information of the copyright watermark. This parameter is returned if you set JobType to 2.

CopyrightMarkTest
CodecNamestring

The short name of the codec.

h264
TemplateIdstring

The ID of the transcoding template.

a86a4338dd2e83da45154004a541****
TemplateGroupIdstring

The ID of the transcoding template group.

fb0716154b21a4ecb5b70a26ccc8****

Examples

Sample success responses

JSONformat

{
  "RequestId": "9E290613-04F4-47F4-795D30732077****",
  "NonExistMediaIds": [
    "[\"bbc65bba53f6ed90de118a7849****\"]"
  ],
  "ForbiddenMediaIds": [
    "[\"bbc65bba53f6ed90de118a7849****\"]"
  ],
  "MediaInfos": [
    {
      "MediaId": "10a5fa364a5b71ef89246733a78e****",
      "MediaInfo": {
        "StorageLocation": "outin-***.oss-cn-shanghai.aliyuncs.com",
        "CreationTime": "2017-11-14T09:15:50Z",
        "Status": "Normal",
        "CateId": 0,
        "MediaId": "7753d144efd74d6c45fe0570****",
        "DownloadSwitch": "on",
        "Tags": "tag1,tag2",
        "ModificationTime": "2017-06-26T06:38:48Z",
        "CateName": "CateName",
        "Description": "Aliyun VOD Video Description",
        "AppId": "app-****",
        "CoverURL": "https://example.aliyundoc.com/****.jpg",
        "TemplateGroupId": "b4039216985f4312a5382a4ed****",
        "Title": "Aliyun VOD Video Title",
        "Snapshots": [
          "[\"http://example.aliyundoc.com/snapshot/****.jpg?auth_key=1498476426-0-0-f00b9455c49a423ce69cf4e27333****\",\"http://example.aliyundoc.com/snapshot/****.jpg?auth_key=1498476426-0-0-f00b9455c49a423ce69cf4e27243****\",...]"
        ],
        "StorageClass": "Standard",
        "RestoreStatus": "Success",
        "RestoreExpiration": "2023-03-30T10:14:14Z",
        "UserData": "{\"Extend\":\"xxx\",\"MessageCallback\":\"xxx\"}"
      },
      "MezzanineInfo": {
        "CreationTime": "2017-11-14T09:15:50Z",
        "Status": "Normal",
        "FileURL": "http://example-bucket-****.oss-cn-shanghai.aliyuncs.com/27ffc438-164h67f57ef-0005-6884-51a-1****.mp4",
        "MediaId": "1f1a6fc03ca04814031b8a6559e****",
        "Height": 540,
        "Bitrate": "771.2280",
        "FileName": "27ffc438-164h67f57ef-0005-6884-51a-1****.mp4\n",
        "Width": 960,
        "Size": 4096477,
        "Duration": "42.4930",
        "Fps": "25.0000",
        "AudioStreamList": [
          {
            "Index": "0",
            "Timebase": "0.000000",
            "SampleFmt": "fltp",
            "SampleRate": "44100",
            "ChannelLayout": "mono",
            "Lang": "und",
            "CodecLongName": "AAC (Advanced Audio Coding)\n",
            "Channels": "1",
            "NumFrames": "1",
            "Bitrate": "62.885",
            "CodecTagString": "mp4a",
            "StartTime": "2017-01-11T12:00:00Z",
            "CodecName": "aac",
            "Duration": "3.227574",
            "CodecTag": "0x6134706d",
            "CodecTimeBase": "1/44100"
          }
        ],
        "VideoStreamList": [
          {
            "Timebase": "0.000000",
            "Index": "1",
            "AvgFPS": "30.0",
            "PixFmt": "yuv420p",
            "Lang": "und",
            "Sar": "0:1",
            "Height": "320",
            "CodecLongName": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
            "NumFrames": "0",
            "Bitrate": "500",
            "Rotate": "90",
            "CodecTagString": "avc1",
            "HasBFrames": "0",
            "Profile": "Main",
            "StartTime": "2017-01-11T12:00:00Z",
            "Dar": "0:1",
            "CodecName": "h264",
            "Width": "568",
            "Duration": "3.166667",
            "Fps": "30.0",
            "CodecTag": "0x31637661",
            "CodecTimeBase": "1/60",
            "Level": "30",
            "HDRType": "HDR"
          }
        ]
      },
      "PlayInfoList": [
        {
          "CreationTime": "2022-04-18T07:37:15Z\n",
          "Status": "Normal",
          "Specification": "H264.LD",
          "NarrowBandType": "0",
          "Height": 640,
          "Bitrate": "450.878",
          "ModificationTime": "2022-04-20T06:32:19Z",
          "WatermarkId": "dgfn26457856****",
          "Encrypt": 1,
          "Definition": "LD",
          "EncryptType": "AliyunVoDEncryption",
          "EncryptMode": "License",
          "StreamType": "video",
          "JobId": "80e9c6580e754a798c3c19c59b16****",
          "Size": 418112,
          "Width": 360,
          "Fps": "25",
          "Duration": "9.0464",
          "PlayURL": "https://example.aliyundoc.com/d52ee123f331466aabf6ab32a93d****/a777f9e24e6e47a2a942467d5c38ea37-8ee8e04293c6657fdda282bc422704****.m3u8",
          "Format": "m3u8",
          "HDRType": "HLG",
          "BitDepth": 8,
          "JobType": 2,
          "JobExt": "CopyrightMarkTest",
          "CodecName": "h264",
          "TemplateId": "a86a4338dd2e83da45154004a541****",
          "TemplateGroupId": "fb0716154b21a4ecb5b70a26ccc8****"
        }
      ]
    }
  ]
}

Error codes

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

Change history

Change timeSummary of changesOperation
2025-01-08The response structure of the API has changedView Change Details