use of software.amazon.awssdk.services.rekognition.model.StartSegmentDetectionRequest 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);
}
}
Aggregations