视频数字水印提取接口
更新时间:2024-07-03
创建数字水印提取任务
接口描述
用户通过该接口提取视频中的数字水印。
注:务必选择与嵌入数字水印任务相同的算法版本,否则无法正确提取水印内容。算法说明可见视频数字水印嵌入接口。
请求结构
POST /v{version}/job/dwmdetect HTTP/1.1
accept-encoding: gzip, deflate
x-bce-date: {utc-date-string}
connection: keep-alive
accept: */*
host: media.bj.baidubce.com
x-bce-request-id: {bce-request-id}
content-type: application/json
authorization: {bce-authorization-string}
请求头域
除公共头域外,无其它特殊头域。
请求参数
无
请求体
字段名称 | 字段类型 | 必要性 | 字段描述 | 可选值 | 默认值 |
---|---|---|---|---|---|
pipelineName | String | 必选 | 任务所属的队列名称 | - | - |
source | Object | 必选 | 输入视频信息集合 | - | - |
+bucket | String | 可选 | 输入视频的BOS Bucket(用户必须有该bucket的读权限) | - | 队列中指定的输入bucket |
+key | String | 必选 | 输入视频的BOS Key | - | - |
target | String | 可选 | 输出图片水印信息(仅提取图片水印时可配置) | - | - |
+bucket | String | 可选 | 输出图片的BOS Bucket(用户必须有该bucket的写权限) | - | 队列中指定的输出bucket |
+keyPrefix | String | 可选 | 输出图片的BOS Key前缀,输出的完整key为"前缀_dwm_extract.png" | - | 视频文件名 |
digitalWmAlgVersion | String | 可选 | 算法版本号 | 0 ~ 2 | 0 |
digitalWmType | String | 必选 | 提取水印类型,图片或文字 | "image", "text" | - |
digitalWmSecretKeyId | String | 可选 | 数字水印密钥ID,需要与嵌入时密钥一致 | - | - |
响应头域
除公共头域外,无其它特殊头域。
响应参数
字段名称 | 字段类型 | 字段描述 |
---|---|---|
jobId | String | 系统生成的任务的唯一标识 |
请求示例
提取图片水印
POST /v3/job/dwmdetect HTTP/1.1
accept-encoding: gzip, deflate
x-bce-date: 2023-11-08T21:21:21Z
host: media.bj.baidubce.com
accept: */*
connection: keep-alive
x-bce-request-id: 6bae5cb3-97d1-4b1a-b8b6-0ad577c1d481
content-type: application/json
authorization: bce-auth-v1/46bd9968a6194b4bbdf0341f2286ccce/2023-11-08T21:21:21Z/1800/host;x-bce-date/7e21c9cf1e4e2cc6921a407a388fe98df122c53b9f509043d841be76eb09a1f9
{
"pipelineName": "high_priority_pipe",
"source": {
"bucket": "input",
"key": "test.mp4"
},
"target": {
"bucket": "output",
"keyPrefix": "test"
},
"digitalWmAlgVersion": 0,
"digitalWmType": "image",
"digitalWmSecretKeyId": "key-pi0nwwuw45zx0ya8",
}
提取文字水印
POST /v3/job/dwmdetect HTTP/1.1
accept-encoding: gzip, deflate
x-bce-date: 2023-11-08T21:21:21Z
host: media.bj.baidubce.com
accept: */*
connection: keep-alive
x-bce-request-id: 6bae5cb3-97d1-4b1a-b8b6-0ad577c1d481
content-type: application/json
authorization: bce-auth-v1/46bd9968a6194b4bbdf0341f2286ccce/2023-11-08T21:21:21Z/1800/host;x-bce-date/7e21c9cf1e4e2cc6921a407a388fe98df122c53b9f509043d841be76eb09a1f9
{
"pipelineName": "high_priority_pipe",
"source": {
"bucket": "input",
"key": "test.mp4"
},
"digitalWmAlgVersion": 2,
"digitalWmType": "text",
"digitalWmSecretKeyId": "key-pi0nwwuw45zx0ya8",
}
响应示例
HTTP/1.1 200 OK
Transfer-Encoding: chunked
x-bce-request-id: d97c57d0-ca44-4d1c-bfeb-941a92440968
Cache-Control: no-cache
Server: BWS
Date: Wed, 08 Nov 2023 07:36:48 GMT
Content-Type: application/json;charset=UTF-8
{
"jobId": "job-pk7n403picat90kr"
}
查询数字水印提取任务
接口描述
用户通过该接口查询视频数字水印提取历史任务信息。
请求结构
GET /v{version}/job/dwmdetect/{jobId} HTTP/1.1
accept-encoding: gzip, deflate
x-bce-date: {utc-date-string}
connection: keep-alive
accept: */*
host: media.bj.baidubce.com
x-bce-request-id: {bce-request-id}
content-type: application/json
authorization: {bce-authorization-string}
请求头域
除公共头域外,无其它特殊头域。
请求参数
字段名称 | 字段类型 | 必要性 | 字段描述 | 可选值 | 默认值 |
---|---|---|---|---|---|
jobId | String | 必选 | 系统生成的任务的唯一标识 | - | - |
请求体
无
响应头域
除公共头域外,无其它特殊头域。
响应参数
字段名称 | 字段类型 | 字段描述 |
---|---|---|
jobId | String | 系统生成的任务的唯一标识 |
pipelineName | String | 任务所属的队列名称 |
jobStatus | String | 任务状态(SUCCESS, FAILED) |
createTime | String | 任务创建时间 |
startTime | String | 任务开始处理时间 |
endTime | String | 任务结束时间 |
error | Object | 错误信息,任务失败时存在 |
+code | String | 错误码 |
+message | String | 错误信息 |
source | Object | 输入视频信息集合 |
+bucket | String | 输入视频的BOS Bucket |
+key | String | 输入视频的BOS Key |
target | Object | 输出提取图片水印信息(仅提取图片水印时有该字段) |
+bucket | String | 输出图片的BOS Bucket(用户必须有该bucket的写权限) |
+keyPrefix | String | 输出图片的BOS Key前缀 |
+keys | Array<String> | 提取出的水印图片的BOS Key列表,可能有多个 |
digitalWmAlgVersion | Integer | 算法版本号 |
digitalWmType | String | 提取水印类型 |
digitalWmSecretKeyId | String | 数字水印密钥ID |
detectedTexts | Array<String> | 提取的水印文字 |
请求示例
GET /v3/digitalwatermark/dwm-pa4mz6n8i7sefz0p HTTP/1.1
accept-encoding: gzip, deflate
x-bce-date: 2023-11-08T21:21:21Z
host: media.bj.baidubce.com
accept: */*
connection: keep-alive
x-bce-request-id: 6bae5cb3-97d1-4b1a-b8b6-0ad577c1d481
content-type: application/json
authorization: bce-auth-v1/46bd9968a6194b4bbdf0341f2286ccce/2023-11-08T21:21:21Z/1800/host;x-bce-date/7e21c9cf1e4e2cc6921a407a388fe98df122c53b9f509043d841be76eb09a1f9
响应示例
提取图片水印
HTTP/1.1 200 OK
Transfer-Encoding: chunked
x-bce-request-id: d97c57d0-ca44-4d1c-bfeb-941a92440968
Cache-Control: no-cache
Server: BWS
Date: Wed, 08 Nov 2023 07:36:48 GMT
Content-Type: application/json;charset=UTF-8
{
"jobId": "job-pk8uyexbbv7ebji9",
"pipelineName": "high_priority_pipe",
"jobStatus": "SUCCESS",
"createTime": "2023-11-09T12:26:17Z",
"startTime": "2023-11-09T12:26:18Z",
"endTime": "2023-11-09T12:26:27Z",
"source": {
"bucket": "input",
"key": "test.mp4"
},
"target": {
"bucket": "output",
"keyPrefix": "test",
"keys": [
"test_dwm_extract.png"
]
},
"digitalWmAlgVersion": 0,
"digitalWmType": "image",
"digitalWmSecretKeyId": "key-pi0nwwuw45zx0ya8"
}
提取文字水印
HTTP/1.1 200 OK
Transfer-Encoding: chunked
x-bce-request-id: d97c57d0-ca44-4d1c-bfeb-941a92440968
Cache-Control: no-cache
Server: BWS
Date: Wed, 08 Nov 2023 07:36:48 GMT
Content-Type: application/json;charset=UTF-8
{
"jobId": "job-pk8uyexbbv7ebji9",
"pipelineName": "high_priority_pipe",
"jobStatus": "SUCCESS",
"createTime": "2023-11-09T12:26:17Z",
"startTime": "2023-11-09T12:26:18Z",
"endTime": "2023-11-09T12:26:27Z",
"source": {
"bucket": "input",
"key": "test.mp4"
},
"digitalWmAlgVersion": 2,
"digitalWmType": "text",
"digitalWmSecretKeyId": "key-pi0nwwuw45zx0ya8",
"detectedTexts": [
"baidu"
]
}