- A Cloud Guru
Detecting Shot Changes with the Video Intelligence API
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.
Table of Contents
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
Compare output shot change time codes to actual video for validtion of process.
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.