Queries the results of a content moderation job.
Usage notes
In the content moderation results, the moderation results of the video are sorted in ascending order by time into a timeline. If the video is long, the content moderation results are paginated, and the first page is returned. You can call this operation to query the full moderation results of the video.
QPS limit
You can call this API 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
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | QueryMediaCensorJobDetail |
The operation that you want to perform. Set the value to QueryMediaCensorJobDetail. |
JobId | String | Yes | 2288c6ca184c0e47098a5b665e2a12**** |
The ID of the content moderation job. You can obtain the job ID from the response parameters of the SubmitMediaCensorJob operation. |
NextPageToken | String | No | ae0fd49c0840e14daf0d66a75b83**** |
The token that is used to retrieve the next page of the query results. You can leave this parameter empty when you call this operation to query the results of a content moderation job for the first time. The token of the next page is returned after you call this operation to query the results of a content moderation job for the first time. |
MaximumPageSize | Long | No | 30 |
The maximum number of entries to return on each page.
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | B42299E6-F71F-465F-8FE9-4FC2E3D3C2CA |
The ID of the request. |
MediaCensorJobDetail | Object |
The results of the content moderation job. |
|
CreationTime | String | 2018-09-13T16:32:24Z |
The time when the job was created. |
FinishTime | String | 2018-09-21 |
The time when the job was completed. |
Suggestion | String | block |
The overall result of the job. Valid values:
If the moderation result of one type of the moderated content is review, the overall result is review. If the moderation result of one type of the moderated content is block, the overall result is block. |
CoverImageCensorResults | Array of CoverImageCensorResult |
The moderation results of thumbnails. |
|
CoverImageCensorResult | |||
Object | String | test/ai/censor/v2/vme-****.jpg |
The Object Storage Service (OSS) object that is used as the video thumbnail. |
Location | String | oss-cn-shanghai |
The OSS region in which the video thumbnail resides. |
Bucket | String | bucket-out-test-**** |
The OSS bucket that stores the video thumbnail. |
Results | Array of Result |
The moderation results. |
|
Result | |||
Suggestion | String | pass |
The recommended subsequent operation. Valid values:
|
Label | String | normal |
The labels of the moderation result. Multiple labels are separated with commas (,).
|
Scene | String | porn |
The moderation scenario. Valid values:
|
Rate | String | 100 |
The score. Valid values: 0 to 100. |
State | String | Success |
The status of the job. |
TitleCensorResult | Object |
The moderation result of the title. |
|
Suggestion | String | block |
The recommended subsequent operation. Valid values:
|
Label | String | meaningless |
The labels of the moderation result. Valid values:
|
Scene | String | antispam |
The moderation scenario. The value is antispam. |
Rate | String | 99.91 |
The score. |
Message | String | The resource operated cannot be found |
The error message returned if the job fails. This parameter is not returned if the job is successful. |
Input | Object |
The information about the job input. |
|
Object | String | test/ai/censor/test-****.mp4 |
The OSS object that is used as the input file. |
Location | String | oss-cn-shanghai |
The OSS region in which the input file resides. |
Bucket | String | bucket-test-in-**** |
The OSS bucket that stores the input file. |
BarrageCensorResult | Object |
The moderation result of live comments. |
|
Suggestion | String | pass |
The recommended subsequent operation. Valid values:
|
Label | String | normal |
The labels of the moderation result. Multiple labels are separated with commas (,). Valid values:
|
Scene | String | antispam |
The moderation scenario. The value is antispam. |
Rate | String | 99.91 |
The score. |
DescCensorResult | Object |
The moderation result of the description. |
|
Suggestion | String | review |
The recommended subsequent operation. Valid values:
|
Label | String | normal |
The labels of the moderation result. Valid values:
|
Scene | String | antispam |
The moderation scenario. The value is antispam. |
Rate | String | 100 |
The score. |
VideoCensorConfig | Object |
The video moderation configurations. |
|
OutputFile | Object |
The information about output snapshots. |
|
Object | String | output{Count}.jpg |
The one or more OSS objects that are generated as the output snapshots. Note In the example, {Count} is a placeholder. The OSS objects that are generated as output
snapshots are named
output00001-****.jpg , output00002-****.jpg , and so on.
|
Location | String | oss-cn-shanghai |
The OSS region in which the OSS bucket for storing the output snapshot resides. |
Bucket | String | test-bucket-**** |
The OSS bucket that stores the output snapshot. |
VideoCensor | String | true |
Indicates whether the video content needs to be moderated. Default value: true. Valid values:
|
BizType | String | common |
The custom business type. Default value: common. |
JobId | String | f8f166eea7a44e9bb0a4aecf9543**** |
The ID of the content moderation job. |
UserData | String | example userdata **** |
The custom data. |
Code | String | InvalidParameter.ResourceNotFound |
The error code returned if the job fails. This parameter is not returned if the job is successful. |
VensorCensorResult | Object |
The results of video review. |
|
VideoTimelines | Array of VideoTimeline |
The moderation results that are sorted in ascending order by time. |
|
VideoTimeline | |||
Timestamp | String | 00:02:59.999 |
The position in the video. Format: |
Object | String | output{Count}.jpg |
The one or more OSS objects that are generated as the output snapshots. Note In the example, {Count} is a placeholder. The OSS objects that are generated as output
snapshots are named
output00001-****.jpg , output00002-****.jpg , and so on.
|
CensorResults | Array of CensorResult |
The moderation results that include information such as labels and scores. |
|
CensorResult | |||
Suggestion | String | block |
The recommended subsequent operation. Valid values:
|
Label | String | porn,ad |
The labels of the moderation result. Multiple labels are separated with commas (,).
|
Scene | String | porn |
The moderation scenario. Valid values:
|
Rate | String | 99.99 |
The score. |
NextPageToken | String | ea04afcca7cd4e80b9ece8fbb251**** |
The token that is used to retrieve the next page of the query results. |
CensorResults | Array of CensorResult |
A collection of the moderation results. The information includes the summary about various scenarios such as pornographic content and terrorist content. |
|
CensorResult | |||
Suggestion | String | review |
The recommended subsequent operation. Valid values:
|
Label | String | meaningless |
The labels of the moderation result. Multiple labels are separated with commas (,).
|
Scene | String | terrorism |
The moderation scenario. Valid values:
|
Rate | String | 100 |
The score. |
PipelineId | String | c5b30b7c0d0e4a0abde1d5f9e751**** |
The ID of the ApsaraVideo Media Processing (MPS) queue that is used to run the job. |
Examples
Sample requests
http(s)://mts.cn-shanghai.aliyuncs.com/?Action=QueryMediaCensorJobDetail
&JobId=2288c6ca184c0e47098a5b665e2a12****
&NextPageToken=ae0fd49c0840e14daf0d66a75b83****
&MaximumPageSize=30
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<QueryMediaCensorJobDetailResponse>
<RequestId>B42299E6-F71F-465F-8FE9-4FC2E3D3C2CA</RequestId>
<MediaCensorJobDetail>
<CreationTime>2018-09-13T16:32:24Z</CreationTime>
<FinishTime>2018-09-21</FinishTime>
<Suggestion>block</Suggestion>
<CoverImageCensorResults>
<Object>test/ai/censor/v2/vme-****.jpg</Object>
<Location>oss-cn-shanghai</Location>
<Bucket>bucket-out-test-****</Bucket>
<Results>
<Suggestion>pass</Suggestion>
<Label>normal</Label>
<Scene>porn</Scene>
<Rate>100</Rate>
</Results>
</CoverImageCensorResults>
<State>Success</State>
<TitleCensorResult>
<Suggestion>block</Suggestion>
<Label>meaningless</Label>
<Scene>antispam</Scene>
<Rate>99.91</Rate>
</TitleCensorResult>
<Message>The resource operated cannot be found</Message>
<Input>
<Object>test/ai/censor/test-****.mp4</Object>
<Location>oss-cn-shanghai</Location>
<Bucket>bucket-test-in-****</Bucket>
</Input>
<BarrageCensorResult>
<Suggestion>pass</Suggestion>
<Label>normal</Label>
<Scene>antispam</Scene>
<Rate>99.91</Rate>
</BarrageCensorResult>
<DescCensorResult>
<Suggestion>review</Suggestion>
<Label>normal</Label>
<Scene>antispam</Scene>
<Rate>100</Rate>
</DescCensorResult>
<VideoCensorConfig>
<OutputFile>
<Object>output{Count}.jpg</Object>
<Location>oss-cn-shanghai</Location>
<Bucket>test-bucket-****</Bucket>
</OutputFile>
<VideoCensor>true</VideoCensor>
<BizType>common</BizType>
</VideoCensorConfig>
<JobId>f8f166eea7a44e9bb0a4aecf9543****</JobId>
<UserData>example userdata ****</UserData>
<Code>InvalidParameter.ResourceNotFound</Code>
<VensorCensorResult>
<VideoTimelines>
<Timestamp>00:02:59.999</Timestamp>
<Object>output{Count}.jpg</Object>
<CensorResults>
<Suggestion>block</Suggestion>
<Label>porn,ad</Label>
<Scene>porn</Scene>
<Rate>99.99</Rate>
</CensorResults>
</VideoTimelines>
<NextPageToken>ea04afcca7cd4e80b9ece8fbb251****</NextPageToken>
<CensorResults>
<Suggestion>review</Suggestion>
<Label>meaningless</Label>
<Scene>terrorism</Scene>
<Rate>100</Rate>
</CensorResults>
</VensorCensorResult>
<PipelineId>c5b30b7c0d0e4a0abde1d5f9e751****</PipelineId>
</MediaCensorJobDetail>
</QueryMediaCensorJobDetailResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "B42299E6-F71F-465F-8FE9-4FC2E3D3C2CA",
"MediaCensorJobDetail" : {
"CreationTime" : "2018-09-13T16:32:24Z",
"FinishTime" : "2018-09-21",
"Suggestion" : "block",
"CoverImageCensorResults" : [ {
"Object" : "test/ai/censor/v2/vme-****.jpg",
"Location" : "oss-cn-shanghai",
"Bucket" : "bucket-out-test-****",
"Results" : [ {
"Suggestion" : "pass",
"Label" : "normal",
"Scene" : "porn",
"Rate" : "100"
} ]
} ],
"State" : "Success",
"TitleCensorResult" : {
"Suggestion" : "block",
"Label" : "meaningless",
"Scene" : "antispam",
"Rate" : "99.91"
},
"Message" : "The resource operated cannot be found",
"Input" : {
"Object" : "test/ai/censor/test-****.mp4",
"Location" : "oss-cn-shanghai",
"Bucket" : "bucket-test-in-****"
},
"BarrageCensorResult" : {
"Suggestion" : "pass",
"Label" : "normal",
"Scene" : "antispam",
"Rate" : "99.91"
},
"DescCensorResult" : {
"Suggestion" : "review",
"Label" : "normal",
"Scene" : "antispam",
"Rate" : "100"
},
"VideoCensorConfig" : {
"OutputFile" : {
"Object" : "output{Count}.jpg",
"Location" : "oss-cn-shanghai",
"Bucket" : "test-bucket-****"
},
"VideoCensor" : "true",
"BizType" : "common"
},
"JobId" : "f8f166eea7a44e9bb0a4aecf9543****",
"UserData" : "example userdata ****",
"Code" : "InvalidParameter.ResourceNotFound",
"VensorCensorResult" : {
"VideoTimelines" : [ {
"Timestamp" : "00:02:59.999",
"Object" : "output{Count}.jpg",
"CensorResults" : [ {
"Suggestion" : "block",
"Label" : "porn,ad",
"Scene" : "porn",
"Rate" : "99.99"
} ]
} ],
"NextPageToken" : "ea04afcca7cd4e80b9ece8fbb251****",
"CensorResults" : [ {
"Suggestion" : "review",
"Label" : "meaningless",
"Scene" : "terrorism",
"Rate" : "100"
} ]
},
"PipelineId" : "c5b30b7c0d0e4a0abde1d5f9e751****"
}
}
Additional description of sample responses
// Sample {jobId}.video_timeline file
// After the moderation is complete, the system generates a JSON file named {jobId}.video_timeline and stores the file in the OSS bucket specified by the CensorConfig.OutputFile parameter of the SubmitMediaCensorJob operation. Sample content of the file:
[
{
"CensorResults":[
{
"Label":"ad",
"Rate":"99.9100000000",
"Scene":"ad"
}
],
"Object":"gaoshen/test8/example-00001.jpg",
"Timestamp":"00:00:00.005"
},
{
"CensorResults":[
{
"Label":"ad",
"Rate":"99.9100000000",
"Scene":"ad"
}
],
"Object":"gaoshen/test8/example-00002.jpg",
"Timestamp":"00:00:05.005"
},
{
"CensorResults":[
{
"Label":"ad",
"Rate":"99.9100000000",
"Scene":"ad"
}
],
"Object":"gaoshen/test8/example-00003.jpg",
"Timestamp":"00:00:10.005"
},
{
"CensorResults":[
{
"Label":"ad",
"Rate":"99.9100000000",
"Scene":"ad"
}
],
"Object":"gaoshen/test8/example-00004.jpg",
"Timestamp":"00:00:15.005"
},
{
"CensorResults":[
{
"Label":"politics",
"Rate":"82.6500000000",
"Scene":"terrorism",
"SfaceData":[
{
"faces":[
{
"id":"AliFace_0006942",
"name":"Name",
"rate":82.65
}
],
"h":51,
"w":40,
"x":744,
"y":121
}
]
}
],
"Object":"gaoshen/test8/example-00008.jpg",
"Timestamp":"00:00:35.005"
},
{
"CensorResults":[
{
"Label":"politics",
"Rate":"93.6800000000",
"Scene":"terrorism",
"SfaceData":[
{
"faces":[
{
"id":"AliFace_0006942",
"name":"Name",
"rate":93.68
}
],
"h":119,
"w":94,
"x":662,
"y":94
}
]
}
],
"Object":"gaoshen/test8/example-00011.jpg",
"Timestamp":"00:00:50.005"
},
{
"CensorResults":[
{
"Label":"ad",
"Rate":"99.9100000000",
"Scene":"ad"
}
],
"Object":"gaoshen/test8/example-00011.jpg",
"Timestamp":"00:00:50.005"
},
{
"CensorResults":[
{
"Label":"politics",
"Rate":"89.2900000000",
"Scene":"terrorism",
"SfaceData":[
{
"faces":[
{
"id":"AliFace_0006942",
"name":"Name",
"rate":89.29
}
],
"h":112,
"w":98,
"x":665,
"y":138
}
]
}
],
"Object":"gaoshen/test8/example-00012.jpg",
"Timestamp":"00:00:55.005"
},
{
"CensorResults":[
{
"Label":"ad",
"Rate":"99.9100000000",
"Scene":"ad"
}
],
"Object":"gaoshen/test8/example-00012.jpg",
"Timestamp":"00:00:55.005"
},
{
"CensorResults":[
{
"Label":"politics",
"Rate":"92.1400000000",
"Scene":"terrorism",
"SfaceData":[
{
"faces":[
{
"id":"AliFace_0007536",
"name":"Name",
"rate":92.14
}
],
"h":117,
"w":91,
"x":665,
"y":79
}
]
}
],
"Object":"gaoshen/test8/example-00013.jpg",
"Timestamp":"00:01:00.005"
},
{
"CensorResults":[
{
"Label":"ad",
"Rate":"99.9100000000",
"Scene":"ad"
}
],
"Object":"gaoshen/test8/example-00013.jpg",
"Timestamp":"00:01:00.005"
},
{
"CensorResults":[
{
"Label":"politics",
"Rate":"93.0400000000",
"Scene":"terrorism",
"SfaceData":[
{
"faces":[
{
"id":"AliFace_0002750",
"name":"Name",
"rate":93.04
}
],
"h":120,
"w":93,
"x":673,
"y":79
}
]
}
],
"Object":"gaoshen/test8/example-00014.jpg",
"Timestamp":"00:01:05.005"
}
]
Error codes
For a list of error codes, visit the API Error Center.