文档

GetMediaInfo - 获取媒资内容信息

更新时间:

根据IMS mediaId或媒资InputURL,获取并返回媒资信息。

接口说明

MediaId 不为空时,优先使用 MediaId。如果 MediaId 为空,则 InputURL 必须非空。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
ice:GetMediaInfo
  • 全部资源
    *

请求参数

名称类型必填描述示例值
MediaIdstring

IMS 媒资 ID,若为空,则必须有 InputURL。

****20b48fb04483915d4f2cd8ac****
InputURLstring

待查询的媒资在相应系统中的地址,使用前必须在 IMS 内容库中注册并与 IMS 的 mediaId 绑定

  • OSS 地址,支持两种格式

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

oss://example-bucket/example.mp4 此格式默认 oss region 与服务接入区域一致。

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

返回值中媒资文件地址的类型:

  • "oss" 返回 OSS 地址,默认。

  • "cdn" 返回 CDN 地址。仅当媒资是由 vod 导入的、且在 vod 配置了加速域名,才会返回 CDN 地址。

cdn

返回参数

名称类型描述示例值
object

Schema of Response

RequestIdstring

请求 ID

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

媒资信息

MediaIdstring

媒资 ID

****20b48fb04483915d4f2cd8ac****
MediaBasicInfoobject

BasicInfo

MediaIdstring

MediaId

****20b48fb04483915d4f2cd8ac****
InputURLstring

被查询的媒资在相应系统中的地址

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

媒资媒体类型

video
BusinessTypestring

媒资业务类型

general
Sourcestring

来源

oss
Titlestring

标题

标题
Descriptionstring

内容描述

描述
Categorystring

分类

分类
MediaTagsstring

标签

标签,tag1
CoverURLstring

封面地址

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

用户数据

userDataTest
Statusstring

资源状态

Normal
CreateTimestring

媒资创建时间

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

媒资修改时间

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

媒资删除时间

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

雪碧图

[{"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

分类 ID

3048
Bizstring

媒资所属业务

ICE
UploadSourcestring

媒资上传来源

general
CateNamestring

分类名称

cateName
ReferenceIdstring

自定义 ID,仅支持小写字母、大写字母、数字、横线、下划线,长度 6-64 位。用户维度唯一。

123-1234
FileInfoListobject []

FileInfo 列表

FileBasicInfoobject

文件基础信息,包含时长,大小等

FileNamestring

文件名

example.mp4
FileStatusstring

文件状态

Normal
FileTypestring

文件类型

source_file
FileSizestring

文件大小(字节)

30611502
FileUrlstring

文件 OSS 地址

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

文件存储区域

cn-shanghai
FormatNamestring

封装格式

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

时长

216.206667
Bitratestring

码率

1132.68
Widthstring

960
Heightstring

540
CreateTimestring

文件创建时间

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

文件修改时间

2020-12-26T04:11:10Z
AudioStreamInfoListobject []

音频流信息,一个媒资可能有多条音频流

Indexstring

音频流序号

1
CodecNamestring

编码格式简述名

aac
CodecLongNamestring

编码格式长述名

AAC (Advanced Audio Coding)
CodecTimeBasestring

编码时基

1/24000
CodecTagStringstring

编码格式标记文本

mp4a
CodecTagstring

编码格式标记

0x6134706d
Profilestring

编码预置

High
SampleFmtstring

采样格式

fltp
SampleRatestring

采样率

44100
Channelsstring

声道数

2
ChannelLayoutstring

声道输出样式

stereo
Timebasestring

时基

1/44100
StartTimestring

起始时间

0.000000
Durationstring

时长

16.200998
Bitratestring

码率

127.794
Fpsstring

音频帧率

8
NumFramesstring

总帧数

10
Langstring

语言

und
VideoStreamInfoListobject []

视频流信息,一个媒资可能有多条视频流

Indexstring

视频流序号

0
CodecNamestring

编码格式简述名

h264
CodecLongNamestring

编码格式长述名

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

编码预置

High
CodecTimeBasestring

编码时基

1/48
CodecTagStringstring

编码格式标记文本

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

编码格式标记

0x0000
Widthstring

960
Heightstring

540
HasBFramesstring

是否有 B 帧

2
Sarstring

编码信号分辨率比

0:1
Darstring

编码显示分辨率比

0:1
PixFmtstring

像素格式

yuv420p
Levelstring

编码等级

30
Fpsstring

视频帧率

24.0
AvgFPSstring

平均帧率

24.0
Timebasestring

时基

1/12288
StartTimestring

起始时间

0.081706
Durationstring

时长

216.206706
Bitratestring

码率

1001.594
NumFramesstring

总帧数

5184
Langstring

语言

und
Rotatestring

旋转

0
Nb_framesstring

总帧数

5184
SubtitleStreamInfoListobject []

字幕流信息,一个媒资可能有多条字幕流

Indexstring

字幕流序号

1
CodecNamestring

编码格式简述名

srt
CodecLongNamestring

编码格式长述名

SubRip Text
CodecTimeBasestring

编码时基

29.97
CodecTagStringstring

编码格式标记文本

unicode
CodecTagstring

编码格式标记

unicode
Timebasestring

时基

30
StartTimestring

起始时间

0
Durationstring

时长

1
Langstring

语言

und
AiRoughDataobject

AI 分析原始数据

Resultstring

AI 分析原始结果

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

AI 分析状态:

  • Analyzing 分析中
  • AnalyzeSuccess 分析成功
  • AnalyzeFailed 分析失败
  • Saving 入库中
  • SaveSuccess 入库成功
  • SaveFailed 入库失败
  • Deleting 删除中
  • DeleteSuccess 删除成功
  • DeleteFailed 删除失败
Analyzing
SaveTypestring

入库类型,智能分析完成后是否入搜索库。取值:

  • TEXT 文本库
TEXT
AiCategorystring

AI 分类,取值:

  • 生活
  • 颜值
  • 萌宠
  • 资讯
  • 广告
  • 环境资源
  • 汽车
生活
AiJobIdstring

AI 任务 ID

****483915d4f2cd8ac20b48fb04****

示例

正常返回示例

JSON格式

{
  "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=<ExpireTime>&OSSAccessKeyId=<OSSAccessKeyId>&Signature=<Signature>&security-token=<SecurityToken>",
      "UserData": "userDataTest",
      "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****"
    }
  }
}

错误码

访问错误中心查看更多错误码。

变更历史

变更时间变更内容概要操作
2021-11-25OpenAPI 返回结构发生变更看变更集
变更项变更内容
出参OpenAPI 返回结构发生变更
2021-03-31OpenAPI 返回结构发生变更看变更集
变更项变更内容
出参OpenAPI 返回结构发生变更
  • 本页导读 (1)
文档反馈