Detects risky or non-compliant content from videos. You can use this operation in scenarios such as intelligent pornography detection, terrorist content and political bias detection, ad violation detection, and logo detection.
Operation description
-
Before you call this operation, make sure that you are familiar with the billing of Intelligent Media Management (IMM).****
**
Note Asynchronous processing does not guarantee timely task completion.
-
The detection result is sent as an asynchronous notification. The Suggestion parameter in asynchronous notifications supports the following values:
- pass: No non-compliant content is found.
- block: Non-compliant content is detected. The Categories field value indicates the non-compliance category. For more information, see Content moderation results.
- review: A manual review is needed. After the manual review is completed, an asynchronous notification is sent to inform you about the result.
-
The following video frame requirements apply:
- The URLs for video frames must use HTTP or HTTPS.
- Video frames must be in PNG, JPG, JPEG, BMP, GIF, or WebP format.
- The size of a video frame cannot exceed 10 MB.
- The resolution for video frames is not lower than 256 × 256 pixels. A frame resolution lower than this recommended resolution may affect detection accuracy.
- The response time of the operation varies based on the amount of time required to download frames. Make sure that video frames to be detected are stored in a reliable and stable service. We recommend that you store video frames in OSS or cache video frames on Alibaba Cloud CDN.
-
This operation is an asynchronous operation. After a task is executed, the task information is retained only for seven days and cannot be retrieved when the retention period elapses. You can call the GetTask or ListTasks operation to query information about the task.`` If you specify Notification , you can obtain information about the task based on notifications. >
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| imm:CreateVideoModerationTask | create | *Project acs:imm:{#regionId}:{#accountId}:project/{#ProjectName} |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| ProjectName | string | Yes | immtest | |
| UserData | string | No | The custom information, which is returned in an asynchronous notification and facilitates notification management. The maximum length of the value is 2,048 bytes. | {"ID": "user1","Name": "test-user1","Avatar": "http://example.com?id=user1"} |
| SourceURI | string | Yes | The OSS URI of the video. Specify the OSS URI in the oss://${Bucket}/${Object} format, where | oss://test-bucket/test-object |
| Tags | object | No | The custom tags. The custom tags help you retrieve the task. | {"test": "val1"} |
| CredentialConfig | CredentialConfig | No | The authorization chain settings. For more information, see Use authorization chains to access resources of other entities. | |
| Scenes | array | No | The scenarios of video moderation. | |
| string | No | The video moderation scenario. Valid values:
Note
If you do not specify a specific detection scenario, porn, terrorism, and ad are used.
| porn | |
| Interval | long | No | The interval of capturing video frames. Unit: seconds. Valid values: 1 to 600. Default value: 1. | 1 |
| MaxFrames | long | No | The maximum number of frames that can be captured from the video. Valid values: 5 to 3600. Default value: 200. | 200 |
| Notification | Notification | No | The notification settings. For information about the asynchronous notification format, see Asynchronous message examples. |
Response parameters
Examples
Sample success responses
JSONformat
{
"RequestId": "1B3D5E0A-D8B8-4DA0-8127-ED32C851****",
"TaskId": "VideoModeration-9442a216-4691-4a48-846d-76daccaf*****",
"EventId": "2E6-1I0FGn0zFnl5AflRfhzClma*****"
}Error codes
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2024-04-19 | The API operation is not deprecated.. The Error code has changed | View Change Details |
| 2023-08-21 | The Error code has changed. The request parameters of the API has changed | View Change Details |
| 2023-04-03 | The Error code has changed. The request parameters of the API has changed | View Change Details |
| 2023-03-09 | The Error code has changed. The request parameters of the API has changed | View Change Details |
| 2022-08-16 | The Error code has changed. The request parameters of the API has changed | View Change Details |
| 2022-08-16 | The Error code has changed. The request parameters of the API has changed | View Change Details |
