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

调试

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

请求参数

名称 类型 是否必选 示例值 描述
Action String GetMediaInfo

系统规定参数。取值:GetMediaInfo

MediaId String ****20b48fb04483915d4f2cd8ac****

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

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

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

  • OSS地址,支持两种格式

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

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

OutputType String cdn

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

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

返回数据

名称 类型 示例值 描述
RequestId String 2FDE2411-DB8D-4A9A-875B-275798F14A5E

请求ID

MediaInfo Object

媒资信息

MediaId String ****20b48fb04483915d4f2cd8ac****

媒资ID

MediaBasicInfo Object

BasicInfo

MediaId String ****20b48fb04483915d4f2cd8ac****

MediaId

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

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

MediaType String video

媒资媒体类型

BusinessType String general

媒资业务类型

Source String oss

来源

Title String 标题

标题

Description String 描述

内容描述

Category String 分类

分类

MediaTags String 标签,tag1

标签

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

封面地址

UserData String userDataTest

用户数据

Status String Normal

资源状态

CreateTime String 2020-12-26T04:11:08Z

媒资创建时间

ModifiedTime String 2020-12-26T04:11:10Z

媒资修改时间

DeletedTime String 2020-12-26T04:11:15Z

媒资删除时间

SpriteImages String [{"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"}]

雪碧图

DynamicMetaDataList Array of DynamicMetaData

其他元数据

In Float 10.1

开始时间

Out Float 20.3

结束时间

Type String user-defined

类型

Data String {\"事件\":\"射门\",\"人物\":\"C罗\"}

元数据json string

AiRoughDataList Array of AiRoughData

AIMetadata

Type String TextToSpeech

AI类型

Result String success

AI原始结果

FileInfoList Array of FileInfo

FileInfo列表

FileBasicInfo Object

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

FileName String example.mp4

文件名

FileStatus String Normal

文件状态

FileType String source_file

文件类型

FileSize String 30611502

文件大小(字节)

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

文件oss地址

Region String cn-shanghai

文件存储区域

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

封装格式

Duration String 216.206667

时长

Bitrate String 1132.68

码率

Width String 960

Height String 540

AudioStreamInfoList Array of AudioStreamInfo

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

Index String 1

音频流序号

CodecName String aac

编码格式简述名

CodecLongName String AAC (Advanced Audio Coding)

编码格式长述名

CodecTimeBase String 1/24000

编码时基

CodecTagString String mp4a

编码格式标记文本

CodecTag String 0x6134706d

编码格式标记

Profile String High

编码预置

SampleFmt String fltp

采样格式

SampleRate String 44100

采样率

Channels String 2

声道数

ChannelLayout String stereo

声道输出样式

Timebase String 1/44100

时基

StartTime String 0.000000

起始时间

Duration String 16.200998

时长

Bitrate String 127.794

码率

Fps String 8

音频帧率

NumFrames String 10

总帧数

Lang String und

语言

VideoStreamInfoList Array of VideoStreamInfo

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

Index String 0

视频流序号

CodecName String h264

编码格式简述名

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

编码格式长述名

Profile String High

编码预置

CodecTimeBase String 1/48

编码时基

CodecTagString String [0][0][0][0]

编码格式标记文本

CodecTag String 0x0000

编码格式标记

Width String 960

Height String 540

HasBFrames String 2

是否有B帧

Sar String 0:1

编码信号分辨率比

Dar String 0:1

编码显示分辨率比

PixFmt String yuv420p

像素格式

Level String 30

编码等级

Fps String 24.0

视频帧率

AvgFPS String 24.0

平均帧率

Timebase String 1/12288

时基

StartTime String 0.081706

起始时间

Duration String 216.206706

时长

Bitrate String 1001.594

码率

NumFrames String 5184

总帧数

Lang String und

语言

Rotate String 0

旋转

Nb_frames String 5184

总帧数

SubtitleStreamInfoList Array of SubtitleStreamInfo

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

Index String 1

字幕流序号

CodecName String srt

编码格式简述名

CodecLongName String SubRip Text

编码格式长述名

CodecTimeBase String 29.97

编码时基

CodecTagString String unicode

编码格式标记文本

CodecTag String unicode

编码格式标记

Timebase String 30

时基

StartTime String 0

起始时间

Duration String 1

时长

Lang String und

语言

示例

请求示例

http(s)://[Endpoint]/?Action=GetMediaInfo
&MediaId=****20b48fb04483915d4f2cd8ac****
&InputURL=http://example-bucket.oss-cn-shanghai.aliyuncs.com/example.mp4
&OutputType=cdn
&公共请求参数

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

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

JSON格式

HTTP/1.1 200 OK
Content-Type:application/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" : "null"
    },
    "DynamicMetaDataList" : [ {
      "In" : 10.1,
      "Out" : 20.3,
      "Type" : "user-defined",
      "Data" : "{\\\"事件\\\":\\\"射门\\\",\\\"人物\\\":\\\"C罗\\\"}"
    } ],
    "AiRoughDataList" : [ {
      "Type" : "TextToSpeech",
      "Result" : "success"
    } ],
    "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"
      },
      "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",
        "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"
      } ]
    } ]
  }
}

错误码

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

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