Search in sources :

Example 1 with StartShotDetectionFilter

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

the class VideoDetectSegment method StartSegmentDetection.

// snippet-start:[rekognition.java2.recognize_video_segments.main]
public static void StartSegmentDetection(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();
        StartShotDetectionFilter cueDetectionFilter = StartShotDetectionFilter.builder().minSegmentConfidence(60F).build();
        StartTechnicalCueDetectionFilter technicalCueDetectionFilter = StartTechnicalCueDetectionFilter.builder().minSegmentConfidence(60F).build();
        StartSegmentDetectionFilters filters = StartSegmentDetectionFilters.builder().shotFilter(cueDetectionFilter).technicalCueFilter(technicalCueDetectionFilter).build();
        StartSegmentDetectionRequest segDetectionRequest = StartSegmentDetectionRequest.builder().jobTag("DetectingLabels").notificationChannel(channel).segmentTypes(SegmentType.TECHNICAL_CUE, SegmentType.SHOT).video(vidOb).filters(filters).build();
        StartSegmentDetectionResponse segDetectionResponse = rekClient.startSegmentDetection(segDetectionRequest);
        startJobId = segDetectionResponse.jobId();
    } catch (RekognitionException e) {
        e.getMessage();
        System.exit(1);
    }
}
Also used : StartTechnicalCueDetectionFilter(software.amazon.awssdk.services.rekognition.model.StartTechnicalCueDetectionFilter) StartSegmentDetectionFilters(software.amazon.awssdk.services.rekognition.model.StartSegmentDetectionFilters) RekognitionException(software.amazon.awssdk.services.rekognition.model.RekognitionException) Video(software.amazon.awssdk.services.rekognition.model.Video) StartSegmentDetectionResponse(software.amazon.awssdk.services.rekognition.model.StartSegmentDetectionResponse) S3Object(software.amazon.awssdk.services.rekognition.model.S3Object) StartShotDetectionFilter(software.amazon.awssdk.services.rekognition.model.StartShotDetectionFilter) StartSegmentDetectionRequest(software.amazon.awssdk.services.rekognition.model.StartSegmentDetectionRequest)

Aggregations

RekognitionException (software.amazon.awssdk.services.rekognition.model.RekognitionException)1 S3Object (software.amazon.awssdk.services.rekognition.model.S3Object)1 StartSegmentDetectionFilters (software.amazon.awssdk.services.rekognition.model.StartSegmentDetectionFilters)1 StartSegmentDetectionRequest (software.amazon.awssdk.services.rekognition.model.StartSegmentDetectionRequest)1 StartSegmentDetectionResponse (software.amazon.awssdk.services.rekognition.model.StartSegmentDetectionResponse)1 StartShotDetectionFilter (software.amazon.awssdk.services.rekognition.model.StartShotDetectionFilter)1 StartTechnicalCueDetectionFilter (software.amazon.awssdk.services.rekognition.model.StartTechnicalCueDetectionFilter)1 Video (software.amazon.awssdk.services.rekognition.model.Video)1