All Products
Search
Document Center

Intelligent Media Services:GetMediaInfo

Last Updated:Jun 11, 2026

Mengambil dan mengembalikan informasi aset media berdasarkan mediaId IMS atau InputURL aset media.

Deskripsi operasi

Jika MediaId tidak kosong, MediaId akan diutamakan. Jika MediaId kosong, InputURL harus tidak kosong.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

ice:GetMediaInfo

get

*全部资源

*

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

MediaId

string

No

ID aset media IMS. Jika parameter ini kosong, InputURL diperlukan.

****20b48fb04483915d4f2cd8ac****

InputURL

string

No

Alamat aset media yang akan dikueri di sistem terkait. Alamat harus terdaftar di pustaka konten IMS dan dilampirkan ke mediaId IMS sebelum digunakan.

  • Alamat OSS. Dua format didukung:

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

oss://example-bucket/example.mp4. Format ini mengasumsikan wilayah OSS sama dengan area pendaftaran layanan secara default.

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

OutputType

string

No

Tipe alamat file media dalam tanggapan. Nilai valid:

  • oss: mengembalikan alamat OSS. Ini adalah nilai default.

  • cdn: mengembalikan alamat CDN. Alamat CDN hanya dikembalikan jika aset media diimpor dari VOD dan nama domain akselerasi dikonfigurasi di VOD.

cdn

ReturnDetailedInfo

string

No

Apakah akan mengembalikan informasi detail untuk bidang aset media terkait. Bidang yang didukung: AiRoughData.StandardSmartTagJob: apakah akan mengembalikan hasil penandaan detail jika aset media telah dikirim untuk analisis tag.

  • Nilai default: false. Hasil tugas dikembalikan sebagai URL.

  • true: hasil tugas dikembalikan sebagai teks.

{"AiRoughData.StandardSmartTagJob": false}

AuthTimeout

integer

No

Elemen respons

Element

Type

Description

Example

object

Skema Respons.

RequestId

string

ID permintaan.

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

MediaInfo

object

Informasi aset media.

MediaId

string

ID aset media.

****20b48fb04483915d4f2cd8ac****

MediaBasicInfo

object

BasicInfo.

MediaId

string

The ID of the media asset.

****20b48fb04483915d4f2cd8ac****

InputURL

string

The input URL of the media asset in another service.

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

MediaType

string

The type of the media asset.

video

BusinessType

string

The business type.

general

Source

string

The source.

oss

Title

string

The title.

标题

Description

string

The content description.

描述

Category

string

The category.

分类

MediaTags

string

The tags.

标签,tag1

CoverURL

string

The URL of the thumbnail.

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

UserData

string

The user data.

userDataTest

Snapshots

string

The snapshots.

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

Status

string

The resource status.

Normal

CreateTime

string

The time when the media asset was created.

2020-12-26T04:11:08Z

ModifiedTime

string

The time when the media asset was last modified.

2020-12-26T04:11:10Z

DeletedTime

string

The time when the media asset was deleted.

2020-12-26T04:11:15Z

SpriteImages

string

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"}]

CateId

integer

The category ID.

3048

Biz

string

The service to which the media asset belongs.

ICE

UploadSource

string

The upload source of the media asset.

general

CateName

string

The category name.

cateName

ReferenceId

string

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

FileInfoList

array<object>

Daftar objek FileInfo.

array<object>

FileBasicInfo

object

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

FileName

string

The file name.

example.mp4

FileStatus

string

The file status.

Normal

FileType

string

The file type.

source_file

FileSize

string

The file size. Unit: bytes.

30611502

FileUrl

string

The OSS URL of the file.

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

Region

string

The region in which the file is stored.

cn-shanghai

FormatName

string

The container format.

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

Duration

string

The duration.

216.206667

Bitrate

string

The bitrate.

1132.68

Width

string

The width.

960

Height

string

The height.

540

CreateTime

string

The time when the file was created.

2020-12-26T04:11:08Z

ModifiedTime

string

The time when the file was last modified.

2020-12-26T04:11:10Z

AudioStreamInfoList

array<object>

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

object

Index

string

The sequence number of the audio track.

1

CodecName

string

The short name of the codec.

aac

CodecLongName

string

The full name of the codec.

AAC (Advanced Audio Coding)

CodecTimeBase

string

The time base of the codec.

1/24000

CodecTagString

string

The tag string of the codec.

mp4a

CodecTag

string

The tag of the codec.

0x6134706d

Profile

string

The codec profile.

High

SampleFmt

string

The sampling format.

fltp

SampleRate

string

The sampling rate.

44100

Channels

string

The number of sound channels.

2

ChannelLayout

string

The output layout of sound channels.

stereo

Timebase

string

The time base.

1/44100

StartTime

string

The start time.

0.000000

Duration

string

The duration.

16.200998

Bitrate

string

The bitrate.

127.794

Fps

string

The audio frame rate.

8

NumFrames

string

The number of frames.

10

Lang

string

The language.

und

VideoStreamInfoList

array<object>

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

object

Index

string

The sequence number of the video track.

0

CodecName

string

The short name of the codec.

h264

CodecLongName

string

The full name of the codec.

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

Profile

string

The codec profile.

High

CodecTimeBase

string

The time base of the codec.

1/48

CodecTagString

string

The tag string of the codec.

[0][0][0][0]

CodecTag

string

The tag of the codec.

0x0000

Width

string

The width.

960

Height

string

The height.

540

HasBFrames

string

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

2

Sar

string

The sample aspect ratio (SAR).

0:1

Dar

string

The display aspect ratio (DAR).

0:1

PixFmt

string

The pixel format.

yuv420p

Level

string

The codec level.

30

Fps

string

The video frame rate.

24.0

AvgFPS

string

The average video frame rate.

24.0

Timebase

string

The time base.

1/12288

StartTime

string

The start time.

0.081706

Duration

string

The duration.

216.206706

Bitrate

string

The bitrate.

1001.594

NumFrames

string

The number of frames.

5184

Lang

string

The language.

und

Rotate

string

The rotation angle.

0

Nb_frames

string

The total number of frames.

5184

SubtitleStreamInfoList

array<object>

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

object

Index

string

The sequence number of the subtitle track.

1

CodecName

string

The short name of the codec.

srt

CodecLongName

string

The full name of the codec.

SubRip Text

CodecTimeBase

string

The time base of the codec.

29.97

CodecTagString

string

The tag string of the codec.

unicode

CodecTag

string

The tag of the codec.

unicode

Timebase

string

The time base.

30

StartTime

string

The start time.

0

Duration

string

The duration.

1

Lang

string

The language.

und

AiRoughData

object

Data mentah analisis AI.

Result

string

The analysis result.

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

Status

string

The analysis status. Valid values:

  • Analyzing

  • AnalyzeSuccess

  • AnalyzeFailed

  • Saving

  • SaveSuccess

  • SaveFailed

  • Deleting

  • DeleteSuccess

  • DeleteFailed

Analyzing

SaveType

string

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

  • TEXT: the text library.

TEXT

AiCategory

string

The AI category. Valid values:

  • Life

  • Good-looking

  • Cute pets

  • News

  • Ads

  • Environmental resources

  • Automobile

生活

AiJobId

string

The ID of the AI task.

****483915d4f2cd8ac20b48fb04****

StandardSmartTagJob

object

The information about the tagging job.

AiJobId

string

The ID of the AI task.

****483915d4f2cd8ac20b48fb04****

Status

string

The analysis status. Valid values:

  • Analyzing

  • AnalyzeSuccess

  • AnalyzeFailed

Analyzing

ResultUrl

string

The URL of the tagging result.

http://xx.oss-cn-shanghai.aliyuncs.com/result2.txt

Results

array<object>

The recognized tags.

object

The information about the recognized tag.

Data

string

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

{"autoChapters": [...]}

Type

string

The tagging type. Valid values:

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

NLP

Contoh

Respons sukses

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": "标签,tag1",
      "CoverURL": "http://example-bucket.oss-cn-shanghai.aliyuncs.com/example.png?Expires=&OSSAccessKeyId=&Signature=&security-token=",
      "UserData": "userDataTest",
      "Snapshots": "[\n    \"http://example-bucket.oss-cn-shanghai.aliyuncs.com/snapshot-00001.png?Expires=&OSSAccessKeyId=&Signature=&security-token=\",\n    \"http://example-bucket.oss-cn-shanghai.aliyuncs.com/snapshot-00002.jpg?Expires=&OSSAccessKeyId=&Signature=&security-token=\",\n    \"http://example-bucket.oss-cn-shanghai.aliyuncs.com/snapshot-00003.jpg?Expires=&OSSAccessKeyId=&Signature=&security-token=\"\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=&OSSAccessKeyId=&Signature=&security-token=",
          "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"
          }
        ]
      }
    }
  }
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.