in video-intelligence/analyze.js [557:634]
async function main() {
require('yargs')
.demand(1)
.command(
'shots <gcsUri>',
'Analyzes shot angles in a video stored in Google Cloud Storage using the Cloud Video Intelligence API.',
{},
opts => analyzeShots(opts.gcsUri)
)
.command(
'labels-gcs <gcsUri>',
'Labels objects in a video stored in Google Cloud Storage using the Cloud Video Intelligence API.',
{},
opts => analyzeLabelsGCS(opts.gcsUri)
)
.command(
'labels-file <filePath>',
'Labels objects in a video stored locally using the Cloud Video Intelligence API.',
{},
opts => analyzeLabelsLocal(opts.filePath)
)
.command(
'safe-search <gcsUri>',
'Detects explicit content in a video stored in Google Cloud Storage.',
{},
opts => analyzeSafeSearch(opts.gcsUri)
)
.command(
'transcription <gcsUri>',
'Extract the video transcription using the Cloud Video Intelligence API.',
{},
opts => analyzeVideoTranscription(opts.gcsUri)
)
.command(
'video-text-gcs <gcsUri>',
'Analyzes text in a video stored in Google Cloud Storage using the Cloud Video Intelligence API.',
{},
opts => analyzeTextGCS(opts.gcsUri)
)
.command(
'track-objects-gcs <gcsUri>',
'Analyzes objects in a video stored in Google Cloud Storage using the Cloud Video Intelligence API.',
{},
opts => analyzeObjectTrackingGCS(opts.gcsUri)
)
.command(
'video-text <path>',
'Analyzes text in a video stored in a local file using the Cloud Video Intelligence API.',
{},
opts => analyzeText(opts.path)
)
.command(
'track-objects <path>',
'Analyzes objects in a video stored in a local file using the Cloud Video Intelligence API.',
{},
opts => analyzeObjectTracking(opts.path)
)
.example('node $0 shots gs://cloud-samples-data/video/googlework_short.mp4')
.example('node $0 labels-gcs gs://cloud-samples-data/video/cat.mp4')
.example('node $0 labels-file googlework_short.mp4')
.example(
'node $0 safe-search gs://cloud-samples-data/video/googlework_short.mp4'
)
.example('node $0 transcription gs://cloud-samples-data/video/cat.mp4')
.example('node $0 video-text ./resources/googlework_short.mp4')
.example(
'node $0 video-text-gcs gs://nodejs-docs-samples/video/googlework_short.mp4'
)
.example('node $0 track-objects ./resources/googlework_short.mp4')
.example('node $0 track-objects-gcs gs://nodejs-docs-samples/video/cat.mp4')
.wrap(120)
.recommendCommands()
.epilogue(
'For more information, see https://cloud.google.com/video-intelligence/docs'
)
.help()
.strict().argv;
}