Search in sources :

Example 1 with StartContentModerationResponse

use of software.amazon.awssdk.services.rekognition.model.StartContentModerationResponse in project aws-doc-sdk-examples by awsdocs.

the class VideoDetectInappropriate method startModerationDetection.

// snippet-start:[rekognition.java2.recognize_video_moderation.main]
public static void startModerationDetection(RekognitionClient rekClient, NotificationChannel channel, String bucket, String video) {
    try {
        S3Object s3Obj = S3Object.builder().bucket(bucket).name(video).build();
        Video vidOb = Video.builder().s3Object(s3Obj).build();
        StartContentModerationRequest modDetectionRequest = StartContentModerationRequest.builder().jobTag("Moderation").notificationChannel(channel).video(vidOb).build();
        StartContentModerationResponse startModDetectionResult = rekClient.startContentModeration(modDetectionRequest);
        startJobId = startModDetectionResult.jobId();
    } catch (RekognitionException e) {
        System.out.println(e.getMessage());
        System.exit(1);
    }
}
Also used : StartContentModerationRequest(software.amazon.awssdk.services.rekognition.model.StartContentModerationRequest) RekognitionException(software.amazon.awssdk.services.rekognition.model.RekognitionException) Video(software.amazon.awssdk.services.rekognition.model.Video) S3Object(software.amazon.awssdk.services.rekognition.model.S3Object) StartContentModerationResponse(software.amazon.awssdk.services.rekognition.model.StartContentModerationResponse)

Aggregations

RekognitionException (software.amazon.awssdk.services.rekognition.model.RekognitionException)1 S3Object (software.amazon.awssdk.services.rekognition.model.S3Object)1 StartContentModerationRequest (software.amazon.awssdk.services.rekognition.model.StartContentModerationRequest)1 StartContentModerationResponse (software.amazon.awssdk.services.rekognition.model.StartContentModerationResponse)1 Video (software.amazon.awssdk.services.rekognition.model.Video)1