Analyze videos using Google's Gemini API - describe content, answer questions, transcribe audio with visual descriptions, reference timestamps, clip videos, and process YouTube URLs. Supports 9 video formats, multiple models (Gemini 2.5/2.0), and context windows up to 2M tokens (6 hours of video).
Install with Tessl CLI
npx tessl i github:einverne/dotfiles --skill gemini-video-understandingOverall
score
18%
Does it follow best practices?
If you maintain this skill, you can automatically optimize it using the tessl CLI to improve its score:
npx tessl skill review --optimize ./path/to/skillValidation for skill structure
This skill enables comprehensive video analysis using Google's Gemini API, including video summarization, question answering, transcription, timestamp references, and more.
Gemini 2.5 Series:
gemini-2.5-pro - Best quality, 1M contextgemini-2.5-flash - Balanced quality/speed, 1M contextgemini-2.5-flash-preview-09-2025 - Preview features, 1M contextGemini 2.0 Series:
gemini-2.0-flash - Fast processinggemini-2.0-flash-lite - Lightweight optionContext Windows:
The skill checks for GEMINI_API_KEY in this order:
process.env.GEMINI_API_KEY or $GEMINI_API_KEY.claude/skills/gemini-video-understanding/.env.env file in project rootTo set up:
# Option 1: Environment variable (recommended)
export GEMINI_API_KEY="your-api-key-here"
# Option 2: Skill directory .env file
echo "GEMINI_API_KEY=your-api-key-here" > .claude/skills/gemini-video-understanding/.env
# Option 3: Project root .env file
echo "GEMINI_API_KEY=your-api-key-here" > .envGet your API key at: https://aistudio.google.com/apikey
Use this skill when the user asks to:
For video files:
python .claude/skills/gemini-video-understanding/scripts/analyze_video.py \
--video-path "/path/to/video.mp4" \
--prompt "Summarize this video in 3 key points"For YouTube URLs:
python .claude/skills/gemini-video-understanding/scripts/analyze_video.py \
--youtube-url "https://www.youtube.com/watch?v=VIDEO_ID" \
--prompt "What are the main topics discussed?"Video Clipping (specific time range):
python .claude/skills/gemini-video-understanding/scripts/analyze_video.py \
--video-path "/path/to/video.mp4" \
--prompt "Summarize this segment" \
--start-offset "40s" \
--end-offset "80s"Custom Frame Rate:
python .claude/skills/gemini-video-understanding/scripts/analyze_video.py \
--video-path "/path/to/video.mp4" \
--prompt "Analyze the rapid movements" \
--fps 5Transcription with Timestamps:
python .claude/skills/gemini-video-understanding/scripts/analyze_video.py \
--video-path "/path/to/video.mp4" \
--prompt "Transcribe the audio with timestamps and visual descriptions"Multiple Videos (Gemini 2.5+ only):
python .claude/skills/gemini-video-understanding/scripts/analyze_video.py \
--video-paths "/path/video1.mp4" "/path/video2.mp4" \
--prompt "Compare these two videos and highlight the differences"Model Selection:
python .claude/skills/gemini-video-understanding/scripts/analyze_video.py \
--video-path "/path/to/video.mp4" \
--prompt "Detailed analysis" \
--model "gemini-2.5-pro"Required (one of):
--video-path PATH Path to local video file
--youtube-url URL YouTube video URL
--video-paths PATH [PATH..] Multiple video paths (Gemini 2.5+)
Required:
--prompt TEXT Analysis prompt/question
Optional:
--model NAME Model to use (default: gemini-2.5-flash)
--start-offset TIME Video clip start (e.g., "40s", "1m30s")
--end-offset TIME Video clip end (e.g., "80s", "2m")
--fps NUMBER Frame sampling rate (default: 1)
--output-file PATH Save response to file
--verbose Show detailed processing infoPrompt: "Summarize this video in 3 key points with timestamps"Prompt: "Create a quiz with 5 questions and answer key based on this video"Prompt: "What happens at 01:15 and how does it relate to the topic at 02:30?"Prompt: "Transcribe the audio from this video with timestamps for salient events and visual descriptions"Prompt: "Compare these two product demo videos. Which one explains the features more clearly?"Prompt: "List all the actions performed in this tutorial video with timestamps"Free Tier (per model):
YouTube Limitations:
Storage (Files API):
Video tokens depend on resolution:
Example: A 10-minute video = 600 seconds × 300 tokens = ~180,000 tokens
Common errors and solutions:
| Error | Cause | Solution |
|---|---|---|
| 400 Bad Request | Invalid video format or corrupt file | Check file format and integrity |
| 403 Forbidden | Invalid/missing API key | Verify GEMINI_API_KEY configuration |
| 404 Not Found | File URI not found | Ensure file is uploaded and active |
| 429 Too Many Requests | Rate limit exceeded | Implement backoff, upgrade to paid tier |
| 500 Internal Error | Server-side issue | Retry with exponential backoff |
When a user requests video analysis:
For videos >20MB or reusable content:
For videos <20MB:
# User: "Analyze this YouTube tutorial video"
python .claude/skills/gemini-video-understanding/scripts/analyze_video.py \
--youtube-url "https://www.youtube.com/watch?v=abc123" \
--prompt "Create a structured summary with: 1) Main topics, 2) Key takeaways, 3) Recommended audience"# User: "Transcribe this interview with timestamps"
python .claude/skills/gemini-video-understanding/scripts/analyze_video.py \
--video-path "interview.mp4" \
--prompt "Transcribe this interview with speaker labels, timestamps, and visual descriptions of gestures or slides shown"# User: "Compare these two product demo videos"
python .claude/skills/gemini-video-understanding/scripts/analyze_video.py \
--video-paths "demo1.mp4" "demo2.mp4" \
--model "gemini-2.5-pro" \
--prompt "Compare these product demos on: features shown, presentation quality, clarity of explanation, and overall effectiveness"API Key Not Found:
# Check API key detection
python .claude/skills/gemini-video-understanding/scripts/check_api_key.pyVideo Too Large:
Error: Request size exceeds 20MB
Solution: Script automatically uses Files API for large videosProcessing Timeout:
Error: File not reaching ACTIVE state
Solution: Check video integrity, try smaller file, or different formatRate Limit Errors:
Error: 429 Too Many Requests
Solution: Wait before retry, or upgrade to paid tierIf you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.