Use Gemini 2.5 Flash to analyze and understand multimedia content.
Supported Formats
| Type | Formats | Max Size |
|---|---|---|
| Image | jpg, jpeg, png, gif, webp | 20MB |
| Video | mp4, mpeg, mov, webm, YouTube URL | 100MB |
| Audio | wav, mp3, aiff, aac, ogg, flac, m4a | 100MB |
Prerequisites
MAX_API_KEYEnvironment variables (auto-injected by Max)- Bun 1.0+ (built into Max v0.0.27+, no additional installation required)
Usage
bun skills/media-understand/media-understand.js <media_path_or_url> [prompt] [language]
Arguments:
media_path_or_url: File path or YouTube URLprompt: Question or analysis request (default: "Please describe this content")language: Output language -chineseorenglish(default: chinese)
Examples
Image Analysis
# Describe image
bun skills/media-understand/media-understand.js ./photo.jpg "请描述这张图片" chinese
# OCR - Extract text
bun skills/media-understand/media-understand.js ./screenshot.png "识别图片中的所有文字" chinese
# Answer question about image
bun skills/media-understand/media-understand.js ./chart.png "这个图表显示了什么趋势?" chinese
Video Analysis
# YouTube video summary
bun skills/media-understand/media-understand.js "https://youtube.com/watch?v=xxx" "总结这个视频的主要内容" chinese
# Local video analysis
bun skills/media-understand/media-understand.js ./video.mp4 "视频中发生了什么?" chinese
# Timestamp-based question
bun skills/media-understand/media-understand.js "https://youtu.be/xxx" "视频 2:30 处讲了什么?" chinese
Audio Analysis
# Transcribe audio
bun skills/media-understand/media-understand.js ./recording.mp3 "请转录这段音频" chinese
# Summarize podcast
bun skills/media-understand/media-understand.js ./podcast.m4a "总结这段播客的要点" chinese
# Detect speakers
bun skills/media-understand/media-understand.js ./meeting.wav "识别不同的说话人并整理他们说的内容" chinese
Common Prompts
Image:
- Describe image: "Please describe the content of this image in detail"
- OCR: "Recognize and extract all text in the image"
- Object recognition: "What objects are in the image?"
Video:
- Summary: "Summarize the main content of this video"
- Timestamp: "What happens at X:XX in the video?"
- Extract information: "What key information is mentioned in the video?"
Audio:
- Transcription: "Please transcribe the complete content of this audio"
- Summary: "Summarize the key points of this audio"
- Speaker recognition: "Identify different speakers"
Notes
- Video via Gemini: Best results with YouTube URLs. Local video files may have limited support.
- Audio tokens: ~32 tokens/second
- Video tokens: ~300 tokens/second at default resolution
- Long media files will consume more tokens
Error Handling
File not found: Check the file path is correct
Unsupported format: Use supported formats listed above
File too large: Compress or trim the media file
API error: Please check in Max settings whether the Max API Key is correctly configured