直播审核接口
提交直播审核
用户提供视频路径,创建一次视频审核。
- 支持RTMP/HTTP拉流
- 正在审核中的直播(以直播流地址区分)无法重复发起审核
请求语法
1PUT /v<version>/stream/check HTTP/1.1
2host: vcr.bj.baidubce.com
3authorization: <bce-authorization-string>
4x-bce-date: <bce-authorization-utc-date>
5content-type: application/json
请求参数
无
请求体
参数 | 类型 | 描述 | 是否必须 |
---|---|---|---|
source | String | 直播流地址,支持RTMP/HTTP拉流 | 是,长度不超过1024 |
preset | String | 审核模板名称 | 否 |
notification | String | 通知名称 | 是 |
description | String | 视频描述,默认为空字符串,不超过256字符 | 否 |
notifyLevel | String | 通知等级(NORMAL/REVIEW/REJECT),默认REVIEW | 否 |
thumbnailInterval | Float | 抽帧间隔,>=1s,默认为1s | 否 |
audioInterval | Integer | 抽音频间隔,>=10s,默认为30s | 否 |
请求示例
1PUT /v2/stream/check HTTP/1.1
2host: vcr.bj.baidubce.com
3authorization: <bce-authorization-string>
4x-bce-date: 2015-04-27T08:23:49Z
5content-type: application/json
6
7{
8 "source": "http://xxx/xxx.m3u8",
9 "notification": "vcr_callback",
10 "preset": "default",
11 "notifyLevel": "NORMAL",
12 "thumbnailInterval": 1,
13 "audioInterval": 30
14}
响应体
无
响应示例
1HTTP/1.1 200 OK
查询直播流审核状态
查询某条直播流的审核状态。
请求语法
1GET /v2/stream HTTP/1.1
2host: vcr.bj.baidubce.com
3authorization: <bce-authorization-string>
4x-bce-date: <bce-authorization-utc-date>
5content-type: application/json
请求参数
参数 | 类型 | 描述 | 是否必须 |
---|---|---|---|
source | String | 直播流地址 | 是 |
说明:
参数均需要经过urlEncode。
请求体
无
请求示例
1GET /v2/stream?source=http://xxx/xxx.m3u8 HTTP/1.1
2host: vcr.bj.baidubce.com
3authorization: <bce-authorization-string>
4x-bce-date: 2015-04-27T08:23:49Z
5content-type: application/json
响应头域
无
响应参数
参数 | 类型 | 描述 |
---|---|---|
source | String | 直播流地址 |
status | String | 直播流当前状态,可选值:PROVISIONING/PROCESSING/FINISHED/ERROR |
notification | String | 通知名称 |
error | Object | 错误信息,仅status=ERROR时存在 |
+ code | String | 错误码 |
+ message | String | 错误消息 |
createTime | Date | 直播审核创建时间 |
startTime | Date | 直播审核开始时间 |
finishTime | Date | 直播审核完成时间,仅status=FINISHED/ERROR时存在 |
duration | Integer | 审核持续时长,单位:秒 |
streamId | String | 直播审核任务ID |
mediaId | String | 直播流ID |
description | String | 描述信息 |
streamParams | Object | 直播审核参数 |
+preset | String | 审核模板名称 |
+notifyLevel | String | 通知等级(NORMAL/REVIEW/REJECT) |
+thumbnailInterval | Float | 抽帧间隔 |
+audioInterval | Integer | 抽音频间隔 |
响应示例
1HTTP/1.1 200 OK
2{
3 "createTime": "2019-10-08T09:12:01Z",
4 "description": "",
5 "duration": 524,
6 "finishTime": "2019-10-08T09:20:50Z",
7 "mediaId": "c084a221c7xxxxx69f58xxxx8d",
8 "notification": "vcr_callback",
9 "source": "http://xxx/xxx.m3u8",
10 "startTime": "2019-10-08T09:12:05Z",
11 "status": "FINISHED",
12 "streamId": "jj7qcgkaep1c4ya1iev",
13 "userId": "d1xxxx5f431xxxx74b6****8",
14 "streamParams": {
15 "audioInterval": 30,
16 "notifyLevel": "NORMAL",
17 "preset": "default",
18 "thumbnailInterval": 1.0
19 }
20}
直播流审核列表页
可以根据状态查询直播流的列表页。
请求语法
1GET /v2/stream/list HTTP/1.1
2host: vcr.bj.baidubce.com
3authorization: <bce-authorization-string>
4x-bce-date: <bce-authorization-utc-date>
5content-type: application/json
请求参数
参数 | 类型 | 描述 | 是否必须 |
---|---|---|---|
maxKeys | Integer | 本次请求返回的任务列表的最大元素个数,合法取值范围为[1-100],默认值为10 | 否,默认为10 |
marker | String | 本次请求的marker,标记查询的起始位置,是上次marker机制查询返回的nextMarker,首次查询不提供本字段 | 否 |
status | String | 直播流状态 | 否 |
请求体
无
请求示例
1GET /v2/stream/list?maxKeys=10&status=PROVISIONING HTTP/1.1
2host: vcr.bj.baidubce.com
3authorization: <bce-authorization-string>
4x-bce-date: 2015-04-27T08:23:49Z
5content-type: application/json
响应体
无
响应参数
参数 | 类型 | 描述 |
---|---|---|
maxKeys | Integer | 本次请求返回的任务列表的最大元素个数,合法取值范围为[1-100],默认值为10 |
marker | String | 本次请求的marker,标记查询的起始位置 |
nextMarker | String | 获取下一页所需要传递的marker值,当isTruncated为false时,该域不出现 |
isTruncated | Stringoolean | 指明是否所有查询都返回了,true表示后面还有数据,false表示已经是最后一页 |
tasks | Array | 任务列表 |
+source | String | 直播流地址 |
+status | String | 直播流当前状态,可选值:PROVISIONING/PROCESSING/FINISHED/CANCELLED/ERROR |
+notification | String | 通知名称 |
+error | Object | 错误信息,仅status=ERROR时存在 |
++ code | String | 错误码 |
++ message | String | 错误消息 |
+createTime | Date | 直播审核创建时间 |
+startTime | Date | 直播审核开始时间 |
+finishTime | Date | 直播审核完成时间,仅status=FINISHED/ERROR时存在 |
+duration | Integer | 审核持续时长,单位:秒 |
+streamId | String | 直播审核任务ID |
+mediaId | String | 直播流ID |
+description | String | 描述信息 |
+streamParams | Object | 直播审核参数 |
++preset | String | 审核模板名称 |
++notifyLevel | String | 通知等级(NORMAL/REVIEW/REJECT) |
++thumbnailInterval | Float | 抽帧间隔 |
++audioInterval | Integer | 抽音频间隔 |
响应示例
1HTTP/1.1 200 OK
2{
3 "maxKeys":10,
4 "marker":"1",
5 "nextMarker":"2",
6 "isTruncated":se,
7 "tasks":[{
8 "createTime":"2019-10-08T09:12:01Z",
9 "description":"",
10 "duration":524,
11 "finishTime":"2019-10-08T09:20:50Z",
12 "mediaId":"c084a2xxxxc7de04xxxxf583b78d",
13 "notification":"vcr_callback",
14 "source":"http://xxx/xxx.m3u8",
15 "startTime":"2019-10-08T09:12:05Z",
16 "status":"FINISHED",
17 "streamId":"jj7qcgkaep1c4ya1iev",
18 "userId":"d1953xxxxaa9xxxx174b6****8",
19 "streamParams":{
20 "audioInterval":30,
21 "notifyLevel":"NORMAL",
22 "preset":"default",
23 "thumbnailInterval":1
24 }
25 }]
26}
取消直播流审核
取消正在进行的直播审核任务。
请求语法
1PUT /v2/stream/cancel HTTP/1.1
2host: vcr.bj.baidubce.com
3authorization: <bce-authorization-string>
4x-bce-date: <bce-authorization-utc-date>
5content-type: application/json
请求参数
无
请求体
参数 | 类型 | 描述 | 是否必须 |
---|---|---|---|
source | String | 直播流地址,支持RTMP/HTTP拉流 | 是,长度不超过1024 |
notification | String | 通知名称 | 是 |
请求示例
1PUT /v2/stream/cancel HTTP/1.1
2host: vcr.bj.baidubce.com
3authorization: <bce-authorization-string>
4x-bce-date: 2015-04-27T08:23:49Z
5content-type: application/json
6
7{
8 "source": "http://xxx/xxx.m3u8",
9 "notification": "vcr_callback"
10}
响应体
无
响应示例
HTTP/1.1 200 OK
直播流审核结果回调格式
通知结果使用POST请求进行回调。
参数说明
参数 | 类型 | 描述 |
---|---|---|
messageId | String | 回调消息ID |
messageBody | String | 回调消息内容Body(json) |
回调结果示例
1{
2 "messageId":"086c404f-407a-4dd5-882b-e85639b00169",
3 "messageBody":"******"
4}
messageBody有下面两种类型。
直播流图片/音频结果回调
参数说明
参数 | 类型 | 描述 |
---|---|---|
source | String | 直播流地址 |
preset | String | 审核模板名称 |
notification | String | 通知名称 |
mediaId | String | 直播流ID |
evidenceTime | Date | 审核证据出现时间 |
description | String | 视频描述,默认为空字符串,不超过256字符 |
audioUrl | String | 直播流抽出音频的地址,只有音频审核结果中有 |
thumbnailUrl | String | 直播流抽出图片的地址,只有图片审核结果中有 |
label | String | 审核结果标签:NORMAL/REVIEW/REJECT |
results | Array | 审核结果信息 |
示例
1{
2 "evidenceTime":"2019-10-09T13:24:32Z",
3 "audioUrl":"http://xxxx/vcr-evidence/xxx/xxxxx/mid/xxxx.pcm?authorization=bce-auth-v1%2Fxxxxx%2F2019-10-09T13%3A14%3A31Z%2F3600%2Fhost%2F2534211eaaf6xxxxxxd2f64d017b9049ab6c08xxxxxx159d9724eec",
4 "results":[
5 {
6 "type":"sexual_porn",
7 "items":[
8 {
9 "subType":"behavior",
10 "target":"audio",
11 "startTimeInSeconds":0,
12 "endTimeInSeconds":3,
13 "confidence":84.19,
14 "label":"REJECT"
15 },
16 {
17 "subType":"behavior",
18 "target":"audio",
19 "startTimeInSeconds":10,
20 "endTimeInSeconds":14,
21 "confidence":95.58,
22 "label":"REJECT"
23 },
24 {
25 "subType":"behavior",
26 "target":"audio",
27 "startTimeInSeconds":28,
28 "endTimeInSeconds":30,
29 "confidence":99.98,
30 "label":"REJECT"
31 }
32 ]
33 }
34 ],
35 "source":"http://xxx/xxx.m3u8",
36 "preset":"default",
37 "description":"",
38 "notification":"vcr_callback",
39 "mediaId":"8957357bxxxxe7857ea39axxxx57de2",
40 "label":"REJECT"
41}
直播流结束回调
参数说明
参数 | 类型 | 描述 |
---|---|---|
source | String | 直播流地址 |
preset | String | 审核模板名称 |
notification | String | 通知名称 |
mediaId | String | 直播流ID |
createTime | Date | 审核任务创建时间 |
finishTime | Date | 审核任务结束时间 |
description | String | 描述信息 |
status | String | 审核任务状态:FINISHED |
示例
1{
2 "source":"http://xxx/xxx.m3u8",
3 "preset":"default",
4 "description":"",
5 "notification":"vcr_callback",
6 "mediaId":"d5b8xxxbf10551abc76xxxx3ea104e",
7 "createTime":"2019-10-09T13:19:37Z",
8 "finishTime":"2019-10-09T13:37:12Z",
9 "status":"FINISHED"
10}
审核结果说明
审核结果
审核结果格式为:
参数 | 类型 | 描述 |
---|---|---|
label | String | 审核结果标记,可选值:NORMAL/REVIEW/REJECT |
results | Array | 审核结果 |
+ type | String | 子审核类型 |
+ items | Array | 审核结果项数组 |
审核标记
审核结果标记label
,简称审核标记
,其可选值包括NORMAL/REVIEW/REJECT
,分别表示正常/疑似/拒绝。
审核标记是根据 VCR 审核结果的置信度和用户审核视频时指定的审核模板中疑似阈值和拒绝阈值(审核模板目前仅允许VCR内部为用户配置)生成的。
举个例子,VCR在对视频图像进行审核时,判断某一帧为色情图片的置信度为C
,用户使用的审核模板中配置的疑似阈值和拒绝阈值分别为T_Review
和T_Reject
:
C < T_Review
,VCR忽视该帧图片的色情审核结果;T_Review <= C < T_Reject
,VCR输出一个label=REVIEW
的审核结果项;T_Reject <= C
,VCR会输出一个label=REJECT
的审核结果项。
视频的审核结果标记由各审核结果项(见下)汇总得到,汇总规则:
- 审核结果数组为空,即没有审核结果项时视频
label = NORMAL
; - 任一审核结果项
label = REJECT
时,视频label = REJECT
; - 其余情况下(所有审核结果项
label = REVIEW
)视频label = REVIEW
审核维度/审核物料
VCR 会对视频中多个审核维度进行审核,审核维度也称为审核物料
。VCR 提取视频中下列物料进行审核:
- thumbnail,以一定策略从视频截取的缩略图;
- audio,视频音频;
- speech,视频音频通过ASR技术获取的语音识别结果;
- character,视频缩略图通过OCR技术获取的文字识别结果。
审核类型
审核结果中的type
表示”审核类型”。每类审核场景下包含着多种审核类型,不同审核类型支持的审核物料也不一样。随着智能内容审核服务的迭代升级,会不断扩展审核场景和审核类型。
审核类型列表
审核场景 | 子审核类型 | 描述 | 支持的审核物料类型 |
---|---|---|---|
色情审核 | sexual_porn | 色情审核 | thumbnail,audio,character,speech |
色情审核 | sexual_sexy | 性感审核 | thumbnail |
色情审核 | sexual_intimacy | 亲密行为审核 | thumbnail |
色情审核 | sexual_vulgar | 低俗审核 | thumbnail |
涉黄审核 | sexual_special | 特殊行为 | thumbnail |
暴恐审核 | terrorist_group | 恐怖组织审核 | thumbnail,speech,character |
暴恐审核 | terrorist | 暴恐人物审核 | thumbnail,speech,character |
暴恐审核 | terror_event | 暴力事件审核 | thumbnail,speech,character |
涉政审核 | politician | 涉政人物审核 | thumbnail,character,speech |
涉政审核 | political_event | 涉政事件审核 | character,speech |
涉政审核 | political_group | 涉政组织审核 | thumbnail,character,speech |
广告审核 | ad_brand | 品牌广告审核 | thumbnail,character,speech |
广告审核 | ad_marketing | 欺诈及营销广告审核 | thumbnail,character,speech |
违禁审核 | bad_behavior | 不良行为审核 | thumbnail |
违禁审核 | illegal_gamble | 赌博审核 | character,speech |
违禁审核 | illegal_forgery | 假冒伪劣及造假盗窃审核 | character,speech |
违禁审核 | illegal_trade | 非法交易审核 | character,speech |
违禁审核 | illegal_privacy | 非法获取私人信息审核 | character,speech |
质量审核 | disgust | 恶心审核 | thumbnail |
审核结果项
在审核结果中,每个子审核类型都对应一个items
,表示该子审核的结果。数组中的元素称为审核结果项
,其具体格式为:
参数 | 类型 | 描述 |
---|---|---|
subType | String | 审核三级分类 |
target | String | 审核物料类型,可选值:thumbnail, audio, speech, character |
timeInSeconds | Number | 物料在视频中的秒数,thumbnail/character审核物料有该属性 |
startTimeInSeconds | Number | 物料在视频中的起始秒数,和endTimeInSeconds同时存在,audio/speech审核物料有该属性 |
endTimeInSeconds | Number | 物料在视频中的结束秒数,和startTimeInSeconds同时存在 |
confidence | Double | 审核结果项的置信度,0~100的浮点数 |
label | String | 审核结果项标记 |
extra | String | 额外信息,如有;例如涉政人物审核出来的人名 |
evidence | Object | 审核证据 |
审核项
审核结果中的subType
表示”审核项”。每种审核类型下细分了不同审核项。
审核项列表
审核场景 | 审核类型 | 审核项 | 审核项描述 |
---|---|---|---|
涉黄审核 | sexual_porn | behavior,sm,products,children,art | 性行为及露点及招嫖,SM,性用品及性玩具,儿童,艺术品色情 |
涉黄审核 | sexual_sexy | male,female | 男性衣着暴露,女性衣着暴露 |
涉黄审核 | sexual_intimacy | intimacy | 亲密行为 |
涉黄审核 | sexual_vulgar | vulgar | 低俗行为 |
涉黄审核 | sexual_special | pregnant | 孕肚裸露 |
暴恐审核 | terrorist_group | terrorist_group | 恐怖组织 |
暴恐审核 | terrorist | terrorist | 暴恐人物 |
暴恐审核 | terror_event | blood,corpse,murder,explosion,riot,weapon,police,traffic | 血腥,尸体,绑架及杀人,爆炸火灾,暴乱,军事武器,警察部队,车祸 |
涉政审核 | politician | politician_positive, politician_negative,bad_artist | 涉政正面人物,涉政负面人物,劣迹艺人 |
涉政审核 | political_event | political_event_positive,political_event_negative | 涉政正面事件,涉政负面事件 |
涉政审核 | political_group | political_group_positive,political_group_negative | 涉政正面组织,涉政负面组织 |
广告审核 | ad_brand | brand | 品牌标识 |
广告审核 | ad_marketing | qrcode,contact,website,commercial | 二维码,联系方式,网址,软文推广 |
违禁审核 | bad_behavior | smoke,drink,bad_behavior_gamble,drug | 吸烟,喝酒,赌博,毒品 |
违禁审核 | illegal_gamble | gamble | 赌博 |
违禁审核 | illegal_forgery | forgery | 假冒伪劣及造假盗窃 |
违禁审核 | illegal_trade | trade | 非法交易 |
违禁审核 | illegal_privacy | privacy | 非法获取私人信息 |
质量审核 | disgust | disgust_image | 恶心图 |
官方文本黑库 | official_text_black_lib | baidu_illegal_textlib | 违禁词库 |
官方图片黑库 | image_black_lib | default_image_black_lib,meg_image_lib | 百度云风控,互联网安全管控 |
审核证据
根据不同的审核物料类型,审核证据也不相同。审核证据的格式为:
参数 | 类型 | 描述 |
---|---|---|
thumbnail | String | 缩略图URL |
location | Object | 证据位置信息 |
+ leftOffsetInPixel | Number | 左偏移 |
+ topOffsetInPixel | Number | 上偏移 |
+ widthInPixel | Number | 宽度 |
+ heightInPixel | Number | 高度 |
text | String | 文本证据 |
具体地说:
target=thumbnail
,审核证据=thumbnail +(可选)locationtarget=audio
,暂无审核证据target=speech
,审核证据=texttarget=character
,审核证据=thumbnail + location + text
审核结果示例
审核结果:
1{
2 "label" : "REJECT",
3 "results" : [{
4 "type": "porn",
5 "items": [{
6 "target": "thumbnail",
7 "timeInSeconds": 103,
8 "confidence": 98.76,
9 "label": "REJECT",
10 "evidence": {
11 "thumbnail": "http://xxx/xxx.jpg"
12 }
13 }, {
14 "target": "audio",
15 "confidence": 70,
16 "startTimeInSeconds": 0,
17 "label": "REVIEW"
18 }, {
19 "target": "character",
20 "confidence": 69,
21 "timeInSeconds": 2,
22 "label": "REVIEW",
23 "evidence": {
24 "thumbnail": "http://xxx/xxx.jpg",
25 "location": {
26 "leftOffsetInPixel": 10,
27 "topOffsetInPixel": 10,
28 "widthInPixel": 20,
29 "heightInPixel": 20
30 },
31 "text": "这是一段文字识别的色情文字"
32 }
33 }, {
34 "target": "speech",
35 "confidence": 68,
36 "startTimeInSeconds": 0,
37 "endTimeInSeconds": 20,
38 "label": "REVIEW",
39 "evidence": {
40 "text": "这是一段语音识别的色情文字"
41 }
42 }],
43 }, {
44 "type": "sexy",
45 "items": [{
46 "target": "thumbnail",
47 "timeInSeconds": 35,
48 "confidence", 68.4,
49 "label": "REVIEW",
50 "evidence": {
51 "thumbnail": "http://xxx/xxx.jpg"
52 }
53 }]
54 }, {
55 "type": "terrorism",
56 "items": [{
57 "target": "character",
58 "timeInSeconds": 12,
59 "confidence": 50,
60 "label": "REVIEW",
61 "extra": "炸弹",
62 "evidence": {
63 "thumbnail": "http://xxx/xxx.jpg",
64 "location": {
65 "leftOffsetInPixel": 10,
66 "topOffsetInPixel": 10,
67 "widthInPixel": 20,
68 "heightInPixel": 20
69 },
70 "text": "炸弹是文字识别的暴恐文字"
71 }
72 }]
73 }, {
74 "type": "politician",
75 "items": [{
76 "target": "thumbnail",
77 "timeInSeconds": 144,
78 "confidence": 95,
79 "label": "REJECT",
80 "extra": "习大大",
81 "evidence": {
82 "thumbnail": "http://xxx/xxx.jpg",
83 "location": {
84 "leftOffsetInPixel": 10,
85 "topOffsetInPixel": 10,
86 "widthInPixel": 20,
87 "heightInPixel": 20
88 }
89 },
90 }]
91 }, {
92 "type": "politics",
93 "items": [{
94 "target": "speech",
95 "startTimeInSeconds": 2
96 "endTimeInSeconds": 10
97 "confidence": 90,
98 "label": "REJECT",
99 "extra": "天安门",
100 "evidence": {
101 "text": "天安门是语音识别的涉政文字"
102 }
103 }]
104 }]
105}