Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function main(path = 'YOUR_LOCAL_FILE') {
// [START video_streaming_label_detection_beta]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
// const path = 'Local file to analyze, e.g. ./my-file.mp4';
const {
StreamingVideoIntelligenceServiceClient,
} = require('@google-cloud/video-intelligence').v1p3beta1;
const fs = require('fs');
// Instantiates a client
const client = new StreamingVideoIntelligenceServiceClient();
// Streaming configuration
const configRequest = {
videoConfig: {
feature: 'STREAMING_LABEL_DETECTION',
},
};
const readStream = fs.createReadStream(path, {
highWaterMark: 5 * 1024 * 1024, //chunk size set to 5MB (recommended less than 10MB)
encoding: 'base64',
});
//Load file content
const chunks = [];async function main(path = 'YOUR_LOCAL_FILE', outputUri = 'PATH_TO_OUTPUT') {
// [START video_streaming_annotation_to_storage_beta]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
// const path = 'Local file to analyze, e.g. ./my-file.mp4';
// const outputUri = 'Path to output, e.g. gs://path_to_output';
const {
StreamingVideoIntelligenceServiceClient,
} = require('@google-cloud/video-intelligence').v1p3beta1;
const fs = require('fs');
// Instantiates a client
const client = new StreamingVideoIntelligenceServiceClient();
// Streaming configuration
const configRequest = {
videoConfig: {
feature: 'STREAMING_LABEL_DETECTION',
storageConfig: {
enableStorageAnnotationResult: true,
annotationResultStorageDirectory: outputUri,
},
},
};
const readStream = fs.createReadStream(path, {
highWaterMark: 5 * 1024 * 1024, //chunk size set to 5MB (recommended less than 10MB)async function main(
path = 'YOUR_LOCAL_FILE',
projectId = 'YOUR_GCP_PROJECT',
modelId = 'YOUR_AUTOML_MODELID'
) {
// [START video_streaming_automl_classification_beta]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
// const path = 'Local file to analyze, e.g. ./my-file.mp4';
// const modelId = 'autoMl model'
// const projectId = 'Your GCP Project'
const {
StreamingVideoIntelligenceServiceClient,
} = require('@google-cloud/video-intelligence').v1p3beta1;
const fs = require('fs');
// Instantiates a client
const client = new StreamingVideoIntelligenceServiceClient();
// Streaming configuration
const modelPath = `projects/${projectId}/locations/us-central1/models/${modelId}`;
const configRequest = {
videoConfig: {
feature: 'STREAMING_AUTOML_CLASSIFICATION',
automlClassificationConfig: {
modelName: modelPath,
},
},
};async function main(path = 'YOUR_LOCAL_FILE') {
// [START video_streaming_object_tracking_beta]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
// const path = 'Local file to analyze, e.g. ./my-file.mp4';
const {
StreamingVideoIntelligenceServiceClient,
} = require('@google-cloud/video-intelligence').v1p3beta1;
const fs = require('fs');
// Instantiates a client
const client = new StreamingVideoIntelligenceServiceClient();
// Streaming configuration
const configRequest = {
videoConfig: {
feature: 'STREAMING_OBJECT_TRACKING',
},
};
const readStream = fs.createReadStream(path, {
highWaterMark: 5 * 1024 * 1024, //chunk size set to 5MB (recommended less than 10MB)
encoding: 'base64',
});
//Load file content
const chunks = [];async function main(path = 'YOUR_LOCAL_FILE') {
// [START video_streaming_shot_change_detection_beta]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
// const path = 'Local file to analyze, e.g. ./my-file.mp4';
const {
StreamingVideoIntelligenceServiceClient,
} = require('@google-cloud/video-intelligence').v1p3beta1;
const fs = require('fs');
// Instantiates a client
const client = new StreamingVideoIntelligenceServiceClient();
// Streaming configuration
const configRequest = {
videoConfig: {
feature: 'STREAMING_SHOT_CHANGE_DETECTION',
},
};
const readStream = fs.createReadStream(path, {
highWaterMark: 5 * 1024 * 1024, //chunk size set to 5MB (recommended less than 10MB)
encoding: 'base64',
});
//Load file content
const chunks = [];async function main(path = 'YOUR_LOCAL_FILE') {
// [START video_streaming_explicit_content_detection_beta]
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
// const path = 'Local file to analyze, e.g. ./my-file.mp4';
const {
StreamingVideoIntelligenceServiceClient,
} = require('@google-cloud/video-intelligence').v1p3beta1;
const fs = require('fs');
// Instantiates a client
const client = new StreamingVideoIntelligenceServiceClient();
// Streaming configuration
const configRequest = {
videoConfig: {
feature: 'STREAMING_EXPLICIT_CONTENT_DETECTION',
},
};
const readStream = fs.createReadStream(path, {
highWaterMark: 5 * 1024 * 1024, //chunk size set to 5MB (recommended less than 10MB)
encoding: 'base64',
});
//Load file content