All Products
Search
Document Center

Intelligent Media Services:GetMediaInfo

Last Updated:Dec 16, 2024

Queries information about a media asset based on the ID of the media asset in Intelligent Media Services (IMS) or the input URL of the media asset.

Operation description

If the MediaId parameter is specified, the MediaId parameter is preferentially used for the query. If the MediaId parameter is left empty, the InputURL parameter must be specified.

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

Request parameters

ParameterTypeRequiredDescriptionExample
MediaIdstringNo

The ID of the media asset in IMS. If this parameter is left empty, the InputURL parameter must be specified.

****20b48fb04483915d4f2cd8ac****
InputURLstringNo

The input URL of the media asset in another service. The URL must be registered in the IMS content library and bound to the ID of the media asset in IMS.

  • For a media asset from Object Storage Service (OSS), the URL may have one of the following formats:

http(s)://example-bucket.oss-cn-shanghai.aliyuncs.com/example.mp4 or

oss://example-bucket/example.mp4. The second format indicates that the region in which the OSS bucket of the media asset resides is the same as the region in which OSS is activated.

http://example-bucket.oss-cn-shanghai.aliyuncs.com/example.mp4
OutputTypestringNo

The type of the URL of the media asset to return in the response. Valid values:

  • oss (default): an OSS URL.
  • cdn: a CDN URL. A CDN URL is returned only if the media asset is imported from ApsaraVideo VOD and the relevant domain name is an accelerated domain name in ApsaraVideo VOD.
cdn
ReturnDetailedInfostringNo

Specifies whether to return detailed information for specific media asset attributes. Supported attributes: AiRoughData.StandardSmartTagJob, which specifies whether to return detailed tag information if a tagging job has been submitted for the media asset. Valid values for the attribute:

  • false (default): The job result is returned as a URL.
  • true: The job result is returned as text.
{"AiRoughData.StandardSmartTagJob": false}

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The request ID.

2FDE2411-DB8D-4A9A-875B-275798F14A5E
MediaInfoobject

The information about the media asset.

MediaIdstring

The ID of the media asset.

****20b48fb04483915d4f2cd8ac****
MediaBasicInfoobject

The basic information about the media asset.

MediaIdstring

The ID of the media asset.

****20b48fb04483915d4f2cd8ac****
InputURLstring

The input URL of the media asset in another service.

https://example-bucket.oss-cn-shanghai.aliyuncs.com/example.mp4
MediaTypestring

The type of the media asset.

video
BusinessTypestring

The business type.

general
Sourcestring

The source.

oss
Titlestring

The title.

Descriptionstring

The content description.

Categorystring

The category.

MediaTagsstring

The tags.

CoverURLstring

The URL of the thumbnail.

http://example-bucket.oss-cn-shanghai.aliyuncs.com/example.png?Expires=<ExpireTime>&OSSAccessKeyId=<OSSAccessKeyId>&Signature=<Signature>&security-token=<SecurityToken>
UserDatastring

The user data.

userDataTest
Snapshotsstring

The snapshots.

[ "http://example-bucket.oss-cn-shanghai.aliyuncs.com/snapshot-00001.png?Expires=<ExpireTime>&OSSAccessKeyId=<OSSAccessKeyId>&Signature=<Signature>&security-token=<SecurityToken>", "http://example-bucket.oss-cn-shanghai.aliyuncs.com/snapshot-00002.jpg?Expires=<ExpireTime>&OSSAccessKeyId=<OSSAccessKeyId>&Signature=<Signature>&security-token=<SecurityToken>",   "http://example-bucket.oss-cn-shanghai.aliyuncs.com/snapshot-00003.jpg?Expires=<ExpireTime>&OSSAccessKeyId=<OSSAccessKeyId>&Signature=<Signature>&security-token=<SecurityToken>" ]
Statusstring

The resource status.

Normal
CreateTimestring

The time when the media asset was created.

2020-12-26T04:11:08Z
ModifiedTimestring

The time when the media asset was last modified.

2020-12-26T04:11:10Z
DeletedTimestring

The time when the media asset was deleted.

2020-12-26T04:11:15Z
SpriteImagesstring

The sprite.

[{"bucket":"example-bucket","count":"32","iceJobId":"******83ec44d58b2069def2e******","location":"oss-cn-shanghai","snapshotRegular":"example/example-{Count}.jpg","spriteRegular":"example/example-{TileCount}.jpg","templateId":"******e438b14ff39293eaec25******","tileCount":"1"}]
CateIdlong

The category ID.

3048
Bizstring

The service to which the media asset belongs.

ICE
UploadSourcestring

The upload source of the media asset.

general
CateNamestring

The category name.

cateName
ReferenceIdstring

The custom ID. The ID can be 6 to 64 characters in length and can contain only letters, digits, hyphens (-), and underscores (_). The ID is unique among users.

123-1234
FileInfoListarray<object>

The file information.

FileInfoobject
FileBasicInfoobject

The basic information about the file, including the duration and size.

FileNamestring

The file name.

example.mp4
FileStatusstring

The file status.

Normal
FileTypestring

The file type.

source_file
FileSizestring

The file size. Unit: bytes.

30611502
FileUrlstring

The OSS URL of the file.

http://example-bucket.oss-cn-shanghai.aliyuncs.com/example.mp4?Expires=<ExpireTime>&OSSAccessKeyId=<OSSAccessKeyId>&Signature=<Signature>&security-token=<SecurityToken>
Regionstring

The region in which the file is stored.

cn-shanghai
FormatNamestring

The container format.

mov,mp4,m4a,3gp,3g2,mj2
Durationstring

The duration.

216.206667
Bitratestring

The bitrate.

1132.68
Widthstring

The width.

960
Heightstring

The height.

540
CreateTimestring

The time when the file was created.

2020-12-26T04:11:08Z
ModifiedTimestring

The time when the file was last modified.

2020-12-26T04:11:10Z
AudioStreamInfoListarray<object>

The information about the audio tracks. A media asset may have multiple audio tracks.

AudioStreamInfoobject
Indexstring

The sequence number of the audio track.

1
CodecNamestring

The short name of the codec.

aac
CodecLongNamestring

The full name of the codec.

AAC (Advanced Audio Coding)
CodecTimeBasestring

The time base of the codec.

1/24000
CodecTagStringstring

The tag string of the codec.

mp4a
CodecTagstring

The tag of the codec.

0x6134706d
Profilestring

The codec profile.

High
SampleFmtstring

The sampling format.

fltp
SampleRatestring

The sampling rate.

44100
Channelsstring

The number of sound channels.

2
ChannelLayoutstring

The output layout of sound channels.

stereo
Timebasestring

The time base.

1/44100
StartTimestring

The start time.

0.000000
Durationstring

The duration.

16.200998
Bitratestring

The bitrate.

127.794
Fpsstring

The audio frame rate.

8
NumFramesstring

The number of frames.

10
Langstring

The language.

und
VideoStreamInfoListarray<object>

The information about the video tracks. A media asset may have multiple video tracks.

VideoStreamInfoobject
Indexstring

The sequence number of the video track.

0
CodecNamestring

The short name of the codec.

h264
CodecLongNamestring

The full name of the codec.

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

The codec profile.

High
CodecTimeBasestring

The time base of the codec.

1/48
CodecTagStringstring

The tag string of the codec.

[0][0][0][0]
CodecTagstring

The tag of the codec.

0x0000
Widthstring

The width.

960
Heightstring

The height.

540
HasBFramesstring

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

2
Sarstring

The sample aspect ratio (SAR).

0:1
Darstring

The display aspect ratio (DAR).

0:1
PixFmtstring

The pixel format.

yuv420p
Levelstring

The codec level.

30
Fpsstring

The video frame rate.

24.0
AvgFPSstring

The average video frame rate.

24.0
Timebasestring

The time base.

1/12288
StartTimestring

The start time.

0.081706
Durationstring

The duration.

216.206706
Bitratestring

The bitrate.

1001.594
NumFramesstring

The number of frames.

5184
Langstring

The language.

und
Rotatestring

The rotation angle.

0
Nb_framesstring

The total number of frames.

5184
SubtitleStreamInfoListarray<object>

The information about the subtitle tracks. A media asset may have multiple subtitle tracks.

SubtitleStreamInfoobject
Indexstring

The sequence number of the subtitle track.

1
CodecNamestring

The short name of the codec.

srt
CodecLongNamestring

The full name of the codec.

SubRip Text
CodecTimeBasestring

The time base of the codec.

29.97
CodecTagStringstring

The tag string of the codec.

unicode
CodecTagstring

The tag of the codec.

unicode
Timebasestring

The time base.

30
StartTimestring

The start time.

0
Durationstring

The duration.

1
Langstring

The language.

und
AiRoughDataobject

The original AI analysis data.

Resultstring

The analysis result.

https://sample-bucket.cn-shanghai.aliyuncs.com/result.json
Statusstring

The analysis status. Valid values:

  • Analyzing
  • AnalyzeSuccess
  • AnalyzeFailed
  • Saving
  • SaveSuccess
  • SaveFailed
  • Deleting
  • DeleteSuccess
  • DeleteFailed
Analyzing
SaveTypestring

The storage type. This parameter indicates the library in which the analysis data is stored. Valid values:

  • TEXT: the text library.
TEXT
AiCategorystring

The AI category. Valid values:

  • Life
  • Good-looking
  • Cute pets
  • News
  • Ads
  • Environmental resources
  • Automobile
AiJobIdstring

The ID of the AI task.

****483915d4f2cd8ac20b48fb04****
StandardSmartTagJobobject

The information about the tagging job.

AiJobIdstring

The ID of the AI task.

****483915d4f2cd8ac20b48fb04****
Statusstring

The analysis status. Valid values:

  • Analyzing
  • AnalyzeSuccess
  • AnalyzeFailed
Analyzing
ResultUrlstring

The URL of the tagging result.

http://xx.oss-cn-shanghai.aliyuncs.com/result2.txt
Resultsarray<object>

The recognized tags.

Resultobject

The information about the recognized tag.

Datastring

The result data. The value is a JSON string. For information about the data structures of different data types.

{"autoChapters": [...]}
Typestring

The tagging type. Valid values:

  • NLP: natural language processing (NLP)-based tagging
NLP

Examples

Sample success responses

JSONformat

{
  "RequestId": "2FDE2411-DB8D-4A9A-875B-275798F14A5E",
  "MediaInfo": {
    "MediaId": "****20b48fb04483915d4f2cd8ac****",
    "MediaBasicInfo": {
      "MediaId": "****20b48fb04483915d4f2cd8ac****",
      "InputURL": "https://example-bucket.oss-cn-shanghai.aliyuncs.com/example.mp4",
      "MediaType": "video",
      "BusinessType": "general",
      "Source": "oss",
      "Title": "",
      "Description": "",
      "Category": "",
      "MediaTags": "",
      "CoverURL": "http://example-bucket.oss-cn-shanghai.aliyuncs.com/example.png?Expires=<ExpireTime>&OSSAccessKeyId=<OSSAccessKeyId>&Signature=<Signature>&security-token=<SecurityToken>",
      "UserData": "userDataTest",
      "Snapshots": "[\n    \"http://example-bucket.oss-cn-shanghai.aliyuncs.com/snapshot-00001.png?Expires=<ExpireTime>&OSSAccessKeyId=<OSSAccessKeyId>&Signature=<Signature>&security-token=<SecurityToken>\",\n    \"http://example-bucket.oss-cn-shanghai.aliyuncs.com/snapshot-00002.jpg?Expires=<ExpireTime>&OSSAccessKeyId=<OSSAccessKeyId>&Signature=<Signature>&security-token=<SecurityToken>\",\n    \"http://example-bucket.oss-cn-shanghai.aliyuncs.com/snapshot-00003.jpg?Expires=<ExpireTime>&OSSAccessKeyId=<OSSAccessKeyId>&Signature=<Signature>&security-token=<SecurityToken>\"\n]",
      "Status": "Normal",
      "CreateTime": "2020-12-26T04:11:08Z",
      "ModifiedTime": "2020-12-26T04:11:10Z",
      "DeletedTime": "2020-12-26T04:11:15Z",
      "SpriteImages": "[{\"bucket\":\"example-bucket\",\"count\":\"32\",\"iceJobId\":\"******83ec44d58b2069def2e******\",\"location\":\"oss-cn-shanghai\",\"snapshotRegular\":\"example/example-{Count}.jpg\",\"spriteRegular\":\"example/example-{TileCount}.jpg\",\"templateId\":\"******e438b14ff39293eaec25******\",\"tileCount\":\"1\"}]",
      "CateId": 3048,
      "Biz": "ICE",
      "UploadSource": "general",
      "CateName": "cateName",
      "ReferenceId": "123-1234"
    },
    "FileInfoList": [
      {
        "FileBasicInfo": {
          "FileName": "example.mp4",
          "FileStatus": "Normal",
          "FileType": "source_file",
          "FileSize": "30611502",
          "FileUrl": "http://example-bucket.oss-cn-shanghai.aliyuncs.com/example.mp4?Expires=<ExpireTime>&OSSAccessKeyId=<OSSAccessKeyId>&Signature=<Signature>&security-token=<SecurityToken>",
          "Region": "cn-shanghai",
          "FormatName": "mov,mp4,m4a,3gp,3g2,mj2",
          "Duration": "216.206667",
          "Bitrate": "1132.68",
          "Width": "960",
          "Height": "540",
          "CreateTime": "2020-12-26T04:11:08Z",
          "ModifiedTime": "2020-12-26T04:11:10Z"
        },
        "AudioStreamInfoList": [
          {
            "Index": "1",
            "CodecName": "aac",
            "CodecLongName": "AAC (Advanced Audio Coding)",
            "CodecTimeBase": "1/24000",
            "CodecTagString": "mp4a",
            "CodecTag": "0x6134706d",
            "Profile": "High",
            "SampleFmt": "fltp",
            "SampleRate": "44100",
            "Channels": "2",
            "ChannelLayout": "stereo",
            "Timebase": "1/44100",
            "StartTime": "0.000000",
            "Duration": "16.200998",
            "Bitrate": "127.794",
            "Fps": "8",
            "NumFrames": "10",
            "Lang": "und"
          }
        ],
        "VideoStreamInfoList": [
          {
            "Index": "0",
            "CodecName": "h264",
            "CodecLongName": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
            "Profile": "High",
            "CodecTimeBase": "1/48",
            "CodecTagString": "[0][0][0][0]",
            "CodecTag": "0x0000",
            "Width": "960",
            "Height": "540",
            "HasBFrames": "2",
            "Sar": "0:1",
            "Dar": "0:1",
            "PixFmt": "yuv420p",
            "Level": "30",
            "Fps": "24.0",
            "AvgFPS": "24.0",
            "Timebase": "1/12288",
            "StartTime": "0.081706",
            "Duration": "216.206706",
            "Bitrate": "1001.594",
            "NumFrames": "5184",
            "Lang": "und",
            "Rotate": "0",
            "Nb_frames": "5184"
          }
        ],
        "SubtitleStreamInfoList": [
          {
            "Index": "1",
            "CodecName": "srt",
            "CodecLongName": "SubRip Text",
            "CodecTimeBase": "29.97",
            "CodecTagString": "unicode",
            "CodecTag": "unicode",
            "Timebase": "30",
            "StartTime": "0",
            "Duration": "1",
            "Lang": "und"
          }
        ]
      }
    ],
    "AiRoughData": {
      "Result": "https://sample-bucket.cn-shanghai.aliyuncs.com/result.json",
      "Status": "Analyzing",
      "SaveType": "TEXT",
      "AiCategory": "",
      "AiJobId": "****483915d4f2cd8ac20b48fb04****",
      "StandardSmartTagJob": {
        "AiJobId": "****483915d4f2cd8ac20b48fb04****",
        "Status": "Analyzing",
        "ResultUrl": "http://xx.oss-cn-shanghai.aliyuncs.com/result2.txt",
        "Results": [
          {
            "Data": "{\"autoChapters\": [...]}",
            "Type": "NLP"
          }
        ]
      }
    }
  }
}

Error codes

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

Change history

Change timeSummary of changesOperation
2024-06-04The response structure of the API has changedView Change Details
2024-04-24The request parameters of the API has changed. The response structure of the API has changedView Change Details
2021-11-25The response structure of the API has changedView Change Details
2021-03-31The response structure of the API has changedView Change Details