@@ -163,7 +163,7 @@ async function analyzeShots(gcsUri) {
163
163
console . log ( 'Shot changes:' ) ;
164
164
165
165
if ( shotChanges . length === 1 ) {
166
- console . log ( ` The entire video is one shot.` ) ;
166
+ console . log ( ' The entire video is one shot.' ) ;
167
167
} else {
168
168
shotChanges . forEach ( ( shot , shotIdx ) => {
169
169
console . log ( `Scene ${ shotIdx } occurs from:` ) ;
@@ -344,7 +344,7 @@ async function analyzeTextGCS(gcsUri) {
344
344
`Time offset for the frame: ${ timeOffset . seconds || 0 } ` +
345
345
`.${ ( timeOffset . nanos / 1e6 ) . toFixed ( 0 ) } s`
346
346
) ;
347
- console . log ( ` Rotated Bounding Box Vertices:` ) ;
347
+ console . log ( ' Rotated Bounding Box Vertices:' ) ;
348
348
frame . rotatedBoundingBox . vertices . forEach ( vertex => {
349
349
console . log ( `Vertex.x:${ vertex . x } , Vertex.y:${ vertex . y } ` ) ;
350
350
} ) ;
@@ -399,7 +399,7 @@ async function analyzeObjectTrackingGCS(gcsUri) {
399
399
`Time offset for the first frame: ${ timeOffset . seconds || 0 } ` +
400
400
`.${ ( timeOffset . nanos / 1e6 ) . toFixed ( 0 ) } s`
401
401
) ;
402
- console . log ( ` Bounding box position:` ) ;
402
+ console . log ( ' Bounding box position:' ) ;
403
403
console . log ( ` left :${ box . left } ` ) ;
404
404
console . log ( ` top :${ box . top } ` ) ;
405
405
console . log ( ` right :${ box . right } ` ) ;
@@ -468,7 +468,7 @@ async function analyzeText(path) {
468
468
`Time offset for the frame: ${ timeOffset . seconds || 0 } ` +
469
469
`.${ ( timeOffset . nanos / 1e6 ) . toFixed ( 0 ) } s`
470
470
) ;
471
- console . log ( ` Rotated Bounding Box Vertices:` ) ;
471
+ console . log ( ' Rotated Bounding Box Vertices:' ) ;
472
472
frame . rotatedBoundingBox . vertices . forEach ( vertex => {
473
473
console . log ( `Vertex.x:${ vertex . x } , Vertex.y:${ vertex . y } ` ) ;
474
474
} ) ;
@@ -526,7 +526,7 @@ async function analyzeObjectTracking(path) {
526
526
`Time offset for the first frame: ${ timeOffset . seconds || 0 } ` +
527
527
`.${ ( timeOffset . nanos / 1e6 ) . toFixed ( 0 ) } s`
528
528
) ;
529
- console . log ( ` Bounding box position:` ) ;
529
+ console . log ( ' Bounding box position:' ) ;
530
530
console . log ( ` left :${ box . left } ` ) ;
531
531
console . log ( ` top :${ box . top } ` ) ;
532
532
console . log ( ` right :${ box . right } ` ) ;
@@ -536,77 +536,79 @@ async function analyzeObjectTracking(path) {
536
536
}
537
537
538
538
async function main ( ) {
539
- require ( ` yargs` )
539
+ require ( ' yargs' )
540
540
. demand ( 1 )
541
541
. command (
542
- ` shots <gcsUri>` ,
543
- ` Analyzes shot angles in a video stored in Google Cloud Storage using the Cloud Video Intelligence API.` ,
542
+ ' shots <gcsUri>' ,
543
+ ' Analyzes shot angles in a video stored in Google Cloud Storage using the Cloud Video Intelligence API.' ,
544
544
{ } ,
545
545
opts => analyzeShots ( opts . gcsUri )
546
546
)
547
547
. command (
548
- ` labels-gcs <gcsUri>` ,
549
- ` Labels objects in a video stored in Google Cloud Storage using the Cloud Video Intelligence API.` ,
548
+ ' labels-gcs <gcsUri>' ,
549
+ ' Labels objects in a video stored in Google Cloud Storage using the Cloud Video Intelligence API.' ,
550
550
{ } ,
551
551
opts => analyzeLabelsGCS ( opts . gcsUri )
552
552
)
553
553
. command (
554
- ` labels-file <filePath>` ,
555
- ` Labels objects in a video stored locally using the Cloud Video Intelligence API.` ,
554
+ ' labels-file <filePath>' ,
555
+ ' Labels objects in a video stored locally using the Cloud Video Intelligence API.' ,
556
556
{ } ,
557
557
opts => analyzeLabelsLocal ( opts . filePath )
558
558
)
559
559
. command (
560
- ` safe-search <gcsUri>` ,
561
- ` Detects explicit content in a video stored in Google Cloud Storage.` ,
560
+ ' safe-search <gcsUri>' ,
561
+ ' Detects explicit content in a video stored in Google Cloud Storage.' ,
562
562
{ } ,
563
563
opts => analyzeSafeSearch ( opts . gcsUri )
564
564
)
565
565
. command (
566
- ` transcription <gcsUri>` ,
567
- ` Extract the video transcription using the Cloud Video Intelligence API.` ,
566
+ ' transcription <gcsUri>' ,
567
+ ' Extract the video transcription using the Cloud Video Intelligence API.' ,
568
568
{ } ,
569
569
opts => analyzeVideoTranscription ( opts . gcsUri )
570
570
)
571
571
. command (
572
- ` video-text-gcs <gcsUri>` ,
573
- ` Analyzes text in a video stored in Google Cloud Storage using the Cloud Video Intelligence API.` ,
572
+ ' video-text-gcs <gcsUri>' ,
573
+ ' Analyzes text in a video stored in Google Cloud Storage using the Cloud Video Intelligence API.' ,
574
574
{ } ,
575
575
opts => analyzeTextGCS ( opts . gcsUri )
576
576
)
577
577
. command (
578
- ` track-objects-gcs <gcsUri>` ,
579
- ` Analyzes objects in a video stored in Google Cloud Storage using the Cloud Video Intelligence API.` ,
578
+ ' track-objects-gcs <gcsUri>' ,
579
+ ' Analyzes objects in a video stored in Google Cloud Storage using the Cloud Video Intelligence API.' ,
580
580
{ } ,
581
581
opts => analyzeObjectTrackingGCS ( opts . gcsUri )
582
582
)
583
583
. command (
584
- ` video-text <path>` ,
585
- ` Analyzes text in a video stored in a local file using the Cloud Video Intelligence API.` ,
584
+ ' video-text <path>' ,
585
+ ' Analyzes text in a video stored in a local file using the Cloud Video Intelligence API.' ,
586
586
{ } ,
587
587
opts => analyzeText ( opts . path )
588
588
)
589
589
. command (
590
- ` track-objects <path>` ,
591
- ` Analyzes objects in a video stored in a local file using the Cloud Video Intelligence API.` ,
590
+ ' track-objects <path>' ,
591
+ ' Analyzes objects in a video stored in a local file using the Cloud Video Intelligence API.' ,
592
592
{ } ,
593
593
opts => analyzeObjectTracking ( opts . path )
594
594
)
595
- . example ( `node $0 shots gs://cloud-samples-data/video/googlework_short.mp4` )
596
- . example ( `node $0 labels-gcs gs://cloud-samples-data/video/cat.mp4` )
597
- . example ( `node $0 labels-file googlework_short.mp4` )
598
- . example ( `node $0 safe-search gs://cloud-samples-data/video/googlework_short.mp4` )
599
- . example ( `node $0 transcription gs://cloud-samples-data/video/cat.mp4` )
600
- . example ( `node $0 video-text ./resources/googlework_short.mp4` )
595
+ . example ( 'node $0 shots gs://cloud-samples-data/video/googlework_short.mp4' )
596
+ . example ( 'node $0 labels-gcs gs://cloud-samples-data/video/cat.mp4' )
597
+ . example ( 'node $0 labels-file googlework_short.mp4' )
601
598
. example (
602
- ` node $0 video-text-gcs gs://nodejs-docs- samples/video/googlework_short.mp4`
599
+ ' node $0 safe-search gs://cloud- samples-data /video/googlework_short.mp4'
603
600
)
604
- . example ( `node $0 track-objects ./resources/googlework_short.mp4` )
605
- . example ( `node $0 track-objects-gcs gs://nodejs-docs-samples/video/cat.mp4` )
601
+ . example ( 'node $0 transcription gs://cloud-samples-data/video/cat.mp4' )
602
+ . example ( 'node $0 video-text ./resources/googlework_short.mp4' )
603
+ . example (
604
+ 'node $0 video-text-gcs gs://nodejs-docs-samples/video/googlework_short.mp4'
605
+ )
606
+ . example ( 'node $0 track-objects ./resources/googlework_short.mp4' )
607
+ . example ( 'node $0 track-objects-gcs gs://nodejs-docs-samples/video/cat.mp4' )
606
608
. wrap ( 120 )
607
609
. recommendCommands ( )
608
610
. epilogue (
609
- ` For more information, see https://cloud.google.com/video-intelligence/docs`
611
+ ' For more information, see https://cloud.google.com/video-intelligence/docs'
610
612
)
611
613
. help ( )
612
614
. strict ( ) . argv ;
0 commit comments