Search in sources :

Example 11 with VideoContext

use of com.google.cloud.videointelligence.v1.VideoContext in project beam by apache.

the class AnnotateVideoFromURIFn method processElement.

/**
 * ProcessElement implementation.
 */
@Override
public void processElement(ProcessContext context) throws ExecutionException, InterruptedException {
    String elementURI = context.element();
    VideoContext videoContext = null;
    if (contextSideInput != null) {
        videoContext = context.sideInput(contextSideInput).get(elementURI);
    }
    List<VideoAnnotationResults> annotationResultsList = getVideoAnnotationResults(elementURI, null, videoContext);
    context.output(annotationResultsList);
}
Also used : VideoAnnotationResults(com.google.cloud.videointelligence.v1.VideoAnnotationResults) VideoContext(com.google.cloud.videointelligence.v1.VideoContext)

Aggregations

VideoContext (com.google.cloud.videointelligence.v1.VideoContext)5 VideoAnnotationResults (com.google.cloud.videointelligence.v1.VideoAnnotationResults)4 AnnotateVideoProgress (com.google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress)3 AnnotateVideoRequest (com.google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest)3 AnnotateVideoResponse (com.google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse)3 VideoAnnotationResults (com.google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults)3 VideoContext (com.google.cloud.videointelligence.v1p1beta1.VideoContext)3 VideoIntelligenceServiceClient (com.google.cloud.videointelligence.v1p1beta1.VideoIntelligenceServiceClient)3 ArrayList (java.util.ArrayList)3 Test (org.junit.Test)3 Feature (com.google.cloud.videointelligence.v1beta1.Feature)2 VideoContext (com.google.cloud.videointelligence.v1beta1.VideoContext)2 FaceConfig (com.google.cloud.videointelligence.v1p1beta1.FaceConfig)2 FaceDetectionAnnotation (com.google.cloud.videointelligence.v1p1beta1.FaceDetectionAnnotation)2 FaceDetectionFrame (com.google.cloud.videointelligence.v1p1beta1.FaceDetectionFrame)2 FaceSegment (com.google.cloud.videointelligence.v1p1beta1.FaceSegment)2 ByteString (com.google.protobuf.ByteString)2 ApiException (com.google.api.gax.grpc.ApiException)1 AnnotateVideoProgress (com.google.cloud.videointelligence.v1.AnnotateVideoProgress)1 AnnotateVideoRequest (com.google.cloud.videointelligence.v1.AnnotateVideoRequest)1