google / cloud-videointelligence
Cloud Video Intelligence Client for PHP
Requires
- php: ^8.0
- google/gax: ^1.36.0
Requires (Dev)
- google/cloud-core: ^1.52.7
- phpunit/phpunit: ^9.0
Suggests
- ext-protobuf: Provides a significant increase in throughput over the pure PHP protobuf implementation. See https://cloud.google.com/php/grpc for installation instructions.
- dev-main
- v2.0.2
- v2.0.1
- v2.0.0
- v2.0.0-RC1
- v1.15.5
- v1.15.4
- v1.15.3
- v1.15.2
- v1.15.1
- v1.15.0
- v1.14.2
- v1.14.1
- v1.14.0
- v1.13.1
- v1.13.0
- v1.12.16
- v1.12.15
- v1.12.14
- v1.12.13
- v1.12.12
- v1.12.11
- v1.12.10
- v1.12.9
- v1.12.8
- v1.12.7
- v1.12.6
- v1.12.5
- v1.12.4
- v1.12.3
- v1.12.2
- v1.12.1
- v1.12.0
- v1.11.2
- v1.11.1
- v1.11.0
- v1.10.0
- v1.9.3
- v1.9.2
- v1.9.1
- v1.9.0
- v1.8.0
- v1.7.2
- v1.7.1
- v1.7.0
- v1.6.1
- v1.6.0
- v1.5.3
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.0
- v1.3.1
- v1.3.0
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.0
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v0.12.0
- v0.11.1
- v0.11.0
- v0.10.4
- v0.10.3
- v0.10.2
- v0.10.1
- v0.10.0
- v0.9.3
- v0.9.2
- v0.9.1
- v0.9.0
- v0.8.3
- v0.8.2
- v0.8.1
- v0.8.0
- v0.7.0
- v0.6.0
- v0.5.0
- v0.4.0
- v0.3.3
- v0.3.2
- v0.3.1
- v0.3.0
- v0.2.0
- v0.1.0
This package is auto-updated.
Last update: 2024-12-12 23:19:04 UTC
README
Idiomatic PHP client for Cloud Video Intelligence
NOTE: This repository is part of Google Cloud PHP. Any support requests, bug reports, or development contributions should be directed to that project.
Allows developers to use Google video analysis technology as part of their applications. The REST API enables users to annotate videos stored locally or in Google Cloud Storage with contextual information at the level of the entire video, per segment, per shot, and per frame.
NOTE: This documentation covers the most recent stable release (V1). There is an additional beta release included in this component. To check out its documentation, see the link below:
Installation
To begin, install the preferred dependency manager for PHP, Composer.
Now install this component:
$ composer require google/cloud-videointelligence
This component supports both REST over HTTP/1.1 and gRPC. In order to take advantage of the benefits offered by gRPC (such as streaming methods) please see our gRPC installation guide.
Authentication
Please see our Authentication guide for more information on authenticating your client. Once authenticated, you'll be ready to start making requests.
Sample
require __DIR__ . '/vendor/autoload.php'; use Google\Cloud\VideoIntelligence\V1\VideoIntelligenceServiceClient; use Google\Cloud\VideoIntelligence\V1\Feature; $videoIntelligenceServiceClient = new VideoIntelligenceServiceClient(); $inputUri = "gs://example-bucket/example-video.mp4"; $features = [ Feature::LABEL_DETECTION, ]; $operationResponse = $videoIntelligenceServiceClient->annotateVideo([ 'inputUri' => $inputUri, 'features' => $features ]); $operationResponse->pollUntilComplete(); if ($operationResponse->operationSucceeded()) { $results = $operationResponse->getResult(); foreach ($results->getAnnotationResults() as $result) { echo 'Segment labels' . PHP_EOL; foreach ($result->getSegmentLabelAnnotations() as $labelAnnotation) { echo "Label: " . $labelAnnotation->getEntity()->getDescription() . PHP_EOL; } echo 'Shot labels' . PHP_EOL; foreach ($result->getShotLabelAnnotations() as $labelAnnotation) { echo "Label: " . $labelAnnotation->getEntity()->getDescription() . PHP_EOL; } echo 'Frame labels' . PHP_EOL; foreach ($result->getFrameLabelAnnotations() as $labelAnnotation) { echo "Label: " . $labelAnnotation->getEntity()->getDescription() . PHP_EOL; } } } else { $error = $operationResponse->getError(); echo "error: " . $error->getMessage() . PHP_EOL; }
Debugging
Please see our Debugging guide for more information about the debugging tools.
Version
This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in any minor or patch releases. We will address issues and requests with the highest priority.
Next Steps
- Understand the official documentation.
- Take a look at in-depth usage samples.