音视频媒资接口 -奇异果体育app竞彩官网下载
更新时间:2021-03-22
处理媒资接口
接口描述
根据mediaid或者sourcebucket/sourcekey对已经存在于bos上的媒资按照指定的workflow进行处理。
处理媒资接口内部实现包括两部分功能:
- 创建媒资:提供sourcebucket、sourcekey、title以及description,如果该路径对应的媒资在videoworks中不存在,则创建媒资,生成meidiaid,否则返回已有mediaid,不允许重复创建;
- 处理媒资:使用指定的workflow对媒资进行处理,返回处理对应的实例instanceid。
说明:
1、处理媒资前提:sourcebucket、sourcekey对应的文件在bos中必须存在;
2、同一个媒资mediaid使用相同的workflowname只允许成功处理一次,如果重复提交,直接返回instanceid;
3、sourcebucket/sourcekey和mediaid两者必选其一,如果都指定,以mediaid为准,会忽略sourcebucket、sourcekey、title和description。
请求(request)
- 请求语法:
post /v{version}/media?process http/1.1
x-bce-date: {utc-date-string}
host: bvw.bj.baidubce.com
content-type: application/json
authorization: {bce-authorization-string}
- 请求头域:无特殊header参数
- 请求参数:
字段名称 | 字段类型 | 必要性 | 字段描述 |
---|---|---|---|
mediaid | string | 可选 | 媒资id,sourcebucket/sourcekey和mediaid两者必选其一,如果都指定,以mediaid为准,会忽略sourcebucket、sourcekey |
sourcebucket | string | 可选 | 媒资源文件的bos bucket,最大长度64字符 |
sourcekey | string | 可选 | 媒资源文件的bos key,最大长度1024字符 |
title | string | 必选 | 媒资标题,最大长度256字符 |
description | string | 可选 | 媒资描述,最大长度1024字符 |
workflowname | string | 必选 | 媒资处理对应的工作流名称 |
dynamicparams | string | 可选 | 媒资处理对应工作流的的动态参数,支持覆盖所有静态参数 |
- 请求示例:
post /v1/media?process http/1.1
x-bce-date: 2015-07-03t09:28:13z
host: bvw.bj.baidubce.com
content-type: application/json
authorization: bce-auth-v1/e8e4a9ced6794355a9a1b8a20b58d37b/2015-07-03t09:28:13z/1800/content-type;host;x-date/4a1692dc4bab84f5801f79ea0c1fece3601cf73ecd94409d2a94b3942b971715
{
"sourcebucket":"source bucket",
"sourcekey":"source key",
"title":"media title",
"description":"media description",
"workflowname":"workflow name",
"dynamicparams":"dynamic params"
}
或者
{
"mediaid":"media id",
"workflowname":"workflow name",
"dynamicparams":"dynamic params"
}
响应(response)
- 响应头域:无特殊header参数
- 响应参数:
字段名称 | 字段类型 | 字段描述 |
---|---|---|
mediaid | string | 媒资id |
instanceid | string | 工作流处理实例id |
- 响应示例:
http/1.1 200 ok
transfer-encoding: chunked
x-bce-request-id: 012b9747-f13a-4a2c-a488-02b221844dca
cache-control: no-cache
server: bws
date: tue, 24 mar 2015 13:34:07 gmt
content-type: application/json;charset=utf-8
{
"mediaid":"mda-gaefib8idcyi36q8",
"instanceid":"ins-jfhgd6wv6atg0x1n"
}
删除媒资接口
接口描述
根据mediaid删除指定媒资,包括媒资经过工作流workflow处理后产出的媒资结果集合。
请求(request)
- 请求语法
delete /v{version}/media/{mediaid} http/1.1
x-bce-date: {utc-date-string}
host: bvw.bj.baidubce.com
content-type: application/json
authorization: {bce-authorization-string}
- 请求头域:无特殊header参数
- 请求参数:无
- 请求示例:
delete /v1/media/{mediaid} http/1.1
x-bce-date: 2015-07-03t09:28:13z
host: bvw.bj.baidubce.com
content-type: application/json
authorization: bce-auth-v1/e8e4a9ced6794355a9a1b8a20b58d37b/2015-07-03t09:28:13z/1800/content-type;host;x-date/4a1692dc4bab84f5801f79ea0c1fece3601cf73ecd94409d2a94b3942b971715
响应(response)
- 响应头域:无特殊header参数
- 响应参数:无
- 响应示例:
http/1.1 200 ok
x-bce-request-id: 6d0b0a36-2ffe-49d4-9d81-333a9ab9417e
date: tue, 24 mar 2015 13:06:02 gmt
transfer-encoding: chunked
content-type: application/json;charset=utf-8
cache-control: no-cache
批量删除媒资接口
接口描述
根据mediaids删除媒资,包括媒资经过工作流workflow处理后产出的媒资结果集合。
请求(request)
- 请求语法
delete /v{version}/media?mediaids={mediaids} http/1.1
x-bce-date: {utc-date-string}
host: bvw.bj.baidubce.com
content-type: application/json
authorization: {bce-authorization-string}
- 请求头域:无特殊header参数
- 请求参数:无
- 请求示例:
字段名称 | 字段类型 | 必要性 | 字段描述 |
---|---|---|---|
mediaids | string | 必选 | mediaid列表,逗号分隔 |
delete /v1/media?mediaids=mda-jgmhbbu95yj55xka,mda-jgig3yh0tgumy3yd http/1.1
x-bce-date: 2015-07-03t09:28:13z
host: bvw.bj.baidubce.com
content-type: application/json
authorization: bce-auth-v1/e8e4a9ced6794355a9a1b8a20b58d37b/2015-07-03t09:28:13z/1800/content-type;host;x-date/4a1692dc4bab84f5801f79ea0c1fece3601cf73ecd94409d2a94b3942b971715
响应(response)
- 响应头域:无特殊header参数
- 响应参数:无
- 响应示例:
http/1.1 200 ok
x-bce-request-id: 6d0b0a36-2ffe-49d4-9d81-333a9ab9417e
date: tue, 24 mar 2015 13:06:02 gmt
transfer-encoding: chunked
content-type: application/json;charset=utf-8
cache-control: no-cache
更新媒资信息
接口描述
根据mediaid更新指定媒资的描述信息,包括媒资标题和媒资描述。
请求(request)
- 请求语法
put /v{version}/media/{mediaid} http/1.1
x-bce-date: {utc-date-string}
host: bvw.bj.baidubce.com
content-type: application/json
authorization: {bce-authorization-string}
- 请求头域:无特殊header参数
- 请求参数:
字段名称 | 字段类型 | 必要性 | 字段描述 |
---|---|---|---|
title | string | 可选 | 媒资标题,最大长度256字符,title和description不可同时为空 |
description | string | 可选 | 媒资描述,最大长度1024字符 |
- 请求示例:
put /v1/media/{mediaid} http/1.1
x-bce-date: 2015-07-03t09:28:13z
host: bvw.bj.baidubce.com
content-type: application/json
authorization: bce-auth-v1/e8e4a9ced6794355a9a1b8a20b58d37b/2015-07-03t09:28:13z/1800/content-type;host;x-date/4a1692dc4bab84f5801f79ea0c1fece3601cf73ecd94409d2a94b3942b971715
{
"title":"media new title",
"description":"media new description"
}
响应(response)
- 响应头域:无特殊header参数
- 响应参数:无
- 响应示例:
http/1.1 200 ok
x-bce-request-id: 6d0b0a36-2ffe-49d4-9d81-333a9ab9417e
date: tue, 24 mar 2015 13:06:02 gmt
transfer-encoding: chunked
content-type: application/json;charset=utf-8
cache-control: no-cache
查询媒资接口
接口描述
根据mediaid查询指定媒资信息。
请求(request)
- 请求语法
get /v{version}/media/{mediaid} http/1.1
x-bce-date: {utc-date-string}
host: bvw.bj.baidubce.com
content-type: application/json
authorization: {bce-authorization-string}
- 请求头域:无特殊header参数
- 请求参数:无
- 请求示例:
get /v1/media/{mediaid} http/1.1
x-bce-date: 2015-07-03t09:28:13z
host: bvw.bj.baidubce.com
content-type: application/json
authorization: bce-auth-v1/e8e4a9ced6794355a9a1b8a20b58d37b/2015-07-03t09:28:13z/1800/content-type;host;x-date/4a1692dc4bab84f5801f79ea0c1fece3601cf73ecd94409d2a94b3942b971715
响应(response)
- 响应头域:无特殊header参数
- 响应参数:
字段名称 | 字段类型 | 字段描述 |
---|---|---|
mediaid | string | 系统生成的媒资id |
title | string | 媒资标题 |
description | string | 媒资描述 |
sourcebucket | string | 媒资源文件bos bucket |
sourcekey | string | 媒资源文件bos key |
status | object | 媒资状态,nomal/banned |
latestinstance | object | 媒资最近运行实例 |
instanceid | string | 系统生成的实例id |
status | object | 实例状态,ready/running/success/failed |
workflowid | string | 运行实例关联的工作流id |
mediaid | string | 运行实例关联的媒资id |
sourcebucket | string | 运行实例关联的媒资源文件bos bucket |
sourcekey | string | 运行实例关联的媒资源文件bos key |
createtime | string | 实例创建时间 |
updatetime | string | 实例更新时间 |
createtime | string | 媒资创建时间 |
updatetime | string | 媒资更新时间 |
- 响应示例:
http/1.1 200 ok
x-bce-request-id: 6d0b0a36-2ffe-49d4-9d81-333a9ab9417e
date: tue, 24 mar 2015 13:06:02 gmt
transfer-encoding: chunked
content-type: application/json;charset=utf-8
cache-control: no-cache
{
"mediaid": "mda-jg1c1wkr0swsedak",
"title": "test movie",
"description": "videoworks unit test",
"sourcebucket": "videoworks-source",
"sourcekey": "movie1564107201093.mp4",
"status": "banned",
"latestinstance": {
"instanceid": "ins-jg1cr90pv3xzr456",
"status": "success",
"workflowid": "wfs-jg1cjwvyeun9zag9",
"mediaid": "mda-jg1c1wkr0swsedak",
"sourcebucket": "videoworks-source",
"sourcekey": "movie1564107201093.mp4",
"createtime": "2019-07-26t02:13:23z",
"updatetime": "2019-07-26t02:13:33z"
},
"createtime": "2019-07-26t02:13:23z",
"updatetime": "2019-07-30t06:21:16z"
}
查询媒资实例列表
接口描述
根据mediaid查询指定媒资的运行实例列表。
请求(request)
- 请求语法
get /v{version}/media/{mediaid}?querymediainstancelist http/1.1
x-bce-date: {utc-date-string}
host: bvw.bj.baidubce.com
content-type: application/json
authorization: {bce-authorization-string}
- 请求头域:无特殊header参数
- 请求参数:无
- 请求示例:
get /v1/media/mda-jghh8q4dtumh3t0k?querymediainstancelist http/1.1
x-bce-date: 2015-07-03t09:28:13z
host: bvw.bj.baidubce.com
content-type: application/json
authorization: bce-auth-v1/e8e4a9ced6794355a9a1b8a20b58d37b/2015-07-03t09:28:13z/1800/content-type;host;x-date/4a1692dc4bab84f5801f79ea0c1fece3601cf73ecd94409d2a94b3942b971715
响应(response)
- 响应头域:无特殊header参数
- 响应参数:
字段名称 | 字段类型 | 字段描述 |
---|---|---|
instances | mediainstance[] | 实例列表 |
instanceid | string | 实例id |
status | object | 实例运行状态 |
workflowid | string | 实例对应的工作流id |
workflowname | string | 实例对应的工作流名称 |
mediaid | string | 媒资id |
sourcebucket | string | 媒资对应的源bucket |
sourcekey | string | 媒资对应的源key |
createtime | date | 实例创建时间 |
updatetime | date | 实例更新时间 |
- 响应示例:
http/1.1 200 ok
x-bce-request-id: 6d0b0a36-2ffe-49d4-9d81-333a9ab9417e
date: tue, 24 mar 2015 13:06:02 gmt
transfer-encoding: chunked
content-type: application/json;charset=utf-8
cache-control: no-cache
{
"instances": [
{
"instanceid": "ins-jg0prijhh1m5emqn",
"status": "running",
"workflowid": "wfs-jg0mg3dtpnefsfux",
"workflowname": "test_20190725",
"mediaid": "mda-jg0pjpri9w9wjq5a",
"sourcebucket": "videoworks-source",
"sourcekey": "movie1564059914384.mp4",
"createtime": "2019-07-25t13:05:16z",
"updatetime": "2019-07-25t13:05:16z"
}
]
}
查询媒资列表(分页机制)
接口描述
根据mediaid查询媒资列表信息。
请求(request)
- 请求语法
get /v{version}/media?pageno={pageno}&pagesize={pagesize}&status={status}&mediaid={mediaid}&title={title}&begintime={begintime}&endtime={endtime}&order={order}&orderby={orderby} http/1.1
x-bce-date: {utc-date-string}
host: bvw.bj.baidubce.com
content-type: application/json
authorization: {bce-authorization-string}
- 请求头域:无特殊header参数
- 请求参数:
字段名称 | 字段类型 | 必要性 | 字段描述 |
---|---|---|---|
pageno | integer | 必选 | 第几页,默认第一页 |
pagesize | integer | 必选 | 每页多少条,最大1000 |
status | string | 可选 | 媒资状态,状态值:nomal/banned |
mediaid | string | 可选 | 媒资id |
title | string | 可选 | 媒资title |
begintime | date | 可选 | 创建时间下限 |
endtime | date | 可选 | 创建时间上限 |
order | string | 可选 | 排序方式,asc或desc,多个以英文逗号,分隔 |
orderby | string | 可选 | 排序属性,数量和order一致,多个以英文逗号,分隔 |
- 请求示例:
get /v1/media?pageno=3&pagesize=2&status=published&begintime=2016-04-11t12:18:30z&endtime=2016-04-13t12:18:30z http/1.1
x-bce-date: 2015-07-03t09:28:13z
host: bvw.bj.baidubce.com
content-type: application/json
authorization: bce-auth-v1/e8e4a9ced6794355a9a1b8a20b58d37b/2015-07-03t09:28:13z/1800/content-type;host;x-date/4a1692dc4bab84f5801f79ea0c1fece3601cf73ecd94409d2a94b3942b971715
响应(response)
- 响应头域:无特殊header参数
- 响应参数:
字段名称 | 字段类型 | 字段描述 |
---|---|---|
data | media[] | media列表 |
mediaid | string | 媒资id |
title | string | 媒资title |
status | string | 媒资状态,状态值:nomal/banned |
latestinstanceid | string | 最近的媒资运行实例id |
latestworkflowid | string | 最近的媒资运行实例对应的工作流id |
latestworkflowname | string | 最近的媒资运行实例对应的工作流名称 |
instancestatus | string | 最近的媒资运行实例状态 |
sourcebucket | string | 媒资源bucket |
sourcekey | string | 媒资源key |
createtime | string | 创建时间 |
updatetime | string | 更新时间 |
pageno | integer | 第几页 |
pagesize | integer | 每页多少条 |
totalcount | integer | 结果总条数 |
- 响应示例:
http/1.1 200 ok
x-bce-request-id: 6d0b0a36-2ffe-49d4-9d81-333a9ab9417e
date: tue, 24 mar 2015 13:06:02 gmt
transfer-encoding: chunked
content-type: application/json;charset=utf-8
cache-control: no-cache
{
"data":[
{
"mediaid": "mda-jg0p4dtec9n7mahy",
"title": "test movie",
"status": "normal",
"latestinstanceid": "ins-jg0prs9p1zcbx73f",
"latestworkflowid": "wfs-jg0mg3dtpnefsfux",
"latestworkflowname": "test_20190725",
"instancestatus": "success",
"sourcebucket": "videoworks-source",
"sourcekey": "movie1564060139853.mp4",
"createtime": "2019-07-25t13:09:01z",
"updatetime": "2019-07-26t04:29:02z"
},
{
"mediaid": "mda-jg0pjpri9w9wjq5a",
"title": "测试媒资update",
"status": "normal",
"latestinstanceid": "ins-jg0prijhh1m5emqn",
"latestworkflowid": "wfs-jg0mg3dtpnefsfux",
"latestworkflowname": "test_20190725",
"instancestatus": "running",
"sourcebucket": "videoworks-source",
"sourcekey": "movie1564059914384.mp4",
"createtime": "2019-07-25t13:05:16z",
"updatetime": "2019-07-26t04:17:04z"
}
],
"pageno":3,
"pagesize":2,
"totalcount":5
}
封禁媒资接口
接口描述
根据mediaid封禁媒资。
请求(request)
- 请求语法:
put /v{version}/media/{mediaid}?ban http/1.1
x-bce-date: {utc-date-string}
host: bvw.bj.baidubce.com
content-type: application/json
authorization: {bce-authorization-string}
- 请求头域:无特殊header参数
- 请求参数:无
- 请求示例:
put /v1/media/{mediaid}?ban http/1.1
x-bce-date: 2015-07-03t09:28:13z
host: bvw.bj.baidubce.com
content-type: application/json
authorization: bce-auth-v1/e8e4a9ced6794355a9a1b8a20b58d37b/2015-07-03t09:28:13z/1800/content-type;host;x-date/4a1692dc4bab84f5801f79ea0c1fece3601cf73ecd94409d2a94b3942b971715
响应(response)
- 响应头域:无特殊header参数
- 响应参数:无
- 响应示例:
http/1.1 200 ok
x-bce-request-id: 6d0b0a36-2ffe-49d4-9d81-333a9ab9417e
date: tue, 24 mar 2015 13:06:02 gmt
transfer-encoding: chunked
content-type: application/json;charset=utf-8
cache-control: no-cache
解禁媒资接口
接口描述
根据mediaid解禁媒资。
请求(request)
- 请求语法:
put /v{version}/media/{mediaid}?unban http/1.1
x-bce-date: {utc-date-string}
host: bvw.bj.baidubce.com
content-type: application/json
authorization: {bce-authorization-string}
- 请求头域:无特殊header参数
- 请求参数:无
- 请求示例:
put /v1/media/{mediaid}?unban http/1.1
x-bce-date: 2015-07-03t09:28:13z
host: bvw.bj.baidubce.com
content-type: application/json
authorization: bce-auth-v1/e8e4a9ced6794355a9a1b8a20b58d37b/2015-07-03t09:28:13z/1800/content-type;host;x-date/4a1692dc4bab84f5801f79ea0c1fece3601cf73ecd94409d2a94b3942b971715
响应(response)
- 响应头域:无特殊header参数
- 响应参数:无
- 响应示例:
http/1.1 200 ok
x-bce-request-id: 6d0b0a36-2ffe-49d4-9d81-333a9ab9417e
date: tue, 24 mar 2015 13:06:02 gmt
transfer-encoding: chunked
content-type: application/json;charset=utf-8
cache-control: no-cache