All Products
Search
Document Center

ApsaraVideo Media Processing:SubmitMediaCensorJob

Last Updated:Sep 27, 2024

Submits a content moderation job.

Operation description

The job that you submit by calling this operation is run in asynchronous mode. The job is added to an ApsaraVideo Media Processing (MPS) queue and then scheduled, queued, and run. You can call the QueryMediaCensorJobDetail operation or configure an asynchronous notification to obtain the job result.

QPS limit

You can call this operation up to 100 times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see QPS limit.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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
mts:SubmitMediaCensorJobnone
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InputstringNo

The Object Storage Service (OSS) URL of the media file to be moderated. To view the OSS URL of the media file, you can log on to the MPS console and choose Media Management > Media List in the left-side navigation pane. To moderate an image file, use the CoverImage parameter to specify the OSS URL of the image file. The value is a JSON object. For more information, see the "Input" section of the Parameter details topic.

  • Bucket: the name of the OSS bucket that stores the input file.

  • Location: the OSS region. The OSS region must be the same as the region in which your MPS service is activated.

  • Object: the OSS object to be moderated.

    **

    NoteThe name of the object cannot start with a forward slash (/). Otherwise, the operation fails to be called.

{"Bucket":"example-bucket-****","Location":"oss-cn-shanghai","Object":"example-****.flv"}
CoverImagesstringNo

The OSS URL of the image file that is used as the thumbnail. To view the OSS URL of the image file, you can log on to the MPS console and choose Media Management > Media List in the left-side navigation pane. You can specify up to five thumbnails in a JSON array.

  • Bucket: the name of the OSS bucket that stores the input file.

  • Location: the OSS region. The OSS region must be the same as the region in which your MPS service is activated.

  • Object: the OSS object to be moderated.

    **

    NoteThe name of the object cannot start with a forward slash (/). Otherwise, the operation fails to be called.

[{"Bucket":"example-bucket-****","Location":"oss-cn-shanghai","Object":"example-****.jpeg"}]
TitlestringNo

The title of the video. The value can be up to 64 bytes in size.

Hello World
DescriptionstringNo

The description of the video. The value can be up to 128 bytes in size.

example description
BarragesstringNo

The live comments.

hello world
PipelineIdstringYes

The ID of the MPS queue. This ID can be used to associate the job with a notification method. To view the ID of the MPS queue, you can log on to the MPS console and choose Global Settings > Pipelines in the left-side navigation pane. An empty string ("") indicates that the default MPS queue is used to run the job. By default, an MPS queue can process a maximum of 10 concurrent content moderation jobs. To increase the limit, submit a ticket.

Note MPS queues are automatically created by the system. For more information about how to query and update MPS queues, see the UpdatePipeline topic.
b22c173cced04565b1f38f1ecc39****
VideoCensorConfigstringYes

The video moderation configurations and the OSS URLs of the output snapshots. To view the OSS URL of the media file, you can log on to the MPS console and choose Media Management > Media List in the left-side navigation pane.

The value is a JSON object.

  • OutputFile:

    • Bucket: the name of the OSS bucket that stores the output file.
    • Location: the OSS region. The OSS region must be the same as the region in which your MPS service is activated.
    • Object: the OSS object to be generated. In the value, {Count} indicates the sequence number of the frame snapshot.
  • StoreVideoTimeline: specifies whether to generate the {jobId}.video_timeline file. The file is stored in OSS. A value of true indicates that the file is generated. A value of false indicates that the file is not generated. If you do not specify this parameter, the file is not generated by default. For more information about the format of the file, see the "VideoTimelines" parameter in the QueryMediaCensorJobDetail topic.

  • SaveType: the output mode. A value of abnormal indicates that snapshots are generated only for illegal frames. A value of all indicates that snapshots are generated for all frames.

  • Biztype: the moderation template. If you do not specify this parameter or set the value to common, the default template is used. You can submit a ticket to create a custom moderation template. Then, set this parameter to your user ID to use the custom moderation template.

  • Scenes: the moderation scenarios. You can specify the moderation scenarios that you want to use. If you do not specify this parameter, the terrorism and porn moderation scenarios are used by default. Valid values:

    • porn: pornographic content detection
    • terrorism: terrorist content detection
    • ad: ad violation detection
    • live: undesirable scene detection
    • logo: special logo detection
    • audio: audio anti-spam
Note If the input file contains audio tracks and the audio moderation scenario is specified, the audio tracks are moderated. If the input file does not contain audio tracks, you do not need to specify the audio moderation scenario.
{"Scenes" : ["porn"], "OutputFile":{"Bucket": "example-001","Location": "oss-cn-hangzhou","Object": "test/example-{Count}.jpg"},"SaveType" : "abnormal","BizType":"common"}
UserDatastringNo

The custom data. The value can be up to 128 bytes in size.

UserDatatestid-001-****
ExternalUrlstringNo

The URL of the video.

http://www.example.com/video-****/test-****.mp4

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The ID of the request.

25818875-5F78-4A13-BEF6-D7393642CA58
JobIdstring

The ID of the content moderation job. We recommend that you keep this ID for subsequent operation calls.

88c6ca184c0e47098a5b665e2****

Asynchronous notification parameters

ParameterTypeDescription
TypeStringThe type of the message. The value is MediaCensor.
MediaCensorJobNotifyAliyunMediaCensorJobNotifyThe notification content of the content moderation job.
UserDataStringThe custom data.

Examples

Sample success responses

JSONformat

{
  "RequestId": "25818875-5F78-4A13-BEF6-D7393642CA58",
  "JobId": "88c6ca184c0e47098a5b665e2****"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history