Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions video/cloud-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,12 @@ Detect Shots
java -cp target/video-google-cloud-samples-1.0.0-jar-with-dependencies.jar \
com.example.video.Detect shots gs://cloudmleap/video/next/gbikes_dinosaur.mp4
```

From Windows, you may need to supply your classpath diferently, for example:
```
java -cp target\\video-google-cloud-samples-1.0.0-jar-with-dependencies.jar com.example.video.Detect labels gs://demomaker/cat.mp4
```
or
```
java -cp target\\video-google-cloud-samples-1.0.0-jar-with-dependencies.jar com.example.video.Detect labels-file resources\\cat.mp4
```
29 changes: 6 additions & 23 deletions video/cloud-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,39 +43,22 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud</artifactId>
<version>0.18.0-alpha</version>
<exclusions>
<exclusion> <!-- exclude an old version of Guava -->
<groupId>com.google.guava</groupId>
<artifactId>guava-jdk5</artifactId>
</exclusion>
</exclusions>
<version>0.20.1-alpha</version>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-video-intelligence</artifactId>
<version>0.20.0-alpha</version>
<exclusions>
<exclusion> <!-- exclude an old version of Guava -->
<groupId>com.google.guava</groupId>
<artifactId>guava-jdk5</artifactId>
</exclusion>
</exclusions>
<version>0.20.1-alpha</version>
</dependency>
<dependency>
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-oauth2-http</artifactId>
<version>0.6.1</version>
</dependency>
<dependency>
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-credentials</artifactId>
<artifactId>google-auth-library-credentials</artifactId>
<version>0.6.1</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<version>1.1.33.Fork26</version>
<groupId>com.google.oauth-client</groupId>
<artifactId>google-oauth-client-jetty</artifactId>
<version>1.22.0</version>
</dependency>
<!-- [END dependencies] -->

Expand Down
11 changes: 6 additions & 5 deletions video/cloud-client/src/main/java/com/example/video/Detect.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.example.video;

import com.google.api.gax.grpc.OperationFuture;
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoProgress;
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest;
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoResponse;
import com.google.cloud.videointelligence.v1beta1.FaceAnnotation;
Expand Down Expand Up @@ -111,7 +112,7 @@ public static void analyzeFaces(String gcsUri) throws ExecutionException,
.addFeatures(Feature.FACE_DETECTION)
.build();

OperationFuture<AnnotateVideoResponse> operation =
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation =
client.annotateVideoAsync(request);

System.out.println("Waiting for operation to complete...");
Expand Down Expand Up @@ -151,7 +152,7 @@ public static void analyzeLabels(String gcsUri) throws
.addFeatures(Feature.LABEL_DETECTION)
.build();

OperationFuture<AnnotateVideoResponse> operation =
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation =
client.annotateVideoAsync(request);

System.out.println("Waiting for operation to complete...");
Expand Down Expand Up @@ -199,7 +200,7 @@ public static void analyzeLabelsFile(String filePath) throws
.addFeatures(Feature.LABEL_DETECTION)
.build();

OperationFuture<AnnotateVideoResponse> operation =
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation =
client.annotateVideoAsync(request);

System.out.println("Waiting for operation to complete...");
Expand Down Expand Up @@ -244,7 +245,7 @@ public static void analyzeShots(String gcsUri)
.addFeatures(Feature.SHOT_CHANGE_DETECTION)
.build();

OperationFuture<AnnotateVideoResponse> operation =
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation =
client.annotateVideoAsync(request);

System.out.println("Waiting for operation to complete...");
Expand Down Expand Up @@ -284,7 +285,7 @@ public static void analyzeSafeSearch(String gcsUri)
.addFeatures(Feature.SAFE_SEARCH_DETECTION)
.build();

OperationFuture<AnnotateVideoResponse> operation =
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation =
client.annotateVideoAsync(request);

System.out.println("Waiting for operation to complete...");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

// [START videointelligence_quickstart]
import com.google.api.gax.grpc.OperationFuture;
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoProgress;
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest;
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoResponse;
import com.google.cloud.videointelligence.v1beta1.Feature;
Expand Down Expand Up @@ -48,7 +49,7 @@ public static void main(String[] args) throws
.addFeatures(Feature.LABEL_DETECTION)
.build();

OperationFuture<AnnotateVideoResponse> operation =
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation =
client.annotateVideoAsync(request);

System.out.println("Waiting for operation to complete...");
Expand Down