This simple command-line application demonstrates how to invoke Google Video Intelligence API from PHP.
- Enable APIs - Enable the Video Intelligence API and create a new project or select an existing project.
- Download The Credentials - Click "Go to credentials" after enabling the APIs. Click
"New Credentials"
and select "Service Account Key". Create a new service account, use the JSON key type, and
select "Create". Once downloaded, set the environment variable
GOOGLE_APPLICATION_CREDENTIALS
to the path of the JSON key that was downloaded. - Clone the repo and cd into this directory
$ git clone https://github.com/GoogleCloudPlatform/php-docs-samples
$ cd php-docs-samples/video
- Install dependencies via Composer.
Run
php composer.phar install
(if composer is installed locally) orcomposer install
(if composer is installed globally). - Run with the command
php src/SNIPPET_NAME.php
. For example:$ php src/analyze_shots.php gs://cloud-samples-data/video/cat.mp4 Usage: php src/analyze_shots.php URI $ php src/analyze_shots.php gs://cloud-samples-data/video/cat.mp4 Shot: 0s to 14.84s
- See CONTRIBUTING.md
- See LICENSE