查询视频信息
接口描述
1、通过子账号id和视频id,查询视频的详细信息
2、接口支持https协议
接口URL
http://api.polyv.net/v3/video/get-video-info
请求方式
GET
接口约束
1、接口同时支持HTTP 、HTTPS ,建议使用HTTPS 确保接口安全,接口调用有频率限制,详细请查看
请求参数描述
appId
true
String
保利威点播子账户appId,获取路径:保利威点播后台->设置->账号管理
timestamp
true
Long
当前时间的毫秒级时间戳,3分钟内有效
vids
true
String
视频id,多个视频id用英文逗号分隔,例如: "1b448be32370f4822ac40fd926112a66_1,1b448be323d66f3dae8db5af9f1fdce6_1"; 获取路径:保利威点播后台->视频列表; 也可以获取自【上传视频】;
filter
false
String
选择需要返回的视频信息,多个以英文逗号分隔,默认为基础信息 basicInfo:基础信息 metaData:元数据 transcodeInfo:转码信息 snapshotInfo:截图信息 例如:"basicInfo,metaData,transcodeInfo,snapshotInfo"
示例
http://api.polyv.net/v3/video/get-video-info?filter=basicInfo%2CmetaData%2CtranscodeInfo%2CsnapshotInfo&vids=1b448be32370f4822ac40fd926112a66_1%2C1b448be323d66f3dae8db5af9f1fdce6_1&appId=a0Wmol5EwX&sign=A840DFCB355E7B3D23AC85EAD6089B18×tamp=1617939194034
响应参数描述
error字段说明
code
Integer
错误码
data字段说明
vid
String
视频id
basicInfo字段说明
title
String
视频标题
description
String
视频描述
duration
Long
源视频时长,单位:秒
coverURL
String
首图地址,大图
miniCoverURL
String
首图地址,小图
largeCoverURL
String
首图地址,大图,同coverURL
creationTime
String
创建时间
updateTime
String
更新时间
size
Long
源文件大小,单位:Bytes
cateId
Long
分类id;其中1为根目录,即"默认分类"
cateName
String
分类名称
tags
String
标签
uploader
String
上传者
metaData字段说明
size
Long
源文件大小,单位:Bytes
format
String
视频容器类型,如mp4、flv等
duration
Long
源视频时长,单位:秒
bitrate
Integer
视频码率,单位:bps
fps
Integer
视频帧率
height
Integer
分辨率高,单位:px
width
Integer
分辨率宽,单位:px
codec
String
编码格式,例如:h264、h265等
transcodeInfos字段说明
playUrl
String
播放地址
definition
String
清晰度 SOURCE:原清晰度 LD:普清 SD:标清 HD:高清
bitrate
Integer
码率kbps
duration
Long
时长,秒
encrypt
Boolean
是否加密 1:加密视频 0:非加密
format
String
转码格式,如mp4、flv、pdx、hls
fps
Integer
视频帧率
height
Integer
分辨率高,单位:px
width
Integer
分辨率宽,单位:px
status
String
视频状态 normal:可以正常播放 unavailable:不能正常播放
snapshotInfo字段说明
imageUrl
String[]
截图url数组
status字段说明
60/61
已发布
10
等待编码
20
正在编码
50
等待审核
51
审核不通过
-1
已删除
Java请求示例
快速接入基础代码请下载相关依赖源码, 点击下载源代码 ,下载后加入到自己的源码工程中即可。测试用例中的HttpUtil.java 和 VodSignUtil.java 都包含在下载文件中。
强烈建议您使用点播Java SDK完成API的功能对接,点播Java SDK 对API调用逻辑、异常处理、数据签名、HTTP请求线程池进行了统一封装和优化。
private static final Logger log = LoggerFactory.getLogger(VodSubAccountTest.class);
/**
* 查询视频信息
* @throws Exception
* @throws NoSuchAlgorithmException
*/
@Test
public void testGetSubVideoInfo() throws Exception, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String timestamp = String.valueOf(System.currentTimeMillis());
//业务参数
String url = "http://api.polyv.net/v3/video/get-video-info";
String vids = "1b448be32370f4822ac40fd926112a66_1,1b448be323d66f3dae8db5af9f1fdce6_1";
String filter = "basicInfo,metaData,transcodeInfo,snapshotInfo";
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
requestMap.put("vids", vids);
requestMap.put("filter", filter);
//用md5进行签名,使用子账号的secretKey签名
requestMap.put("sign", VodSignUtil.getSignMd5(requestMap, appSecret));
String response = HttpUtil.get(url, requestMap);
log.debug("测试查询视频信息,{}", response);
//do somethings
}
响应示例
系统全局错误说明详见全局错误说明
成功示例
{
"requestId": "2a8a4861-5ab3-40b3-8855-1f9007347580",
"code": 200,
"status": "success",
"error": null,
"data": [
{
"vid": "1b448be32370f4822ac40fd926112a66_1",
"basicInfo": {
"title": "b",
"description": "",
"duration": 45,
"coverURL": "https://img.videocc.net/uimage/1/http://img.videocc.net/uimage/1/1b448be323/6/1b448be32370f4822ac40fd926112a66_1_b.jpg",
"creationTime": "2021-04-08 10:16:07",
"updateTime": "2021-04-08 14:03:21",
"size": 46573287,
"status": 61,
"cateId": 1617173363572,
"cateName": "分类名称2222",
"tags": "",
"uploader": "主账号"
},
"metaData": {
"size": 46573287,
"format": "mp4",
"duration": 45,
"bitrate": 7871,
"fps": 25,
"height": 720,
"width": 1280,
"codec": "h264"
},
"transcodeInfos": [
{
"playUrl": null,
"definition": "LD",
"bitrate": 171,
"duration": 45,
"encrypt": true,
"format": "pdx",
"fps": 25,
"height": 720,
"width": 1280,
"status": "normal"
},
{
"playUrl": "https://hls.videocc.net/1b448be323/6/1b448be32370f4822ac40fd926112a66_1.m3u8",
"definition": "LD",
"bitrate": 171,
"duration": 45,
"encrypt": true,
"format": "hls",
"fps": 25,
"height": 720,
"width": 1280,
"status": "normal"
},
{
"playUrl": null,
"definition": "SD",
"bitrate": 733,
"duration": 45,
"encrypt": true,
"format": "pdx",
"fps": 25,
"height": 720,
"width": 1280,
"status": "normal"
},
{
"playUrl": "https://hls.videocc.net/1b448be323/6/1b448be32370f4822ac40fd926112a66_2.m3u8",
"definition": "SD",
"bitrate": 733,
"duration": 45,
"encrypt": true,
"format": "hls",
"fps": 25,
"height": 720,
"width": 1280,
"status": "normal"
},
{
"playUrl": null,
"definition": "HD",
"bitrate": 958,
"duration": 45,
"encrypt": true,
"format": "pdx",
"fps": 25,
"height": 720,
"width": 1280,
"status": "normal"
},
{
"playUrl": "https://hls.videocc.net/1b448be323/6/1b448be32370f4822ac40fd926112a66_3.m3u8",
"definition": "HD",
"bitrate": 958,
"duration": 45,
"encrypt": true,
"format": "hls",
"fps": 25,
"height": 720,
"width": 1280,
"status": "normal"
}
],
"snapshotInfo": {
"imageUrl": [
"https://img.videocc.net/uimage/1/1b448be323/6/1b448be32370f4822ac40fd926112a66_0.jpg",
"https://img.videocc.net/uimage/1/1b448be323/6/1b448be32370f4822ac40fd926112a66_1.jpg",
"https://img.videocc.net/uimage/1/1b448be323/6/1b448be32370f4822ac40fd926112a66_2.jpg",
"https://img.videocc.net/uimage/1/1b448be323/6/1b448be32370f4822ac40fd926112a66_3.jpg",
"https://img.videocc.net/uimage/1/1b448be323/6/1b448be32370f4822ac40fd926112a66_4.jpg",
"https://img.videocc.net/uimage/1/1b448be323/6/1b448be32370f4822ac40fd926112a66_5.jpg"
]
}
},
{
"vid": "1b448be323d66f3dae8db5af9f1fdce6_1",
"basicInfo": {
"title": "a",
"description": "",
"duration": 44,
"coverURL": "https://img.videocc.net/uimage/1/1b448be323/6/1b448be323d66f3dae8db5af9f1fdce6_0_b.jpg",
"creationTime": "2021-04-08 10:15:49",
"updateTime": "2021-04-08 10:20:06",
"size": 43721963,
"status": 61,
"cateId": 1617173363572,
"cateName": "分类名称2222",
"tags": "",
"uploader": "主账号"
},
"metaData": {
"size": 43721963,
"format": "mp4",
"duration": 44,
"bitrate": 7577,
"fps": 25,
"height": 720,
"width": 1280,
"codec": "h264"
},
"transcodeInfos": [
{
"playUrl": null,
"definition": "LD",
"bitrate": 168,
"duration": 44,
"encrypt": true,
"format": "pdx",
"fps": 25,
"height": 720,
"width": 1280,
"status": "normal"
},
{
"playUrl": "https://hls.videocc.net/1b448be323/6/1b448be323d66f3dae8db5af9f1fdce6_1.m3u8",
"definition": "LD",
"bitrate": 168,
"duration": 44,
"encrypt": true,
"format": "hls",
"fps": 25,
"height": 720,
"width": 1280,
"status": "normal"
},
{
"playUrl": null,
"definition": "SD",
"bitrate": 669,
"duration": 44,
"encrypt": true,
"format": "pdx",
"fps": 25,
"height": 720,
"width": 1280,
"status": "normal"
},
{
"playUrl": "https://hls.videocc.net/1b448be323/6/1b448be323d66f3dae8db5af9f1fdce6_2.m3u8",
"definition": "SD",
"bitrate": 669,
"duration": 44,
"encrypt": true,
"format": "hls",
"fps": 25,
"height": 720,
"width": 1280,
"status": "normal"
},
{
"playUrl": null,
"definition": "HD",
"bitrate": 982,
"duration": 44,
"encrypt": true,
"format": "pdx",
"fps": 25,
"height": 720,
"width": 1280,
"status": "normal"
},
{
"playUrl": "https://hls.videocc.net/1b448be323/6/1b448be323d66f3dae8db5af9f1fdce6_3.m3u8",
"definition": "HD",
"bitrate": 982,
"duration": 44,
"encrypt": true,
"format": "hls",
"fps": 25,
"height": 720,
"width": 1280,
"status": "normal"
}
],
"snapshotInfo": {
"imageUrl": [
"https://img.videocc.net/uimage/1/1b448be323/6/1b448be323d66f3dae8db5af9f1fdce6_0.jpg",
"https://img.videocc.net/uimage/1/1b448be323/6/1b448be323d66f3dae8db5af9f1fdce6_1.jpg",
"https://img.videocc.net/uimage/1/1b448be323/6/1b448be323d66f3dae8db5af9f1fdce6_2.jpg",
"https://img.videocc.net/uimage/1/1b448be323/6/1b448be323d66f3dae8db5af9f1fdce6_3.jpg",
"https://img.videocc.net/uimage/1/1b448be323/6/1b448be323d66f3dae8db5af9f1fdce6_4.jpg",
"https://img.videocc.net/uimage/1/1b448be323/6/1b448be323d66f3dae8db5af9f1fdce6_5.jpg"
]
}
}
]
}
异常示例
{
"requestId": "89733cbd-85fd-480b-bbad-23d51c2197f6",
"code": 403,
"status": "error",
"error": {
"code": 104,
"desc": "invalid signature"
},
"data": null
}
Last updated
Was this helpful?