From 47f8e82958b05533363822ce3ba18a3b42d6b54b Mon Sep 17 00:00:00 2001 From: Ace Nassri Date: Wed, 10 May 2017 16:42:11 -0700 Subject: [PATCH] Add new video samples (#382) --- .../samples/README.md | 18 ++++++++++-------- .../samples/quickstart.js | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-videointelligence/samples/README.md b/packages/google-cloud-videointelligence/samples/README.md index dd34ee4d552..848c4086dc8 100644 --- a/packages/google-cloud-videointelligence/samples/README.md +++ b/packages/google-cloud-videointelligence/samples/README.md @@ -2,9 +2,9 @@ # Google Cloud Video Intelligence API Node.js Samples -The [Cloud Video Intellience API][video_docs] allows developers to easily -integrate video analysis within applications, including video labeling, face -detection, and shot change detection. +The [Cloud Video Intelligence API][video_docs] allows developers to easily +integrate video analysis within applications, including video labeling, safe search +, and shot change detection. [video_docs]: https://cloud.google.com/video-intelligence/docs/ @@ -41,17 +41,19 @@ __Usage:__ `node analyze.js --help` ``` Commands: - faces Analyzes faces in a video using the Cloud Video Intelligence API. - shots Analyzes shot angles in a video using the Cloud Video Intelligence API. - labels Labels objects in a video using the Cloud Video Intelligence API. + shots Analyzes shot angles in a video stored in Google Cloud Storage using the Cloud Video + Intelligence API. + labels-gcs Labels objects in a video stored in Google Cloud Storage using the Cloud Video Intelligence API. + labels-file Labels objects in a video stored locally using the Cloud Video Intelligence API. Options: --help Show help [boolean] Examples: - node analyze.js faces gs://my-bucket/my-video.mp4 node analyze.js shots gs://my-bucket/my-video.mp4 - node analyze.js labels gs://my-bucket/my-video.mp4 + node analyze.js labels-gcs gs://my-bucket/my-video.mp4 + node analyze.js labels-file my-video.mp4 + node analyze.js unsafe-content gs://my-bucket/my-video.mp4 For more information, see https://cloud.google.com/video-intelligence/docs ``` diff --git a/packages/google-cloud-videointelligence/samples/quickstart.js b/packages/google-cloud-videointelligence/samples/quickstart.js index 72b9028ed8b..df537216ad7 100644 --- a/packages/google-cloud-videointelligence/samples/quickstart.js +++ b/packages/google-cloud-videointelligence/samples/quickstart.js @@ -47,7 +47,7 @@ video.annotateVideo(request) // Gets faces for video from its annotations const faces = annotations.faceAnnotations; faces.forEach((face, faceIdx) => { - console.log('Thumbnail size:', face.thumbnail.buffer.length); + console.log('Thumbnail size:', face.thumbnail.length); face.segments.forEach((segment, segmentIdx) => { console.log(`Track ${segmentIdx} of face ${faceIdx}: frames ${segment.startTimeOffset} to ${segment.endTimeOffset}`); });