API | Description |
Submits video moderation job. | |
Queries the result of specified video moderation job. |
VideoAuditingResponse createVideoAuditingJob(VideoAuditingRequest request);
//1. Create a job request objectVideoAuditingRequest request = new VideoAuditingRequest();//2. Add request parameters as detailed in the API documentationrequest.setBucketName("examplebucket-1250000000");request.getInput().setObject("1.mp4");request.getConf().setDetectType("Porn,Ads");request.getConf().getSnapshot().setCount("10");request.getConf().getSnapshot().setMode("Interval");request.getConf().getSnapshot().setTimeInterval("10");//3. Call the API to get the job response objectVideoAuditingResponse response = client.createVideoAuditingJob(request);
Request
has the following sub-nodes:Node Name (Keyword) | Parent Node | Description | Type | Required |
Input | Request | Video to be moderated. | Container | Yes |
Conf | Request | Moderation rule configuration. | Container | Yes |
Input
has the following sub-nodes:Node Name (Keyword) | Parent Node | Description | Type | Required |
Object | Request.Input | Name of the video file stored in the COS bucket; for example, if the file is video.mp4 in the test directory, then the filename is test/video.mp4 . | String | Yes |
Url | Request.Input | Full URL of the video file, such as http://examplebucket-1250000000.cos.ap-shanghai.myqcloud.com/test.mp4 . Either Object or Url can be selected at a time. | String | No |
Conf
has the following sub-nodes:Node Name (Keyword) | Parent Node | Description | Type | Required |
DetectType | Request.Conf | The scene to be moderated, such as Porn (pornography) and Ads (advertising). You can pass in multiple types and separate them by comma, such as Porn,Ads . | String | Yes |
Snapshot | Request.Conf | Video image moderation is implemented by taking a certain number of screenshots based on the video frame capturing capability and then moderating the screenshots one by one. This parameter is used to specify the configuration of video frame capturing. | Container | Yes |
Callback | Request.Conf | Callback address, which must start with http:// or https:// . | String | No |
CallbackVersion | Request.Conf | Structure of the callback content. Valid values: Simple (the callback content contains basic information), Detail (the callback content contains detailed information). Default value: Simple . | String | No |
BizType | Request.Conf | Moderation policy. If this parameter is not specified, the default policy will be used. | String | No |
DetectContent | Request.Conf | Whether to moderate video sound. Valid values: 0 (moderates the video image only), 1 (moderates both the video image and video sound). Default value: 0 . | Integer | No |
Snapshot
has the following sub-nodes:Node Name (Keyword) | Parent Node | Description | Type | Required |
Mode | Request.Conf.Snapshot | Frame capturing mode. Valid values: Interval (interval mode), Average (average mode), Fps (fixed frame rate mode).Interval mode: The TimeInterval and Count parameters take effect. If Count is set but TimeInterval is not, all frames will be captured to generate a total of Count images.Average mode: The Count parameter takes effect, indicating to capture a total of Count images at an average interval in the entire video. Fps mode: TimeInterval indicates how many frames to capture per second, and Count indicates how many frames to capture in total. | String | No |
Count | Request.Conf.Snapshot | The number of captured frames. Value range: (0, 10000]. | String | No |
TimeInterval | Request.Conf.Snapshot | Video frame capturing frequency. Value range: (0.000, 60.000] seconds. The value supports the float format, accurate to the millisecond. | Float | No |
VideoAuditingResponse
media moderation job result object is returned upon success.CosClientException
or CosServiceException
exception. For more information, see Troubleshooting.VideoAuditingResponse describeAuditingJob(VideoAuditingRequest request);
//1. Create a job request objectVideoAuditingRequest request = new VideoAuditingRequest();//2. Add request parameters as detailed in the API documentationrequest.setBucketName("examplebucket-1250000000");request.setJobId("av81591b4bbd2211eb80235254008*****");//3. Call the API to get the job response objectVideoAuditingResponse response = client.describeAuditingJob(request);
Parameter | Description | Type | Required |
bucketName | String | Yes | |
jobId | ID of the job to be queried. | String | Yes |
VideoAuditingResponse
moderation job result object is returned.CosClientException
or CosServiceException
exception will be reported. For more information, see Troubleshooting.
Was this page helpful?