How to use the @google-cloud/video-intelligence.v1p2beta1 function in @google-cloud/video-intelligence

To help you get started, we’ve selected a few @google-cloud/video-intelligence examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github googleapis / nodejs-video-intelligence / samples / analyze.v1p2beta1.js View on Github external
async function analyzeObjectTracking(path) {
  //[START video_object_tracking_beta]
  // Imports the Google Cloud Video Intelligence library
  const Video = require('@google-cloud/video-intelligence').v1p2beta1;
  const fs = require('fs');
  const util = require('util');
  // Creates a client
  const video = new Video.VideoIntelligenceServiceClient();
  /**
   * TODO(developer): Uncomment the following line before running the sample.
   */
  // const path = 'Local file to analyze, e.g. ./my-file.mp4';

  // Reads a local video file and converts it to base64
  const file = await util.promisify(fs.readFile)(path);
  const inputContent = file.toString('base64');

  const request = {
    inputContent: inputContent,
    features: ['OBJECT_TRACKING'],