CreateVideoModerationTask

Updated at:

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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

imm:CreateVideoModerationTask

create

*Project

acs:imm:{#regionId}:{#accountId}:project/{#ProjectName}

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:

  • porn: intelligent pornography detection.

  • terrorism: terrorism and political content detection.

  • live: undesirable scene detection.

  • logo: logo detection.

  • ad: text and image violation detection.

Note

If you do not specify a video detection scenario, the porn, terrorism, and ad scenarios are detected by default.

Valid values:

  • ad :

    Text and image violation detection.

  • terrorism :

    Terrorism and political content detection.

  • logo :

    Logo detection.

  • live :

    Undesirable scene detection.

  • porn :

    Intelligent pornography detection.

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.