根据IMS mediaId或媒资InputURL,获取并返回媒资信息。
接口说明
MediaId 不为空时,优先使用 MediaId。如果 MediaId 为空,则 InputURL 必须非空。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
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} |
| AuthTimeout |
integer |
否 |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
Schema of Response |
||
| RequestId |
string |
请求 ID |
2FDE2411-DB8D-4A9A-875B-275798F14A5E |
| MediaInfo |
object |
媒资信息 |
|
| MediaId |
string |
媒资 ID |
****20b48fb04483915d4f2cd8ac**** |
| MediaBasicInfo |
object |
BasicInfo |
|
| MediaId |
string |
MediaId |
****20b48fb04483915d4f2cd8ac**** |
| InputURL |
string |
被查询的媒资在相应系统中的地址 |
https://example-bucket.oss-cn-shanghai.aliyuncs.com/example.mp4 |
| MediaType |
string |
媒资媒体类型 |
video |
| BusinessType |
string |
媒资业务类型 |
general |
| Source |
string |
来源 |
oss |
| Title |
string |
标题 |
Title |
| Description |
string |
内容描述 |
Description |
| Category |
string |
分类 |
Category |
| MediaTags |
string |
标签 |
tag1 |
| CoverURL |
string |
封面地址 |
http://example-bucket.oss-cn-shanghai.aliyuncs.com/example.png?Expires= |
| UserData |
string |
用户数据 |
userDataTest |
| Snapshots |
string |
截图 |
[
"http://example-bucket.oss-cn-shanghai.aliyuncs.com/snapshot-00001.png?Expires= |
| 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"}] |
| CateId |
integer |
分类 ID |
3048 |
| Biz |
string |
媒资所属业务 |
ICE |
| UploadSource |
string |
媒资上传来源 |
general |
| CateName |
string |
分类名称 |
cateName |
| ReferenceId |
string |
自定义 ID,仅支持小写字母、大写字母、数字、横线、下划线,长度 6-64 位。用户维度唯一。 |
123-1234 |
| FileInfoList |
array<object> |
FileInfo 列表 |
|
|
array<object> |
|||
| FileBasicInfo |
object |
文件基础信息,包含时长,大小等 |
|
| FileName |
string |
文件名 |
example.mp4 |
| FileStatus |
string |
文件状态 |
Normal |
| FileType |
string |
文件类型 |
source_file |
| FileSize |
string |
文件大小(字节) |
30611502 |
| FileUrl |
string |
文件 OSS 地址 |
http://example-bucket.oss-cn-shanghai.aliyuncs.com/example.mp4?Expires= |
| 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 |
| CreateTime |
string |
文件创建时间 |
2020-12-26T04:11:08Z |
| ModifiedTime |
string |
文件修改时间 |
2020-12-26T04:11:10Z |
| AudioStreamInfoList |
array<object> |
音频流信息,一个媒资可能有多条音频流 |
|
|
object |
|||
| 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<object> |
视频流信息,一个媒资可能有多条视频流 |
|
|
object |
|||
| 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 |
是否有 B 帧 |
2 |
| 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<object> |
字幕流信息,一个媒资可能有多条字幕流 |
|
|
object |
|||
| 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 |
| AiRoughData |
object |
AI 分析原始数据 |
|
| Result |
string |
AI 分析原始结果 |
https://sample-bucket.cn-shanghai.aliyuncs.com/result.json |
| Status |
string |
AI 分析状态:
|
Analyzing |
| SaveType |
string |
入库类型,智能分析完成后是否入搜索库。取值:
|
TEXT |
| AiCategory |
string |
AI 分类,取值:
|
生活 |
| AiJobId |
string |
AI 任务 ID |
****483915d4f2cd8ac20b48fb04**** |
| StandardSmartTagJob |
object |
标签任务 |
|
| AiJobId |
string |
AI 任务 ID |
****483915d4f2cd8ac20b48fb04**** |
| Status |
string |
AI 分析状态:
|
Analyzing |
| ResultUrl |
string |
标签结果 URL。 |
http://xx.oss-cn-shanghai.aliyuncs.com/result2.txt |
| Results |
array<object> |
标签识别结果列表。 |
|
|
object |
标签识别结果 |
||
| Data |
string |
分析结果的具体数据,以 JSON 字符串表示。不同 Type 的数据结构详见Result 参数说明。 |
{"autoChapters": [...]} |
| Type |
string |
标签识别类型,取值:
|
NLP |
示例
正常返回示例
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": "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"
}
]
}
}
}
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。