Video understanding

To learn about video generation, see the Veo guide.

Gemini models can process videos, enabling many frontier developer use cases that would have historically required domain specific models. Some of Gemini's vision capabilities include the ability to: describe, segment, and extract information from videos, answer questions about video content, and refer to specific timestamps within a video.

You can provide videos as input to Gemini in the following ways:

Input method Max size Recommended use case
File API 20GB (paid) / 2GB (free) Large files (100MB+), long videos (10min+), reusable files.
Cloud Storage Registration 2GB (per file, no storage limits) Large files (100MB+), long videos (10min+), persistent, reusable files.
Inline Data < 100MB Small files (<100MB), short duration (<1min), one-off inputs.
YouTube URLs N/A Public YouTube videos.

Note: The File API is recommended for most use cases, especially for files larger than 100MB or when you want to reuse the file across multiple requests.

To learn about other file input methods, such as using external URLs or files stored in Google Cloud, see the File input methods guide.

Upload a video file

The following code downloads a sample video, uploads it using the Files API, waits for it to be processed, and then uses the uploaded file reference to summarize the video.

Python

from google import genai
import base64
import time

client = genai.Client()

myfile = client.files.upload(file="path/to/sample.mp4")

while not myfile.state or myfile.state.name != "ACTIVE":
    print("Processing video...")
    time.sleep(5)
    myfile = client.files.get(name=myfile.name)

interaction = client.interactions.create(
    model="gemini-3.7-flash",
    input=[
        {"type": "video", "uri": myfile.uri, "mime_type": myfile.mime_type},
        {"type": "text", "text": "Summarize this video. Then create a quiz with an answer key based on the information in this video."}
    ]
)

print(interaction.output_text)

JavaScript

import { GoogleGenAI } from "@google/genai";

const ai =