Analyze A Video Summarization
Copyright 2025 Google LLC.
Gemini API: Analyze a Video - Summarization
This notebook shows how you can use Gemini API's multimodal capabilities for video summarization.
Configure your API key
To run the following cell, your API key must be stored in a Colab Secret named GOOGLE_API_KEY. If you don't already have an API key, or you're not sure how to create a Colab Secret, see Authentication for an example.
Example
This notebook will use Wing It! movie directed by Rik Schutte, wills falls under the Creative Commons Attribution 4.0 License.
See the full credits for all of the other people involved in its creation.
--2025-03-04 13:58:23-- https://upload.wikimedia.org/wikipedia/commons/3/38/WING_IT%21_-_Blender_Open_Movie-full_movie.webm Resolving upload.wikimedia.org (upload.wikimedia.org)... 198.35.26.112, 2620:0:863:ed1a::2:b Connecting to upload.wikimedia.org (upload.wikimedia.org)|198.35.26.112|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 36196718 (35M) [video/webm] Saving to: ‘wingit.webm’ wingit.webm 100%[===================>] 34.52M 27.4MB/s in 1.3s 2025-03-04 13:58:25 (27.4 MB/s) - ‘wingit.webm’ saved [36196718/36196718]
....
The video is now ready to be summarized by the model.
Okay, here is a quick summary of what's happening in the video: A cat and a dog are building a spaceship out of various objects lying around in a barn. They launch into space, but the ship starts falling apart almost immediately. They barely make it through the atmosphere before crash landing back into their barn.
The model correctly describes the plot of the short movie.
Now, you can delete the no longer necessary uploaded file.
DeleteFileResponse()
Important Note
Gemini API takes only one frame per second of the video. It may cause models not to see everything that is happening, especially if something is visible only for a fraction of a second.
Summary
Now you know how you can use Gemini models to summarize what is happening in videos.
This notebook shows only one of many use cases. Check the Video understanding notebook for more examples of using the Gemini API with videos.