普通素材
用户上传音频/视频/图片到素材库,创作视频时可从素材中心查询该素材,并导入任务中使用
上传素材
接口描述
用户上传音频/视频/图片到素材库
请求(Request)
POST /v{version}/matlib?upload HTTP/1.1
{utc-date-string}
bvw.bj.baidubce.com
application/json
{bce-authorization-string}
字段名称 |
字段类型 |
是否必选 |
字段描述 |
参数位置 |
mediaType |
String |
必选 |
媒资类型,video:视频, audio:音频,image:图片 |
Requestbody |
title |
String |
必选 |
素材标题,最大长度264字符 |
Requestbody |
bucket |
String |
必选 |
素材在BOS中的bucket |
Requestbody |
key |
String |
必选 |
素材在BOS中的key |
Requestbody |
POST /v1/matlib?upload HTTP/1.1
2019-05-31T09:27:33Z
bvw.bj.baidubce.com
application/json
bce-auth-v1/c0188830c0c342928f199bbbdac4c227/2019-05-31T09:27:33Z/1800/host/f19dfaf46b9e6b619e9be203650701a2bec9db18a980686ddb3a3a58132558e1
{
"mediaType":"audio",
"title":"your-title",
"bucket":"your-bucket",
"key":"your-key"
}
响应(Response)
字段名称 |
字段类型 |
字段描述 |
materialId |
String |
素材id |
HTTP/1.1 200 OK
chunked
ca8620b4-0527-4153-b6ed-3a6c0a4da937
no-cache
BWS
Fri, 31 May 2019 09:27:33 GMT
application/json;charset=UTF-8
{
"materialId": "c56e3f4718eb202a59da7a9707ccfb63"
}
查询素材
接口描述
查询指定素材
请求(Request)
GET /v{version}/materialLibrary/{id} HTTP/1.1
{utc-date-string}
bvw.bj.baidubce.com
application/json
{bce-authorization-string}
字段名称 |
字段类型 |
是否必选 |
字段描述 |
参数位置 |
id |
String |
必选 |
要查询的素材id |
PathParam |
GET /v1/materialLibrary/e0351bdc1cf9a773a10d7ff9ed237833 HTTP/1.1
2019-05-31T09:27:33Z
bvw.bj.baidubce.com
application/json
bce-auth-v1/c0188830c0c342928f199bbbdac4c227/2019-05-31T09:27:33Z/1800/host/f19dfaf46b9e6b619e9be203650701a2bec9db18a980686ddb3a3a58132558e1
响应(Response)
字段名称 |
字段类型 |
字段描述 |
id |
string |
素材id |
userId |
string |
用户id |
infoType |
string |
素材分类 |
mediaType |
string |
素材媒资类型 |
sourceType |
string |
来源类型 |
title |
string |
名称 |
bucket |
string |
素材的bucket |
key |
string |
素材的key |
key360p |
string |
素材360p分辨率的key |
key720p |
string |
素材720p分辨率的key |
audioKey |
string |
音频的key |
thumbnailKeys |
list |
截图的key |
subtitles |
list |
字幕的key |
sourceUrl |
string |
素材鉴权url |
sourceUrl360p |
string |
素材360p分辨率的鉴权url |
audioUrl |
string |
素材音频的鉴权url |
thumbnailList |
list |
素材截图鉴权url |
subtitleUrls |
list |
字幕鉴权url |
duration |
double |
素材时长 |
width |
int |
素材宽 |
height |
int |
素材高 |
HTTP/1.1 200 OK
chunked
ca8620b4-0527-4153-b6ed-3a6c0a4da937
no-cache
BWS
Fri, 31 May 2019 09:27:33 GMT
application/json;charset=UTF-8
{
"id": "e0351bdc1cf9a773a10d7ff9ed237833",
"userId": "your-userid",
"infoType": null,
"mediaType": "video",
"sourceType": "USER",
"status": "FINISHED",
"title": "your title",
"sourceUrl": "XXX",
"sourceUrl360p": "XXX",
"audioUrl": "XXX",
"thumbnailList": [
"XXX"
],
"subtitleUrls": [],
"createTime": "2021-03-30 17:29:12",
"updateTime": "2021-03-30 17:29:17",
"duration": 3.05,
"height": 720,
"width": 1280,
"thumbnailKeys": [
"thumbnail/3s00000000.jpg"
],
"subtitles": [
""
],
"bucket": "your-bucket",
"key": "your-key.mp4",
"key360p": "360p/your-key.mp4",
"key720p": "720p/your-key.mp4",
"audioKey": "audio/your-key.mp3"
}
删除素材
接口描述
删除指定素材
请求(Request)
DELETE /v{version}/materialLibrary/{id} HTTP/1.1
{utc-date-string}
bvw.bj.baidubce.com
application/json
{bce-authorization-string}
字段名称 |
字段类型 |
是否必选 |
字段描述 |
参数位置 |
id |
String |
必选 |
要删除的素材id |
PathParam |
DELETE /v1/materialLibrary/e0351bdc1cf9a773a10d7ff9ed237833 HTTP/1.1
2019-05-31T09:27:33Z
bvw.bj.baidubce.com
application/json
bce-auth-v1/c0188830c0c342928f199bbbdac4c227/2019-05-31T09:27:33Z/1800/host/f19dfaf46b9e6b619e9be203650701a2bec9db18a980686ddb3a3a58132558e1
响应(Response)
- 响应头域:无特殊Header参数
- 响应参数:无
- 响应示例:
HTTP/1.1 200 OK
chunked
ca8620b4-0527-4153-b6ed-3a6c0a4da937
no-cache
BWS
Fri, 31 May 2019 09:27:33 GMT
application/json;charset=UTF-8
搜索素材
接口描述
根据素材标题关键字、来源类型等因素搜索素材
请求(Request)
GET /v{version}/materialLibrary HTTP/1.1
{utc-date-string}
bvw.bj.baidubce.com
application/json
{bce-authorization-string}
字段名称 |
字段类型 |
是否必选 |
字段描述 |
参数位置 |
titleKeyword |
String |
可选 |
标题关键字,可用于模糊匹配 |
RequestParam |
sourceType |
String |
可选 |
来源类型,USER:用户上传素材,SERVICE:系统生成素材(包括使用快编生成的结果素材) |
RequestParam |
infoType |
String |
可选 |
信息类型,ENTERTAINMENT:娱乐,NEWS:新闻,SPORT:体育,ECONOMIC:财经,TECHNOLOGY:科技,EDUCATION:教育 |
RequestParam |
mediaType |
String |
可选 |
媒资类型,video:视频, audio:音频,image:图片 |
RequestParam |
status |
String |
可选 |
素材状态,PROCESSING:预处理中,FAILED:失败,FINISHED:完成 |
RequestParam |
pageNo |
Integer |
可选 |
页数,默认1 |
RequestParam |
size |
Integer |
可选 |
分页大小,默认10,最大100 |
RequestParam |
begin |
Date |
可选 |
createtime范围的开始时间,格式yyyy-MM-dd'T'HH:mm:ss'Z' |
RequestParam |
end |
Date |
可选 |
createtime范围的结束时间,格式yyyy-MM-dd'T'HH:mm:ss'Z' |
RequestParam |
GET /v1/materialLibrary?mediaType=audio HTTP/1.1
2019-05-31T09:27:33Z
bvw.bj.baidubce.com
application/json
bce-auth-v1/c0188830c0c342928f199bbbdac4c227/2019-05-31T09:27:33Z/1800/host/f19dfaf46b9e6b619e9be203650701a2bec9db18a980686ddb3a3a58132558e1
响应(Response)
字段名称 |
字段类型 |
字段描述 |
pageNo |
Integer |
页数 |
pageSize |
Integer |
分页大小 |
totalCount |
Integer |
总数 |
items |
List<素材> |
结果列表,素材格式见【查询素材】 |
HTTP/1.1 200 OK
chunked
ca8620b4-0527-4153-b6ed-3a6c0a4da937
no-cache
BWS
Fri, 31 May 2019 09:27:33 GMT
application/json;charset=UTF-8
{
"pageNo": 1,
"pageSize": 10,
"totalCount": 1,
"items": [
{
"id": "3129d94aafedba8f47d67c5a6f08b9d0",
"userId": "your-userid",
"infoType": null,
"mediaType": "audio",
"sourceType": "USER",
"status": "FINISHED",
"title": "your-key.mp3",
"sourceUrl": "XXX",
"sourceUrl360p": "XXX",
"audioUrl": "XXX",
"thumbnailList": [],
"subtitleUrls": [
"XXX"
],
"createTime": "2020-10-10 20:06:25",
"updateTime": "2020-10-10 20:06:40",
"duration": 265,
"height": null,
"width": null,
"thumbnailKeys": [
""
],
"subtitles": [
"videoworks/console-upload/subtitle/your-key.json"
],
"bucket": "your-bucket",
"key": "videoworks/console-upload/your-key.mp3",
"audioKey": "videoworks/console-upload/audio/your-key.mp3"
}
]
}
预置素材
预置素材分为音乐/贴图/背景/字幕/转场,除了系统自带的预置素材外,用户可以自定义音乐/贴图预置素材。创作视频时,不需要导入,可直接使用。除了用户自己上传以外,系统提供公用的系统预置素材,可查看使用,不可删除。
上传用户预置素材
接口描述
上传一个音乐/贴图预置素材到媒资库
请求(Request)
POST /v{version}/materialLibrary/preset/{type}?upload HTTP/1.1
{utc-date-string}
bvw.bj.baidubce.com
application/json
{bce-authorization-string}
字段名称 |
字段类型 |
是否必选 |
字段描述 |
参数位置 |
type |
String |
必选 |
预置素材类型,只支持2种类型自定义:MUSIC:音乐,PICTURE:贴图 |
PathParam |
mediaType |
String |
必选 |
媒资类型:video:视频, audio:音频,image:图片 |
Requestbody |
title |
String |
必选 |
素材标题,最大长度264字符 |
Requestbody |
bucket |
String |
必选 |
素材在BOS中的bucket |
Requestbody |
key |
String |
必选 |
素材在BOS中的key |
Requestbody |
POST /v1/materialLibrary/preset/MUSIC?upload HTTP/1.1
2019-05-31T09:27:33Z
bvw.bj.baidubce.com
application/json
bce-auth-v1/c0188830c0c342928f199bbbdac4c227/2019-05-31T09:27:33Z/1800/host/f19dfaf46b9e6b619e9be203650701a2bec9db18a980686ddb3a3a58132558e1
{
"mediaType":"audio",
"title":"your-title",
"bucket":"your-bucket",
"key":"your-key"
}
响应(Response)
字段名称 |
字段类型 |
字段描述 |
id |
String |
预置素材id |
HTTP/1.1 200 OK
chunked
ca8620b4-0527-4153-b6ed-3a6c0a4da937
no-cache
BWS
Fri, 31 May 2019 09:27:33 GMT
application/json;charset=UTF-8
{
"id": "c56e3f4718eb202a59da7a9707ccfb63"
}
查询预置素材
接口描述
查询指定预置素材,可查询范围包括用户自己的和系统的预置素材
请求(Request)
GET /v{version}/materialLibrary/preset/{id} HTTP/1.1
{utc-date-string}
bvw.bj.baidubce.com
application/json
{bce-authorization-string}
字段名称 |
字段类型 |
是否必选 |
字段描述 |
参数位置 |
id |
String |
必选 |
要查询的预置素材id |
PathParam |
GET /v1/materialLibrary/preset/2437134a1e5ed58463d91854da5a3c36 HTTP/1.1
2019-05-31T09:27:33Z
bvw.bj.baidubce.com
application/json
bce-auth-v1/c0188830c0c342928f199bbbdac4c227/2019-05-31T09:27:33Z/1800/host/f19dfaf46b9e6b619e9be203650701a2bec9db18a980686ddb3a3a58132558e1
响应(Response)
字段名称 |
字段类型 |
字段描述 |
id |
string |
素材id |
status |
string |
素材状态 |
userId |
string |
用户id |
title |
string |
名称 |
tag |
string |
预置素材标签 |
type |
string |
预置素材类型 |
sourceType |
string |
来源类型 |
previewBucket |
Map<String,String> |
素材预览bucket,key包括pic(静态预览文件),gif(动态预览文件) |
previewKeys |
Map<String,String> |
素材预览keys |
previewMaterialIds |
Map<String,String> |
素材预览素材 |
materialId |
String |
素材id |
bucket |
String |
素材bucket |
key |
String |
素材key |
config |
String |
素材配置 |
sourceUrl |
String |
素材url |
createTime |
Date |
创建时间 |
updateTime |
Date |
上次更新时间 |
HTTP/1.1 200 OK
chunked
ca8620b4-0527-4153-b6ed-3a6c0a4da937
no-cache
BWS
Fri, 31 May 2019 09:27:33 GMT
application/json;charset=UTF-8
{
"id": "2437134a1e5ed58463d91854da5a3c36",
"status": "FINISHED",
"userId": "885afd0dbd8c42719729da4a0fc0aaf6",
"title": "马赛克",
"tag": "mosaic",
"type": "PICTURE",
"sourceType": "SYSTEM",
"previewMaterialIds": {
"pic": "8a9c6d28fc26cf3865ceb055ddc029f0"
},
"previewBucket": {
"pic": "videoworks-system-preprocess"
},
"previewKeys": {
"pic": "systemPreset/picture/马赛克.png"
},
"previewUrls": {
"pic": "XXX"
},
"materialId": "8a9c6d28fc26cf3865ceb055ddc029f0",
"bucket": "videoworks-system-preprocess",
"key": "systemPreset/picture/马赛克.png",
"config": "{\"category\": \"mosaic\", \"categoryText\": \"马赛克\", \"width\": 215, \"height\": 124}",
"createTime": "2021-05-31 15:02:43",
"updateTime": "2021-05-31 15:02:43",
"sourceUrl": "XXX"
}
删除预置素材
接口描述
删除指定用户上传的预置素材
请求(Request)
DELETE /v{version}/materialLibrary/preset/{id} HTTP/1.1
{utc-date-string}
bvw.bj.baidubce.com
application/json
{bce-authorization-string}
字段名称 |
字段类型 |
是否必选 |
字段描述 |
参数位置 |
id |
String |
必选 |
要删除的预置素材id |
PathParam |
DELETE /v1/materialLibrary/preset/9abd185e67b1c5952e9b6335769c3406 HTTP/1.1
2019-05-31T09:27:33Z
bvw.bj.baidubce.com
application/json
bce-auth-v1/c0188830c0c342928f199bbbdac4c227/2019-05-31T09:27:33Z/1800/host/f19dfaf46b9e6b619e9be203650701a2bec9db18a980686ddb3a3a58132558e1
响应(Response)
- 响应头域:无特殊Header参数
- 响应参数:无
- 响应示例:
HTTP/1.1 200 OK
chunked
ca8620b4-0527-4153-b6ed-3a6c0a4da937
no-cache
BWS
Fri, 31 May 2019 09:27:33 GMT
application/json;charset=UTF-8
搜索预置素材
接口描述
根据来源类型、预置素材分类以及状态等因素获取符合条件的预置素材列表
请求(Request)
GET /v{version}/materialLibrary/preset HTTP/1.1
{utc-date-string}
bvw.bj.baidubce.com
application/json
{bce-authorization-string}
字段名称 |
字段类型 |
是否必选 |
字段描述 |
参数位置 |
sourceType |
String |
可选 |
来源类型,USER:用户上传的预置素材,SYSTEM:系统预置素材 |
RequestParam |
status |
String |
可选 |
素材状态,PROCESSING:预处理中,FAILED:失败,FINISHED:完成 |
RequestParam |
type |
String |
可选 |
预置素材类型,SUBTITLE:字幕,MUSIC:音乐,PICTURE:贴图,TRANSITION:转场,BACKGROUND:背景 |
RequestParam |
pageNo |
Integer |
可选 |
页数,默认1 |
RequestParam |
pageSize |
Integer |
可选 |
分页大小,默认10,最大100 |
RequestParam |
GET /v1/materialLibrary/preset?type=PICTURE&sourceType=USER HTTP/1.1
2019-05-31T09:27:33Z
bvw.bj.baidubce.com
application/json
bce-auth-v1/c0188830c0c342928f199bbbdac4c227/2019-05-31T09:27:33Z/1800/host/f19dfaf46b9e6b619e9be203650701a2bec9db18a980686ddb3a3a58132558e1
响应(Response)
字段名称 |
字段类型 |
字段描述 |
pageNo |
Integer |
页数 |
pageSize |
Integer |
分页大小 |
totalCount |
Integer |
总数 |
result |
List |
结果 |
+type |
String |
预置素材类型 |
+addons |
List<预置素材> |
预置素材格式见【查询预置素材】 |
HTTP/1.1 200 OK
chunked
ca8620b4-0527-4153-b6ed-3a6c0a4da937
no-cache
BWS
Fri, 31 May 2019 09:27:33 GMT
application/json;charset=UTF-8
{
"pageNo": 1,
"pageSize": 10,
"totalCount": 1,
"result": [
{
"type": "PICTURE",
"addons": [
{
"id": "9abd185e67b1c5952e9b6335769c3406",
"status": "FINISHED",
"userId": "your-userid",
"title": "your-title",
"tag": "custom",
"type": "PICTURE",
"sourceType": "USER",
"previewMaterialIds": {
"pic": "fc6b2c83a03a5a0e40ab7e137be0ce23"
},
"previewBucket": {
"pic": "your-bucket"
},
"previewKeys": {
"pic": "source/your-key.png"
},
"previewUrls": {
"pic": "XXX"
},
"materialId": "fc6b2c83a03a5a0e40ab7e137be0ce23",
"bucket": "your-bucket",
"key": "source/your-key.png",
"config": "{\"width\":\"356\",\"category\":\"custom\",\"categoryText\":\"自定义\",\"height\":\"466\"}",
"createTime": "2021-05-27 17:07:26",
"updateTime": "2021-05-27 17:08:55",
"sourceUrl": "XXX"
}
]
}
]
}