Submits a content moderation job.

Usage notes

The job that you submit by calling this operation is run in asynchronous mode. The job is added to an ApsaraVideo Media Processing (MPS) pipeline 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. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the 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. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes SubmitMediaCensorJob

The operation that you want to perform. Set the value to SubmitMediaCensorJob.

Input String No null

The Object Storage Service (OSS) URL of the video or audio file to be moderated. To view the OSS URL of the video or audio 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 Input.

  • 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 the MPS service is activated.
  • Object: the OSS object to be moderated.
CoverImages String No [{"Bucket":"example-bucket-****","Location":"oss-cn-shanghai","Object":"example-****.jpeg"}]

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 the MPS service is activated.
  • Object: the OSS object to be moderated.
Title String No Hello World

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

Description String No example description

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

Barrages String No hello world

The live comments.

PipelineId String Yes b22c173cced04565b1f38f1ecc39****

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 UpdatePipeline.
VideoCensorConfig String Yes null

The video moderation configurations and the OSS URLs of the output snapshots. To view the OSS URLs of the output snapshots, 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 snapshots.
    • Location: the OSS region. The OSS region must be the same as the region in which the 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 sample {jobId}.video_timeline file in QueryMediaCensorJobDetail.
  • 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.
UserData String No UserDatatestid-001-****

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

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

The URL of the video.

Response parameters

Parameter Type Example Description
RequestId String 25818875-5F78-4A13-BEF6-D7393642CA58

The ID of the request.

JobId String 88c6ca184c0e47098a5b665e2****

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

Asynchronous notification parameters

Parameter

Type

Description

Type

String

The type of the message. The value is MediaCensor.

MediaCensorJobNotify

AliyunMediaCensorJobNotify

The notification content of the content moderation job.

UserData

String

The custom data.

Examples

Sample requests

http(s)://mts.cn-hangzhou.aliyuncs.com/?Action=SubmitMediaCensorJob
&Input={"Bucket":"example-bucket-****","Location":"oss-cn-shanghai","Object":"example-****.flv"}
&CoverImages=[{"Bucket":"example-bucket-****","Location":"oss-cn-shanghai","Object":"example-****.jpeg"}]
&Title=Hello World
&Description=example description
&Barrages=hello world
&PipelineId=b22c173cced04565b1f38f1ecc39****
&VideoCensorConfig={"Scenes" : ["porn"], "OutputFile":{"Bucket": "example-001","Location": "oss-cn-hangzhou","Object": "test/example-{Count}.jpg"},"SaveType" : "abnormal","BizType":"common"}
&UserData=UserDatatestid-001-****
&ExternalUrl=http://www.example.com/video-****/test-****.mp4
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<SubmitMediaCensorJobResponse>
    <RequestId>25818875-5F78-4A13-BEF6-D7393642CA58</RequestId>
    <JobId>88c6ca184c0e47098a5b665e2****</JobId>
</SubmitMediaCensorJobResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

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

Error codes

For a list of error codes, visit the API Error Center.