AgentSkillsCN

video-analysis

基于人工智能的视频理解与分析工具集。当 Claude 需要执行以下任务时,可使用此技能:(1) 分析视频文件(.mp4、.mov、.avi、.mkv、.webm、屏幕录制文件);(2) 提取视频内容或对视频进行摘要总结;(3) 识别带有时间戳的关键时刻;(4) 分析产品演示或应用教程;(5) 转录或理解视频内容;(6) 从视频中提取帧或截图,或完成其他各类视频理解任务。支持通用视频摘要、产品功能提取、带时间戳的关键时刻识别,以及自定义提示词驱动的分析。

SKILL.md
--- frontmatter
name: video-analysis
description: "AI-powered video understanding and analysis toolkit. Use this skill when Claude needs to: (1) Analyze video files (.mp4, .mov, .avi, .mkv, .webm, screen recordings), (2) Extract video content or summarize videos, (3) Identify key moments with timestamps, (4) Analyze product demos or app tutorials, (5) Transcribe or understand video content, (6) Extract frames or screenshots from video, or any other video understanding task. Supports: general video summary, product feature extraction, key moment identification with timestamps, and custom prompt-based analysis."

Video Analysis

AI-powered video content understanding capability that enables intelligent analysis of video files.

Prerequisites

  • Python 3.7+
  • ARK_API_KEY environment variable (Volces ARK API required)
  • Required packages: openai (Volces ARK API is compatible with OpenAI SDK)

Note: This skill uses Volces (火山引擎) ARK API for video analysis. The API is OpenAI-compatible, so we use the OpenAI SDK with a custom base URL.

Quick Start

bash
# Set up API key
export ARK_API_KEY="your_api_key_here"

# Run analysis
python -c "
from scripts.video_analyzer import VideoAnalyzer
result = VideoAnalyzer().analyze_video('demo.mp4', 'general')
print(result['analysis_result']['summary'])
"

Common Use Cases

ScenarioRecommended TypeExample
Quick video overviewgeneral"Analyze this video and give me a summary"
Product demo analysisproduct"Extract features from this app demo"
Test case extractionkey_nodes"Find key moments for QA testing"
UI/UX reviewcustom"Analyze accessibility issues in this video"
Documentationkey_nodes + general"Create documentation from tutorial video"
Competitive analysisproduct"Understand competitor's features"

Analysis Types

TypeUse CaseCommand
generalQuick content overview and summaryanalyze_video(path, "general")
productApp/feature understanding from product perspectiveanalyze_video(path, "product")
key_nodesTimestamped moments for testing/documentationanalyze_video(path, "key_nodes")
customSpecialized analysis with your promptanalyze_with_prompt(path, custom_prompt)

See Analysis Types for detailed usage of each type.

Complete Workflow Example

python
from scripts.video_analyzer import VideoAnalyzer

# Initialize analyzer
analyzer = VideoAnalyzer()

# Example 1: Get video summary
result = analyzer.analyze_video("demo.mp4", "general")
print(result['analysis_result']['summary'])

# Example 2: Extract product features
result = analyzer.analyze_video("app_demo.mp4", "product")
print(f"Product: {result['analysis_result']['product_name']}")
print(f"Features: {result['analysis_result']['key_features']}")

# Example 3: Get key moments for testing
result = analyzer.analyze_video("tutorial.mp4", "key_nodes")
for node in result['analysis_result']['key_nodes']:
    print(f"[{node['timestamp']}] {node['description']}")

See API Reference for complete documentation.

Output Format

All results return structured JSON with analysis_result and metadata.

See Output Guide for quality standards and examples.

Error Handling

Handle common errors: FileNotFoundError, ValueError, RuntimeError.

See Error Handling for detailed troubleshooting.

Configuration

Set environment variable:

bash
# Option 1: Temporary (current session only)
export ARK_API_KEY="your_api_key_here"

# Option 2: Permanent (add to ~/.zshrc)
echo 'export ARK_API_KEY="your_api_key_here"' >> ~/.zshrc
source ~/.zshrc

# Verify it's set
echo $ARK_API_KEY

Optional: Override in VideoAnalyzer constructor with api_key, base_url, or model parameters.