1. 接口描述
接口请求域名: vod.tencentcloudapi.com 。
- 该接口可以获取多个媒体文件的多种信息,包括:
- 基础信息(basicInfo):包括媒体名称、分类、播放地址、封面图片等。
- 元信息(metaData):包括大小、时长、视频流信息、音频流信息等。
- 转码结果信息(transcodeInfo):包括该媒体转码生成的各种规格的媒体地址、视频流参数、音频流参数等。
- 转动图结果信息(animatedGraphicsInfo):对视频转动图(如 gif)后的动图信息。
- 采样截图信息(sampleSnapshotInfo):对视频采样截图后的截图信息。
- 雪碧图信息(imageSpriteInfo):对视频截取雪碧图后的雪碧图信息。
- 指定时间点截图信息(snapshotByTimeOffsetInfo):对视频依照指定时间点截图后,的截图信息。
- 视频打点信息(keyFrameDescInfo):对视频设置的打点信息。
- 转自适应码流信息(adaptiveDynamicStreamingInfo):包括规格、加密类型、打包格式等相关信息。
- 审核信息(reviewInfo):包括媒体审核及媒体封面审核信息。
- 可以指定回包只返回部分信息。
默认接口请求频率限制:100次/秒。
推荐使用 API Explorer
点击调试
API Explorer 提供了在线调用、签名验证、SDK 代码生成和快速检索接口等能力。您可查看每次调用的请求内容和返回结果以及自动生成 SDK 调用示例。
2. 输入参数
以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见 公共请求参数。
参数名称 | 必选 | 类型 | 描述 |
---|---|---|---|
Action | 是 | String | 公共参数,本接口取值:DescribeMediaInfos。 |
Version | 是 | String | 公共参数,本接口取值:2018-07-17。 |
Region | 否 | String | 公共参数,此参数为可选参数。 |
FileIds.N | 是 | Array of String | 媒体文件 ID 列表,N 从 0 开始取值,最大 19。 示例值:["5285485487985271487","5285485487985271488"] |
SubAppId | 否 | Integer | 点播应用 ID。从2023年12月25日起开通点播的客户,如访问点播应用中的资源(无论是默认应用还是新创建的应用),必须将该字段填写为应用 ID。 示例值:1490012345 |
Filters.N | 否 | Array of String | 指定所有媒体文件需要返回的信息,可同时指定多个信息,N 从 0 开始递增。如果未填写该字段,默认返回所有信息。选项有: 示例值:["basicInfo"] |
3. 输出参数
参数名称 | 类型 | 描述 |
---|---|---|
MediaInfoSet | Array of MediaInfo | 媒体文件信息列表。 |
NotExistFileIdSet | Array of String | 不存在的文件 ID 列表。 示例值:["5285485487985271488"] |
RequestId | String | 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 |
4. 示例
示例1 获取媒体详细信息
获取媒体全部信息,不指定 Filters。
输入示例
POST / HTTP/1.1
Host: vod.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeMediaInfos
<公共请求参数>
{
"FileIds": [
"5285485487985271488",
"5285485487985271487"
]
}
输出示例
{
"Response": {
"RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc700064ef3",
"MediaInfoSet": [
{
"FileId": "5285485487985271487",
"BasicInfo": {
"Name": "test file",
"Description": "",
"CreateTime": "2017-01-23T07:25:52Z",
"UpdateTime": "2017-01-23T07:25:52Z",
"ExpireTime": "2017-03-23T07:25:52Z",
"ClassId": 1,
"ClassName": "测试",
"ClassPath": "测试",
"CoverUrl": "http://xx.vod2.myqcloud.com/xxxxxxxx/shotup/f0.100_0.jpg",
"Type": "mp4",
"MediaUrl": "http://xx.vod2.myqcloud.com/xx/xx/f0.mp4",
"TagSet": [],
"SourceInfo": {
"SourceType": "Record",
"SourceContext": "",
"TrtcRecordInfo": null,
"WebPageRecordInfo": null,
"LiveRecordInfo": null
},
"Category": "Video",
"Vid": "",
"StorageClass": "STANDARD",
"StorageRegion": "gzp",
"Status": "Normal"
},
"MetaData": {
"AudioDuration": 3601,
"VideoDuration": 3601,
"Md5": "",
"Size": 10556,
"Container": "m4a",
"Duration": 3601,
"Bitrate": 246035,
"Height": 480,
"Width": 640,
"Rotate": 0,
"VideoStreamSet": [
{
"Bitrate": 246000,
"Height": 480,
"Width": 640,
"Codec": "h264",
"Fps": 222,
"CodecTag": "",
"DynamicRangeInfo": {
"Type": "SDR",
"HDRType": ""
}
}
],
"AudioStreamSet": [
{
"Codec": "aac",
"SamplingRate": 44100,
"Bitrate": 35
}
]
},
"TranscodeInfo": {
"TranscodeSet": [
{
"Url": "http://xxxx.vod2.myqcloud.com/xx/xx/f0.mp4",
"Definition": 0,
"Bitrate": 563477,
"Height": 378,
"Width": 672,
"Container": "m4a",
"Duration": 3601,
"Size": 10502,
"Md5": "b3ae6ed07d9bf4efeeb94ed2d37ff3e3",
"DigitalWatermarkType": "None",
"VideoStreamSet": [
{
"Bitrate": 246000,
"Height": 480,
"Width": 640,
"Codec": "h264",
"Fps": 222,
"CodecTag": "",
"DynamicRangeInfo": {
"Type": "SDR",
"HDRType": ""
}
}
],
"AudioStreamSet": [
{
"Codec": "aac",
"SamplingRate": 44100,
"Bitrate": 35
}
],
"CopyRightWatermarkText": ""
},
{
"Url": "http://xxxx.vod2.myqcloud.com/xx/xx/f0.f210.m3u8",
"Definition": 211,
"Bitrate": 563477,
"Height": 378,
"Width": 672,
"Container": "mov",
"Duration": 3601,
"Size": 10502,
"Md5": "b3ae6ed07d9bf4efeeb94ed2d37ff3e3",
"DigitalWatermarkType": "None",
"VideoStreamSet": [
{
"Bitrate": 246000,
"Height": 480,
"Width": 640,
"Codec": "h264",
"Fps": 222,
"CodecTag": "",
"DynamicRangeInfo": {
"Type": "SDR",
"HDRType": ""
}
}
],
"AudioStreamSet": [
{
"Codec": "aac",
"SamplingRate": 44100,
"Bitrate": 35
}
],
"CopyRightWatermarkText": ""
},
{
"Url": "http://xxxx.vod2.myqcloud.com/xx/xx/master_playlist.m3u8",
"Definition": 10000,
"Duration": 145,
"Size": 265,
"Bitrate": 2840055,
"Height": 1080,
"Width": 1920,
"Container": "hls,applehttp",
"Md5": "bfcf7c6f154b18890661f9e80b0731d0",
"DigitalWatermarkType": "None",
"VideoStreamSet": [
{
"Bitrate": 2794233,
"Height": 1080,
"Width": 1920,
"Codec": "h264",
"Fps": 24,
"CodecTag": "",
"DynamicRangeInfo": {
"Type": "SDR",
"HDRType": ""
}
}
],
"AudioStreamSet": [
{
"SamplingRate": 44100,
"Bitrate": 45822,
"Codec": "aac"
}
],
"CopyRightWatermarkText": ""
}
]
},
"AnimatedGraphicsInfo": {
"AnimatedGraphicsSet": [
{
"Url": "http://125xx.vod2.myqcloud.com/xx/xx/f20000.gif",
"Definition": 20000,
"Container": "gif",
"Height": 480,
"Width": 640,
"Bitrate": 1000000,
"Size": 600000,
"Md5": "bfcf7c6f154b1842a661f9e80b07a1d0",
"StartTimeOffset": 10,
"EndTimeOffset": 15
}
]
},
"SampleSnapshotInfo": {
"SampleSnapshotSet": [
{
"Definition": 10,
"SampleType": "percent",
"WaterMarkDefinition": [],
"Interval": 10,
"ImageUrlSet": [
"http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx1.png",
"http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx2.png",
"http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx3.png",
"http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx4.png",
"http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx5.png",
"http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx6.png",
"http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx7.png",
"http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx8.png",
"http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx9.png",
"http://125xx.vod2.myqcloud.com/xx/xx/shotup/xx10.png"
]
}
]
},
"ImageSpriteInfo": {
"ImageSpriteSet": [
{
"Definition": 10,
"Height": 576,
"Width": 1024,
"TotalCount": 100,
"ImageUrlSet": [
"http://xx.vod2.myqcloud.com/xx/xx/imageSprite/xx.100_0.jpg"
],
"WebVttUrl": "http://xx.vod2.myqcloud.com/xxxx/xxxx/imageSprite/xx.vtt"
}
]
},
"SnapshotByTimeOffsetInfo": {
"SnapshotByTimeOffsetSet": [
{
"Definition": 10,
"PicInfoSet": [
{
"TimeOffset": 0,
"Url": "http://xxxx.vod2.myqcloud.com/xx/xx/snapshotByTime/xx1.jpg"
},
{
"TimeOffset": 1000,
"Url": "http://xxxx.vod2.myqcloud.com/xx/xx/snapshotByTime/xx2.jpg"
}
]
}
]
},
"MiniProgramReviewInfo": {
"MiniProgramReviewList": [
{
"Url": "http://xx.vod2.myqcloud.com/xx/xx/f0.mp4",
"Definition": 0,
"ReviewResult": "pass",
"ReviewSummary": [
{
"Confidence": 0,
"Type": "Porn",
"Suggestion": "pass"
}
],
"MetaData": {
"Rotate": 0,
"Container": "m4a",
"AudioDuration": 0,
"VideoDuration": 3601,
"Md5": "",
"VideoStreamSet": [
{
"Bitrate": 246000,
"Height": 480,
"Width": 640,
"Codec": "h264",
"Fps": 222,
"CodecTag": "",
"DynamicRangeInfo": {
"Type": "SDR",
"HDRType": ""
}
}
],
"Bitrate": 563477,
"Height": 378,
"Width": 672,
"Duration": 3601,
"Size": 10502,
"AudioStreamSet": [
{
"Codec": "aac",
"SamplingRate": 44100,
"Bitrate": 35
}
]
}
}
]
},
"AdaptiveDynamicStreamingInfo": {
"AdaptiveDynamicStreamingSet": [
{
"Definition": 0,
"Package": "HLS",
"DrmType": "None",
"Url": "http://xxxx.vod2.myqcloud.com/xx/xx/master_playlist.m3u8",
"Size": 0,
"DigitalWatermarkType": "",
"CopyRightWatermarkText": "",
"SubStreamSet": []
}
]
},
"KeyFrameDescInfo": {
"KeyFrameDescSet": [
{
"TimeOffset": 1,
"Content": "abc"
},
{
"TimeOffset": 100,
"Content": "def"
}
]
},
"SubtitleInfo": {
"SubtitleSet": [
{
"Id": "subtitleId",
"Name": "English",
"Language": "en-US",
"Format": "vtt",
"Url": "http://123.vod2.myqcloud.com/vodgzp123/15517123183853310575/subtitles/subtitleId.vtt"
}
]
},
"ReviewInfo": {
"MediaReviewInfo": {
"Definition": 10,
"Suggestion": "pass",
"TypeSet": [],
"ReviewTime": "2022-10-08T10:00:00Z"
},
"CoverReviewInfo": null
}
}
],
"NotExistFileIdSet": [
"5285485487985271488"
]
}
}
示例2 只获取媒体基础信息
只获取媒体基础信息,Filters 指定 basicInfo。
输入示例
POST / HTTP/1.1
Host: vod.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeMediaInfos
<公共请求参数>
{
"Filters": [
"basicInfo"
],
"FileIds": [
"5285485487985271488",
"5285485487985271487"
]
}
输出示例
{
"Response": {
"RequestId": "6ca31e3a-6b8e-4b4e-9256-fdc700064ef3",
"MediaInfoSet": [
{
"FileId": "5285485487985271487",
"BasicInfo": {
"Name": "test file",
"Description": "",
"CreateTime": "2017-01-23T07:25:52Z",
"UpdateTime": "2017-01-23T07:25:52Z",
"ExpireTime": "2017-03-23T07:25:52Z",
"ClassId": 1,
"ClassName": "测试",
"ClassPath": "测试",
"CoverUrl": "http://xx.vod2.myqcloud.com/xxxxxxxx/shotup/f0.100_0.jpg",
"Type": "mp4",
"MediaUrl": "http://xx.vod2.myqcloud.com/xx/xx/f0.mp4",
"TagSet": [],
"SourceInfo": {
"SourceType": "Record",
"SourceContext": "",
"TrtcRecordInfo": null,
"WebPageRecordInfo": null,
"LiveRecordInfo": null
},
"Category": "Video",
"Vid": "",
"StorageClass": "STANDARD",
"StorageRegion": "gzp",
"Status": "Normal"
},
"MetaData": null,
"TranscodeInfo": null,
"AdaptiveDynamicStreamingInfo": null,
"AnimatedGraphicsInfo": null,
"SampleSnapshotInfo": null,
"ImageSpriteInfo": null,
"MiniProgramReviewInfo": null,
"SubtitleInfo": null,
"SnapshotByTimeOffsetInfo": null,
"KeyFrameDescInfo": null,
"ReviewInfo": null
}
],
"NotExistFileIdSet": [
"5285485487985271488"
]
}
}
5. 开发者资源
腾讯云 API 平台
腾讯云 API 平台 是综合 API 文档、错误码、API Explorer 及 SDK 等资源的统一查询平台,方便您从同一入口查询及使用腾讯云提供的所有 API 服务。
API Inspector
用户可通过 API Inspector 查看控制台每一步操作关联的 API 调用情况,并自动生成各语言版本的 API 代码,也可前往 API Explorer 进行在线调试。
SDK
云 API 3.0 提供了配套的开发工具集(SDK),支持多种编程语言,能更方便的调用 API。
- Tencent Cloud SDK 3.0 for Python: GitHub Gitee
- Tencent Cloud SDK 3.0 for Java: GitHub Gitee
- Tencent Cloud SDK 3.0 for PHP: GitHub Gitee
- Tencent Cloud SDK 3.0 for Go: GitHub Gitee
- Tencent Cloud SDK 3.0 for Node.js: GitHub Gitee
- Tencent Cloud SDK 3.0 for .NET: GitHub Gitee
- Tencent Cloud SDK 3.0 for C++: GitHub Gitee
- Tencent Cloud SDK 3.0 for Ruby: GitHub Gitee
命令行工具
6. 错误码
以下仅列出了接口业务逻辑相关的错误码,其他错误码详见 公共错误码。
错误码 | 描述 |
---|---|
FailedOperation | 操作失败。 |
FailedOperation.InvalidVodUser | 没有开通点播业务。 |
InternalError | 内部错误。 |
InternalError.GetMediaListError | 内部错误:获取媒体列表错误。 |
InvalidParameter | 参数错误。 |
InvalidParameterValue.FileIds | FileIds 参数错误。 |
InvalidParameterValue.FileIdsEmpty | FileIds 数组为空。 |
UnauthorizedOperation | 未授权操作。 |