CreateVideoModerationTask
Detects risky or non-compliant content in videos, including intelligent pornography detection, terrorism and political content detection, text and image violation detection, undesirable scene detection, and logo detection.
Operation description
- Before you call this operation, make sure that you fully understand the billing methods and pricing of Intelligent Media Management.
Important Asynchronous tasks do not guarantee timeliness.
- Detection results are returned through asynchronous message notifications. Valid values of the Suggestion field in the asynchronous message notification:
pass: Approved. No non-compliant content is detected.
block: Blocked. Non-compliant content is detected. The Categories field indicates the non-compliant categories. For more information about the categories, see Content moderation results.
review: Manual review required. After the manual review is completed, another asynchronous message notification is sent to inform you of the manual review result.
- Requirements for video frame capture:
Video frame URLs support the following protocols: HTTP and HTTPS.
Video frames support the following formats: PNG, JPG, JPEG, BMP, GIF, and WEBP.
The size of a video frame cannot exceed 10 MB.
The resolution of a video frame should be no less than 256 × 256 pixels. A lower resolution may affect the recognition accuracy.
The response time of the video detection API operation depends on the download time of video frames. Make sure that the storage service where the video frames are stored is stable and reliable. We recommend that you use Alibaba Cloud Object Storage Service (OSS) or Content Delivery Network (CDN) caching.
This operation is asynchronous. After a task starts, the task information is retained for only 7 days. You cannot obtain the task information after 7 days. Call the GetTask or ListTasks operation to obtain the returned TaskId and view the task information. You can also set the Notification parameter to obtain the task information through message notifications.>
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
imm:CreateVideoModerationTask |
create |
*Project
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ProjectName |
string |
Yes |
The name of the project. For more information about how to obtain the project name, see Create a project. |
immtest |
| UserData |
string |
No |
The custom user information. This information is returned in the asynchronous message notification to help you associate and process the message notification in your system. The maximum length is 2,048 bytes. |
{"ID": "user1","Name": "test-user1","Avatar": "http://example.com?id=user1"} |
| SourceURI |
string |
Yes |
The OSS URL of the video. The OSS URL format is oss://${Bucket}/${Object}. ${Bucket} is the name of the OSS bucket that resides in the same region as the current project. ${Object} is the full path of the file, including the file name extension. |
oss://test-bucket/test-object |
| Tags |
object |
No |
The custom tag information, which is used to search for tasks. |
{"test": "val1"} |
| CredentialConfig | CredentialConfig |
No |
The chained authorization configuration. This parameter is optional. For more information, see Use chained authorization to access resources of other entities. |
|
| Scenes |
array |
No |
The video detection scenarios. |
|
|
string |
No |
The specified video detection scenarios. Valid values:
Note
If you do not specify a video detection scenario, the porn, terrorism, and ad scenarios are detected by default. Valid values:
|
porn |
|
| Interval |
integer |
No |
The interval at which video frames are captured, in seconds. Valid values: 1 to 600. Default value: 1. |
1 |
| MaxFrames |
integer |
No |
The maximum number of frames that the system captures for the video in the current detection task. Valid values: 5 to 3600. Default value: 200. |
200 |
| Notification | Notification |
No |
The message notification configuration. For more information, see the Notification parameter. For the format of asynchronous notification messages, see the Metadata index section in Asynchronous notification message format. |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response struct. |
||
| RequestId |
string |
The ID of the request. |
1B3D5E0A-D8B8-4DA0-8127-ED32C851**** |
| TaskId |
string |
The ID of the task. |
VideoModeration-9442a216-4691-4a48-846d-76daccaf***** |
| EventId |
string |
The ID of the event. |
2E6-1I0FGn0zFnl5AflRfhzClma***** |
Examples
Success response
JSON format
{
"RequestId": "1B3D5E0A-D8B8-4DA0-8127-ED32C851****",
"TaskId": "VideoModeration-9442a216-4691-4a48-846d-76daccaf*****",
"EventId": "2E6-1I0FGn0zFnl5AflRfhzClma*****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.