Creating a Job
Function
Create a video content moderation job.
URI
- URI format:
POST /v2/{project_id}/services/video-moderation/tasks - Parameters
Parameter
Mandatory
Type
Description
project_id
Yes
String
Project ID corresponding to the region where the service is located. For details about how to obtain the project ID, see Obtaining the Project ID.
Request Parameters
- Example request
POST /v2/6204a5bd270343b5885144cf9c8c158d/services/video-moderation/tasks { "name": "task-test", "description": "description", "input": { "type": "obs", "data": [ { "bucket": "obs-iva", "index": 0, "path": "input/demo.mp4" } ] }, "output": { "obs": { "bucket": "obs-iva", "path": "output/" }, "hosting": {} }, "service_config": { "common": { "frame_interval": 5, "categories": "porn,terrorism,politics", "text_categories": "porn,politics", "upload": "false", "use_ocr": "true", "use_sis": "true" } }, "service_version":"1.2" } - Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| name | Yes | String | Job name, which consists of 1 to 100 characters, including letters (A to Z and a to z), digits (0 to 9), hyphens (-), and underscores (_). |
| description | No | String | Job description, which consists of a maximum of 500 characters. |
| input | Yes | Object | Video data input list. Currently, only the following input types are supported. Only one input channel is supported at a time.
For details, see task.input. |
| output | Yes | Object | List of output result data. Currently, only the following output types are supported:
For details, see task.output. |
| service_config | No | Object | Service algorithm configuration. The field structure is related to the service. Currently, the configuration item is common. For details about the parameter definition, see serviceConfig.common field structure. |
| service_version | Yes | String | Version, which is set to 1.2. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| frame_interval | Yes | Integer | Frame capture interval, in seconds per frame |
| categories | Yes | String | Video moderation scenarios.
You can set the parameter to the preceding values to check the corresponding elements. NOTE: To configure multiple moderation scenarios, use a comma (,) to separate every two scenario names, for example, categories: politics,terrorism,porn. |
| text_categories | No | String | For audio or text content moderation, the following scenarios are supported:
Set this parameter to your desired scenario before using an audio or text moderation service. NOTE: To configure multiple moderation scenarios, use a comma (,) to separate every two scenario names, for example, text_categories: politics,porn. |
| use_sis | No | String | Indicates whether to enable the audio content moderation.
If this parameter is not set or is left blank, the default value is false. |
| use_ocr | No | String | Indicates whether to enable the text content moderation.
If this parameter is not set or is left blank, the default value is false. |
| upload | No | String | Indicates whether to upload the detected problematic images to the cloud.
If this parameter is not set or is left blank, the default value is false. If you set true to this parameter, please set an OBS output directory beforehand. Otherwise, image upload would fail. Once rightfully configured, a folder named after the task_id would be automatically created under the configured output path and the detected problematic images uploaded to that directory. |
Response Parameters
- Example response
[ { "id": "f18320e61e4c4dc685aa2dfc22a28dc5" } ] - Job ID description
Parameter
Type
Description
id
String
Job ID
Status Codes
- Normal
- Abnormal
Status Code
Description
400 Bad Request
Request error. For details about the returned error code, see Error Codes.
401 Unauthorized
Authentication failed.
403 Forbidden
No operation permission.
404 Not Found
The requested resource was not found.
500 Internal Server Error
Internal service error.
503 Service Unavailable
Service unavailable.
Last Article: Video Content Moderation
Next Article: Querying the Job List
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.