Todos os produtos
Search
Central de documentação

Intelligent Media Services:GetMediaInfo

Última atualização: Jun 29, 2026

Obtém informações de ativos de mídia usando um mediaId do Intelligent Media Services (IMS) ou um InputURL.

Descrição da operação

MediaId tem precedência. Se MediaId estiver vazio, InputURL não deve ser nulo.

Experimente agora

Experimente esta API no OpenAPI Explorer, sem necessidade de assinatura manual. Chamadas bem-sucedidas geram automaticamente código SDK correspondente aos seus parâmetros. Faça o download com segurança de credenciais integrada para uso local.

Testar

Autorização RAM

A tabela abaixo descreve a autorização necessária para chamar esta API. Você pode defini-la em uma política do Resource Access Management (RAM). As colunas da tabela estão detalhadas abaixo:

  • Ação: As ações que podem ser usadas no elemento Action das instruções de política de permissão do RAM para conceder permissões para executar a operação.

  • API: A API que você pode chamar para executar a ação.

  • Nível de acesso: O nível de acesso predefinido concedido para cada API. Valores válidos: create, list, get, update e delete.

  • Tipo de recurso: O tipo de recurso que suporta autorização para executar a ação. Indica se a ação suporta permissão em nível de recurso. O recurso especificado deve ser compatível com a ação. Caso contrário, a política será ineficaz.

    • Para APIs com permissões em nível de recurso, os tipos de recursos obrigatórios são marcados com um asterisco (*). Especifique o Nome de Recurso Alibaba Cloud (ARN) correspondente no elemento Resource da política.

    • Para APIs sem permissões em nível de recurso, é exibido como Todos os Recursos. Use um asterisco (*) no elemento Resource da política.

  • Chave de condição: As chaves de condição definidas pelo serviço. A chave permite controle granular, aplicando-se somente a ações ou a ações associadas a recursos específicos. Além das chaves de condição específicas do serviço, o Alibaba Cloud fornece um conjunto de chaves de condição comuns aplicáveis a todos os serviços compatíveis com RAM.

  • Ação dependente: As ações dependentes necessárias para executar a ação. Para concluir a ação, o usuário RAM ou a função RAM deve ter permissões para executar todas as ações dependentes.

Ação

Nível de acesso

Tipo de recurso

Chave de condição

Ação dependente

ice:GetMediaInfo

get

*All Resource

*

Nenhuma Nenhuma

Parâmetros da solicitação

Parâmetro

Tipo

Obrigatório

Descrição

Exemplo

MediaId

string

Não

O ID do ativo de mídia no Intelligent Media Services (IMS). Se você omitir este parâmetro, deverá especificar InputURL.

****20b48fb04483915d4f2cd8ac****

InputURL

string

Não

O endereço do ativo de mídia a ser consultado. Você deve primeiro registrar o ativo de mídia na biblioteca de mídia do IMS e vinculá-lo a um mediaId.

  • URL do Object Storage Service (OSS). Dois formatos são suportados:

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

oss://example-bucket/example.mp4. Ao usar este formato, a região do OSS assume como padrão a região do endpoint do serviço.

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

OutputType

string

Não

O tipo de URL a ser retornado para o arquivo do ativo de mídia.

  • oss: Retorna a URL do OSS. Este é o valor padrão.

  • cdn: Retorna a URL da Content Delivery Network (CDN). Uma URL de CDN é retornada apenas se o ativo de mídia foi importado do Video on Demand (VOD) e tem um nome de domínio de CDN configurado no VOD.

cdn

ReturnDetailedInfo

string

Não

Especifica se devem ser retornadas informações detalhadas para campos específicos do ativo de mídia. O único campo suportado é AiRoughData.StandardSmartTagJob, que especifica como o resultado de uma tarefa de análise de tags é retornado.

  • false: O resultado da tarefa é retornado como uma URL. Este é o valor padrão.

  • true: O resultado da tarefa é retornado como uma string.

{"AiRoughData.StandardSmartTagJob": false}

AuthTimeout

integer

Não

O período de validade da URL assinada, em segundos.

Elementos de resposta

Elemento

Tipo

Descrição

Exemplo

object

O esquema da resposta.

RequestId

string

O ID da solicitação.

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

MediaInfo

object

Informações sobre o ativo de mídia.

MediaId

string

O ID do ativo de mídia.

****20b48fb04483915d4f2cd8ac****

MediaBasicInfo

object

Informações básicas sobre o ativo de mídia.

MediaId

string

The media asset ID.

****20b48fb04483915d4f2cd8ac****

InputURL

string

The media asset URL.

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

MediaType

string

The media asset type.

video

BusinessType

string

The business type of the media asset.

general

Source

string

The source of the media asset.

oss

Title

string

The title of the media asset.

Title

Description

string

The description of the media asset.

Description

Category

string

The category of the media asset.

Category

MediaTags

string

A comma-separated list of tags for the media asset.

tag1

CoverURL

string

The cover image URL.

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

UserData

string

Custom user data.

userDataTest

Snapshots

string

A list of snapshot URLs.

[ "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 status of the media asset.

Normal

CreateTime

string

The time when the media asset was created. The time is in UTC and follows the YYYY-MM-DDTHH:MM:SSZ format.

2020-12-26T04:11:08Z

ModifiedTime

string

The time when the media asset was last modified. The time is in UTC and follows the YYYY-MM-DDTHH:MM:SSZ format.

2020-12-26T04:11:10Z

DeletedTime

string

The time when the media asset was deleted. The time is in UTC and follows the YYYY-MM-DDTHH:MM:SSZ format.

2020-12-26T04:11:15Z

SpriteImages

string

The details of the generated sprite images.

[{"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 business associated with the media asset.

ICE

UploadSource

string

The upload source of the media asset.

general

CateName

string

The name of the category.

cateName

ReferenceId

string

A custom, user-unique ID. It must be 6 to 64 characters long and can only contain letters, digits, hyphens (-), and underscores (_).

123-1234

FileInfoList

array<object>

Uma lista de objetos de informações de arquivo.

array<object>

FileBasicInfo

object

The basic information about the file, such as the duration and size.

FileName

string

The name of the file.

example.mp4

FileStatus

string

The status of the file.

Normal

FileType

string

The type of the file.

source_file

FileSize

string

The file size in bytes.

30611502

FileUrl

string

The file's OSS URL.

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

Region

string

The Region where the file is stored.

cn-shanghai

FormatName

string

The container format.

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

Duration

string

The file duration in seconds.

216.206667

Bitrate

string

The file bitrate in kbit/s.

1132.68

Width

string

The video width in pixels.

960

Height

string

The video height in pixels.

540

CreateTime

string

The time when the file was created. The time is in UTC and follows the YYYY-MM-DDTHH:MM:SSZ format.

2020-12-26T04:11:08Z

ModifiedTime

string

The time when the file was last modified. The time is in UTC and follows the YYYY-MM-DDTHH:MM:SSZ format.

2020-12-26T04:11:10Z

AudioStreamInfoList

array<object>

A list of audio stream information. A media asset may contain multiple audio streams.

object

Index

string

The index of the audio stream.

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 encoding profile.

High

SampleFmt

string

The sample format.

fltp

SampleRate

string

The sample rate, in Hz.

44100

Channels

string

The number of audio channels.

2

ChannelLayout

string

The channel layout.

stereo

Timebase

string

The time base.

1/44100

StartTime

string

The start time, in seconds.

0.000000

Duration

string

The duration, in seconds.

16.200998

Bitrate

string

The bitrate, in kbit/s.

127.794

Fps

string

The audio frame rate.

8

NumFrames

string

The total number of audio frames.

10

Lang

string

The language.

und

VideoStreamInfoList

array<object>

A list of video stream information. A media asset may contain multiple video streams.

object

Index

string

The index of the video stream.

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 encoding 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 video width in pixels.

960

Height

string

The video height in pixels.

540

HasBFrames

string

Specifies whether B-frames exist.

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 encoding level.

30

Fps

string

The video frame rate.

24.0

AvgFPS

string

The average frame rate.

24.0

Timebase

string

The time base.

1/12288

StartTime

string

The start time, in seconds.

0.081706

Duration

string

The duration, in seconds.

216.206706

Bitrate

string

The bitrate, in kbit/s.

1001.594

NumFrames

string

The total number of frames.

5184

Lang

string

The language.

und

Rotate

string

The rotation angle of the video.

0

Nb_frames

string

The total number of video frames.

5184

SubtitleStreamInfoList

array<object>

A list of subtitle stream information. A media asset may contain multiple subtitle streams.

object

Index

string

The index of the subtitle stream.

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, in seconds.

0

Duration

string

The duration.

1

Lang

string

The language.

und

AiRoughData

object

Os dados brutos da análise de IA.

Result

string

The raw AI analysis result.

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

Status

string

The status of the AI analysis:

  • Analyzing: The analysis is in progress.

  • AnalyzeSuccess: The analysis is successful.

  • AnalyzeFailed: The analysis failed.

  • Saving: The data is being saved.

  • SaveSuccess: The data is saved.

  • SaveFailed: The data failed to save.

  • Deleting: The data is being deleted.

  • DeleteSuccess: The data is deleted.

  • DeleteFailed: The data failed to delete.

Analyzing

SaveType

string

The save type. Specifies whether to save the results to the search index after the AI analysis is complete. Valid values:

  • TEXT: The text index.

TEXT

AiCategory

string

The AI category. Valid values:

  • Lifestyle

  • Appearance

  • Pets

  • News

  • Advertisement

  • Environment

  • Automobile

生活

AiJobId

string

The AI job ID.

****483915d4f2cd8ac20b48fb04****

StandardSmartTagJob

object

The tag job.

AiJobId

string

The AI job ID.

****483915d4f2cd8ac20b48fb04****

Status

string

The AI analysis status:

  • Analyzing: The analysis is in progress.

  • AnalyzeSuccess: The analysis is successful.

  • AnalyzeFailed: The analysis failed.

Analyzing

ResultUrl

string

The tag result URL.

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

Results

array<object>

A list of tag recognition results.

object

Tag recognition result

Data

string

The detailed analysis result is a JSON string. For the data structure of each Type, see Result parameter description.

{"autoChapters": [...]}

Type

string

The tag identification type. Valid values:

  • NLP: The result from Natural Language Processing (NLP).

  • TextLabel: A text tag.

  • VideoLabel: A video tag.

  • ASR: The raw result from Automatic Speech Recognition (ASR).

  • OCR: The raw result from Optical Character Recognition (OCR).

NLP

Exemplos

Resposta de sucesso

JSON formato

{
  "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": "Title",
      "Description": "Description",
      "Category": "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"
          }
        ]
      }
    }
  }
}

Códigos de erro

Consulte Códigos de Erro para uma lista completa.

Notas de versão

Consulte Notas de Versão para uma lista completa.