Class VideoIntelligence


  • public class VideoIntelligence
    extends java.lang.Object
    Factory class for PTransforms integrating with Google Cloud AI - VideoIntelligence service. Converts GCS URIs of videos or ByteStrings with video contents into Lists of VideoAnnotationResults.

    Adding a side input of Maps of elements to VideoContext objects is allowed, so is using KVs of element and VideoContext as input.

    Service account with proper permissions is required to use these transforms.

    • Constructor Detail

      • VideoIntelligence

        public VideoIntelligence()
    • Method Detail

      • annotateFromURI

        public static VideoIntelligence.AnnotateVideoFromUri annotateFromURI​(java.util.List<com.google.cloud.videointelligence.v1.Feature> featureList,
                                                                             org.apache.beam.sdk.values.PCollectionView<java.util.Map<java.lang.String,​com.google.cloud.videointelligence.v1.VideoContext>> contextSideInput)
        Annotates videos from GCS URIs.
        Parameters:
        featureList - List of features to be annotated
        contextSideInput - Optional side input with map of contexts to URIs
        Returns:
        PTransform performing the necessary operations
      • annotateFromBytes

        public static VideoIntelligence.AnnotateVideoFromBytes annotateFromBytes​(org.apache.beam.sdk.values.PCollectionView<java.util.Map<com.google.protobuf.ByteString,​com.google.cloud.videointelligence.v1.VideoContext>> contextSideInput,
                                                                                 java.util.List<com.google.cloud.videointelligence.v1.Feature> featureList)
        Annotates videos from ByteStrings of their contents.
        Parameters:
        featureList - List of features to be annotated
        contextSideInput - Optional side input with map of contexts to ByteStrings
        Returns:
        PTransform performing the necessary operations
      • annotateFromUriWithContext

        public static VideoIntelligence.AnnotateVideoFromURIWithContext annotateFromUriWithContext​(java.util.List<com.google.cloud.videointelligence.v1.Feature> featureList)
        Annotates videos from key-value pairs of GCS URI and VideoContext.
        Parameters:
        featureList - List of features to be annotated
        Returns:
        PTransform performing the necessary operations
      • annotateFromBytesWithContext

        public static VideoIntelligence.AnnotateVideoFromBytesWithContext annotateFromBytesWithContext​(java.util.List<com.google.cloud.videointelligence.v1.Feature> featureList)
        Annotates videos from key-value pairs of ByteStrings and VideoContext.
        Parameters:
        featureList - List of features to be annotated
        Returns:
        PTransform performing the necessary operations