根据IMS mediaId或媒资InputURL,获取并返回媒资信息。
接口说明
MediaId 不为空时,优先使用 MediaId。如果 MediaId 为空,则 InputURL 必须非空。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
授权信息
下表是API对应的授权信息,可以在RAM权限策略语句的Action
元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:
- 操作:是指具体的权限点。
- 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
- 资源类型:是指操作中支持授权的资源类型。具体说明如下:
- 对于必选的资源类型,用前面加 * 表示。
- 对于不支持资源级授权的操作,用
全部资源
表示。
- 条件关键字:是指云产品自身定义的条件关键字。
- 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作 | 访问级别 | 资源类型 | 条件关键字 | 关联操作 |
---|---|---|---|---|
ice:GetMediaInfo | get | *全部资源 * |
| 无 |
请求参数
名称 | 类型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
MediaId | string | 否 | IMS 媒资 ID,若为空,则必须有 InputURL。 | ****20b48fb04483915d4f2cd8ac**** |
InputURL | string | 否 | 待查询的媒资在相应系统中的地址,使用前必须在 IMS 内容库中注册并与 IMS 的 mediaId 绑定
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 |
OutputType | string | 否 | 返回值中媒资文件地址的类型:
| cdn |
ReturnDetailedInfo | string | 否 | 配置对应媒资字段是否返回详细信息,支持字段: AiRoughData.StandardSmartTagJob: 如果媒资提交过标签分析,是否返回详细标签结果。
| {"AiRoughData.StandardSmartTagJob": false} |
返回参数
示例
正常返回示例
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",
"Snapshots": "[\n \"http://example-bucket.oss-cn-shanghai.aliyuncs.com/snapshot-00001.png?Expires=<ExpireTime>&OSSAccessKeyId=<OSSAccessKeyId>&Signature=<Signature>&security-token=<SecurityToken>\",\n \"http://example-bucket.oss-cn-shanghai.aliyuncs.com/snapshot-00002.jpg?Expires=<ExpireTime>&OSSAccessKeyId=<OSSAccessKeyId>&Signature=<Signature>&security-token=<SecurityToken>\",\n \"http://example-bucket.oss-cn-shanghai.aliyuncs.com/snapshot-00003.jpg?Expires=<ExpireTime>&OSSAccessKeyId=<OSSAccessKeyId>&Signature=<Signature>&security-token=<SecurityToken>\"\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=<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,
"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,
"AvgFPS": 24,
"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"
}
]
}
}
}
}
错误码
访问错误中心查看更多错误码。
变更历史
变更时间 | 变更内容概要 | 操作 |
---|---|---|
2024-06-04 | OpenAPI 返回结构发生变更 | 查看变更详情 |
2024-04-24 | OpenAPI 入参发生变更、OpenAPI 返回结构发生变更 | 查看变更详情 |
2021-11-25 | OpenAPI 返回结构发生变更 | 查看变更详情 |
2021-03-31 | OpenAPI 返回结构发生变更 | 查看变更详情 |