video-analyzer

video-analyzer

Analyzes video content using vision and video LLMs. Use when the user requests "analyze video", "video understanding", "look at this video", or "analyze video".

11stars
4forks
Updated 10/1/2026
SKILL.md
read-only
name
video-analyzer
description

Analyzes video content using vision and video LLMs. Use when the user requests "analyze video", "video understanding", "look at this video", or "analyze video".

Video Analyzer

Analyzes video content using vision and video LLMs, supporting both local video files and internet videos.

Use Cases

  • The user asks to analyze, understand, or describe a video.
  • The user provides a video file path or URL and wants to understand its contents.
  • The user needs Q&A performed on a video.

Configuration

Environment Variables

Set the corresponding API Key environment variable based on the model you use:

# Volcengine (Doubao)
export ARK_API_KEY="your-api-key"

# OpenAI
export OPENAI_API_KEY="your-api-key"

Model Configuration

Edit agent_config.toml in the project root directory and configure models under the [video-analyzer] section:

[video-analyzer]
default_model = "doubao-vision"

[video-analyzer.models.doubao-vision]
base_url = "https://ark.cn-beijing.volces.com/api/v3"
api_key = "your-api-key"             # Configured directly (takes precedence)
api_key_env = "ARK_API_KEY"          # Or read from env var (used when api_key is empty)
model = "doubao-seed-1-6-vision-250815"
api_type = "responses"
supports_video = false

Each model configuration requires:

  • base_url — The API endpoint URL
  • api_key — The API key (configured directly; takes precedence)
  • api_key_env — The environment variable name (fallback when api_key is empty)
  • model — The model ID
  • api_type — Either responses or chat_completions
  • supports_video — Whether native video input is supported

API Key lookup precedence: CLI --api-key > config file api_key > environment variable api_key_env

Configuration file lookup precedence: CWD → Skill directory → Git root directory. Refer to agent_config.example.toml for reference.

Workflow

  1. Identify the Video Source: Obtain the video path or URL provided by the user.
  2. Identify Analysis Requirements: Clarify what the user wants to learn (e.g., summarize content, answer questions, describe scenes, etc.). If $ARGUMENTS is non-empty, use it as the analysis prompt.
  3. Select a Model: By default, use default_model defined in models.json. Users can also specify a model.
  4. Run Analysis: Execute the script (run inside the scripts/ directory):
    uv run analyze.py --video <video_path_or_URL> --prompt "<analysis_prompt>"
    
    Optional arguments:
    • --model <名称> — Specify model (corresponds to keys in models.json)
    • --frames <数量> — Number of frames to extract (default: 10)
    • --max-size <像素> — Maximum frame edge size in pixels (default: 720)
    • --json — Request JSON output from the model and parse it (automatically appends frame count/FPS/duration to the prompt to facilitate returning frame indices); falls back to printing raw output if parsing fails
  5. Display Results: Present the analysis returned by the model to the user.

CLI Reference

# Local video
uv run analyze.py --video /path/to/video.mp4 --prompt "Describe video content"

# Direct web video URL
uv run analyze.py --video https://example.com/video.mp4 --prompt "Analyze video"

# Video site URL (YouTube, Bilibili, etc.)
uv run analyze.py --video https://www.youtube.com/watch?v=xxxxx --prompt "Summarize video"

# Specify model and frame count
uv run analyze.py --video video.mp4 --model doubao-vision --frames 20 --prompt "Analyze"

# Structured output (requests JSON, automatically appends frame count/FPS/duration to facilitate returning frame indices)
uv run analyze.py --video video.mp4 --prompt "Describe key moments in JSON" --json

# Typical use case: Analyze loop animation intervals for a spritesheet (see prompt template in references/loop-analysis.md)
uv run analyze.py --video animation.mp4 --prompt "<loop_analysis_template>" --json

Notes

  • Downloading from video platform URLs relies on yt-dlp, which is automatically installed as a Python dependency.
  • In frame-extraction mode, extracting more frames yields more detailed analysis but increases API call costs.
  • Downloading large video files may take time; please be patient.