# Gemini Video Understanding

Analyze videos with Google Gemini API (summaries, Q&A, transcription with timestamps +...

- Repository: https://github.com/benchflow-ai/skillsbench (1888 stars)
- Category: Media
- License: Apache-2.0
- Last updated: 2026-10-24
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add benchflow-ai/skillsbench --skill gemini-video-understanding -g -a claude-code -y`
Codex: `npx skills add benchflow-ai/skillsbench --skill gemini-video-understanding -g -a codex -y`
Cursor: `npx skills add benchflow-ai/skillsbench --skill gemini-video-understanding -g -a cursor -y`
Gemini CLI: `npx skills add benchflow-ai/skillsbench --skill gemini-video-understanding -g -a gemini-cli -y`

## Description

Analyze videos with Google Gemini API (summaries, Q&A, transcription with timestamps + visual context, scene/timeline detection, video clipping, FPS control, multi-video comparison, and YouTube URL analysis).

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Gemini Video Understanding Skill

## Purpose
This skill enables video understanding workflows using the Google Gemini API, including **video summarization**, **question answering**, **transcription with optional visual descriptions**, **timestamp-based queries (MM:SS)**, **scene/timeline detection**, **video clipping**, **custom FPS sampling**, **multi-video comparison**, and **YouTube URL analysis**.

## When to Use
- Summarizing a video into key points or chapters
- Answering questions about what happens at specific timestamps (MM:SS)
- Producing a transcript (optionally with visual context) and speaker labels
- Detecting scene changes or building a timeline of events
- Analyzing long videos by clipping to relevant segments or reducing FPS
- Comparing multiple videos (up to 10 videos on Gemini 2.5+)
- Analyzing public YouTube videos directly via URL

## Required Libraries

The following Python libraries are required:

```python
from google import genai
from google.genai import types
import os
import time
```

## Input Requirements
- **File formats**: MP4, MPEG, MOV, AVI, FLV, MPG, WebM, WMV, 3GPP
- **Size constraints**:
  - Use inline bytes for small files (rule of thumb: <20MB).
  - Use the File API upload flow for larger videos (most real videos).
- **YouTube**:
  - Video must be **public** (not private/unlisted) and not age-restricted.
  - Provide a valid YouTube URL.
- **Duration / context window** (model-dependent):
  - 2M-token models: ~2 hours (default resolution) or ~6 hours (low-res).
  - 1M-token models: ~1 hour (default) or ~3 hours (low-res).
- **Timestamps**: Use **MM:SS** (e.g., `01:15`) when requesting time-based answers.

## Output Schema
All extracted/derived content should be returned as valid JSON conforming to this schema:

The rest: https://github.com/benchflow-ai/skillsbench/blob/HEAD/tasks-extra/pedestrian-traffic-counting/environment/skills/gemini-video-understanding/SKILL.md
