All Products
Search
Document Center

Intelligent Media Management:CreateVideoModerationTask

Last Updated:Dec 11, 2024

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).****

  • 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 before 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 recommended resolution for video frames is not lower than 256 × 256 pixels. A frame resolution lower than the 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 detect 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 saved only for seven days. When the retention period ends, the task information can no longer be retrieved. 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

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is 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.
OperationAccess levelResource typeCondition keyAssociated operation
imm:CreateVideoModerationTaskcreate
*Project
acs:imm:{#regionId}:{#accountId}:project/{#ProjectName}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ProjectNamestringYes

The name of the project.

immtest
UserDatastringNo

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"}
SourceURIstringYes

The OSS URI of the video.

Specify the OSS URI in the oss://${Bucket}/${Object} format, where ${Bucket} is the name of the bucket in the same region as the current project and ${Object} is the path of the object with the extension included.

oss://test-bucket/test-object
TagsobjectNo

The custom tags. The custom tags help you retrieve the task.

{"test": "val1"}
CredentialConfigCredentialConfigNo

The configurations of authorization chains. For more information, see Use authorization chains to access resources of other entities.

ScenesarrayNo

The scenarios of video moderation.

stringNo

The video moderation scenario. Valid values:

  • porn: intelligent pornography detection.
  • terrorism: terrorist content and political bias detection.
  • live: undesirable scene detection.
  • logo: logo detection.
  • ad: ad violation detection.
Note If you do not specify a specific detection scenario, porn, terrorism, and ad are used.
porn
IntervallongNo

The interval of capturing video frames. Unit: seconds. Valid values: 1 to 600. Default value: 1.

1
MaxFrameslongNo

The maximum number of frames that can be captured from the video. Valid values: 5 to 3600. Default value: 200.

200
NotificationNotificationNo

The notification settings. For information about the asynchronous notification format, see the "Metadata indexing" section of the Asynchronous message examples topic.

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

1B3D5E0A-D8B8-4DA0-8127-ED32C851****
TaskIdstring

The task ID.

VideoModeration-9442a216-4691-4a48-846d-76daccaf*****
EventIdstring

The event ID.

2E6-1I0FGn0zFnl5AflRfhzClma*****

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 timeSummary of changesOperation
2024-04-19The API operation is not deprecated.. The Error code has changedView Change Details
2023-08-21The Error code has changed. The request parameters of the API has changedView Change Details
2023-04-03The Error code has changed. The request parameters of the API has changedView Change Details
2023-03-09The Error code has changed. The request parameters of the API has changedView Change Details
2022-08-16The Error code has changed. The request parameters of the API has changedView Change Details
2022-08-16The Error code has changed. The request parameters of the API has changedView Change Details