全部产品

获取媒资内容信息

本文为您介绍获取媒资内容信息API的请求参数与示例。

描述

根据ICE mediaId或媒资InputURL,获取并返回媒资信息。MediaId不为空时,优先使用MediaId。如果MediaId为空,则InputURL必须非空。

请求参数

字段名称

类型

必填项

示例值

描述

Action

String

GetMediaInfo

系统规定参数。取值:GetMediaInfo

MediaId

String

若为空,则必须有InputURL

****20b48fb04483915d4f2cd8ac****

ICE 媒资ID

- 32位UUID

InputURL

String

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

待注册的媒资在相应系统中的地址,一经注册不可更改,并与ICE的mediaId绑定

- OSS地址,支持两种格式

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

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

OutputType

String

否,默认返回oss地址。

cdn

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

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

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

返回参数

字段名称

类型

描述

RequestId

String

请求ID

MediaInfo

MediaInfo

媒资信息

请求示例

https://ice.cn-shanghai.aliyuncs.com/?Action=GetMediaInfo
&MediaId=****20b48fb04483915d4f2cd8ac****
&<公共参数>

返回示例

{
  "RequestId": "2FDE2411-DB8D-4A9A-875B-275798F14A5E",
  "MediaInfo": {
    "DynamicMetaDataList": [
      {
        "Type": "user-defined",
        "In": 10,
        "Data": "{\"事件\":\"射门\",\"人物\":\"C罗\"}",
        "Out": 20.3
      },
      {
        "Type": "user-defined",
        "In": 20,
        "Data": "{\"事件\":\"射门\",\"人物\":\"C罗\"}",
        "Out": 29.9
      }
    ],
    "MediaId": "****20b48fb04483915d4f2cd8ac****",
    "FileInfoList": [
      {
        "VideoStreamInfoList": [
          {
            "CodecTag": "0x31637661",
            "CodecTimeBase": "1/48",
            "Sar": "0:1",
            "StartTime": "0.081706",
            "Fps": "24.0",
            "Lang": "und",
            "Duration": "216.206706",
            "Index": "0",
            "PixFmt": "yuv420p",
            "Bitrate": "1001.594",
            "CodecName": "h264",
            "AvgFPS": "24.0",
            "Profile": "High",
            "Timebase": "1/12288",
            "HasBFrames": "2",
            "CodecTagString": "avc1",
            "Dar": "0:1",
            "CodecLongName": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
            "Level": "30",
            "Height": "540",
            "Width": "960"
          }
        ],
        "AudioStreamInfoList": [
          {
            "CodecTag": "0x6134706d",
            "CodecTimeBase": "1/44100",
            "ChannelLayout": "stereo",
            "StartTime": "0.000000",
            "Lang": "und",
            "Duration": "216.200998",
            "Index": "1",
            "SampleFmt": "fltp",
            "Bitrate": "127.794",
            "CodecName": "aac",
            "Channels": "2",
            "Timebase": "1/44100",
            "CodecTagString": "mp4a",
            "SampleRate": "44100",
            "CodecLongName": "AAC (Advanced Audio Coding)"
          }
        ],
        "FileBasicInfo": {
          "FileUrl": "http://example-bucket.oss-cn-shanghai.aliyuncs.com/example.mp4?Expires=<ExpireTime>&OSSAccessKeyId=<OSSAccessKeyId>&Signature=<Signature>&security-token=<SecurityToken>",
          "FileStatus": "Normal",
          "FileType": "source_file",
          "FileName": "example.mp4",
          "FormatName": "mov,mp4,m4a,3gp,3g2,mj2",
          "Region": "cn-shanghai",
          "Height": "540",
          "Duration": "216.206667",
          "Width": "960",
          "Bitrate": "1132.68",
          "FileSize": "30611502"
        },
        "SubtitleStreamInfoList": []
      }
    ],
    "MediaBasicInfo": {
      "Status": "Normal",
      "Category": "分类",
      "Description": "描述",
      "UserData": "userDataTest",
      "CreateTime": "2020-12-26T04:11:08Z",
      "BusinessType": "general",
      "Title": " 标题",
      "InputURL": "https://example-bucket.oss-cn-shanghai.aliyuncs.com/example.mp4",
      "TranscodeStatus": "Init",
      "Source": "oss",
      "ModifiedTime": "2020-12-26T04:11:10Z",
      "MediaId": "****20b48fb04483915d4f2cd8ac****",
      "MediaType": "video",
      "CoverURL": "http://example-bucket.oss-cn-shanghai.aliyuncs.com/example.png?Expires=<ExpireTime>&OSSAccessKeyId=<OSSAccessKeyId>&Signature=<Signature>&security-token=<SecurityToken>",
      "MediaTags": "标签,tag1"
    },
    "AiRoughDataList": []
  }
}