Detecting when a shot changes in a video is a foundational step when it comes to video indexing. Google Cloud Video Intelligence API is capable of processing digital video to output the beginning and ending time code, demarking individual moments taken by a single camera and representing a continuous time and space. In this lab, you’ll use a Python script to process a digital video with the Video Intelligence API’s annotate function to output a series of individual shots and then compare the timestamps to the original video.
Successfully complete this lab by achieving the following learning objectives:
- Enable API
Enable the Video Intelligence API.
- Retrieve the Working Files
- Activate the Cloud Shell.
- Clone the desired repository.
- Change directory to the working files.
- Set Up Service Account
- Launch the Editor.
- Expand the content-google-cloud-certified-professional-machine-learning-engineer folder.
- Name the file
- From this hands-on lab credentials, copy the Service Account Credentials.
- Save the file.
- Switch to the Terminal to export the
- Send Request to Video Intelligence API
Execute the Python command to call the Video Intelligence API and pass in the digital video file path as an argument:
python shotchange.py https://storage.googleapis.com/cloud-samples-data/video/JaneGoodall.mp4
- Verify Output
Compare output shot change time codes to actual video for validtion of process.