
Volcengine Video Understanding
- 544 installs
- 424 repo stars
- Updated June 8, 2026
- freestylefly/canghe-skills
volcengine-video-understanding is a Claude Code skill that lets coding agents understand, caption, and extract insights from video using Volcengine multimodal models for developers building video-aware automation feature
About
volcengine-video-understanding is a multimodal integration skill from freestylefly/canghe-skills, ranked 8 on Skills.sh with 445 installs. It equips coding agents to analyze video content through Volcengine's models—generating captions, summaries, and structured insights from footage. Developers invoke it when building features that ingest user uploads, surveillance clips, or marketing reels and need programmatic scene or content understanding without standing up a custom vision pipeline. The skill assumes Volcengine API access and fits agent workflows that combine video input with downstream code generation or data extraction.
- Enables Claude, Cursor and other agents to process video files directly
- Returns structured understanding including scene descriptions, objects, actions and timestamps
- Supports both short clips and longer videos through intelligent chunking
- Integrates as a reusable MCP-compatible tool in agent workflows
- Handles video formats commonly used in product demos, tutorials and user-generated content
Volcengine Video Understanding by the numbers
- 544 all-time installs (skills.sh)
- Ranked #1,669 of 16,556 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Jul 31, 2026 (Skillselion catalog sync)
npx skills add https://github.com/freestylefly/canghe-skills --skill volcengine-video-understandingAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 544 |
|---|---|
| repo stars | ★ 424 |
| Last updated | June 8, 2026 |
| Repository | freestylefly/canghe-skills ↗ |
How do agents analyze video with Volcengine APIs?
Let their coding agent understand, caption, and extract insights from video content using Volcengine's multimodal models.
Who is it for?
Developers integrating Volcengine multimodal video APIs into agent workflows for captioning, summarization, or content analysis.
Skip if: Developers needing real-time video streaming infrastructure, custom model training, or non-Volcengine vision providers.
When should I use this skill?
A developer asks to understand, caption, summarize, or extract data from video files using Volcengine multimodal models.
What you get
Video captions, content summaries, and structured insight extracts from Volcengine multimodal responses.
- Video captions
- Content summaries
- Structured insight JSON
By the numbers
- 445 installs on Skills.sh
- Rank 8 in freestylefly/canghe-skills catalog
Files
火山视频理解
使用字节跳动火山方舟视频理解 API(doubao-seed-2-0-pro-260215 等模型)对视频进行深度理解和分析。
推荐方式:Files API 上传 + Responses API 分析
- 支持最大 512MB 视频文件
- 自动视频预处理(FPS采样)
- 文件可重复使用(存储7天)
功能
- 视频上传:通过 Files API 上传本地视频(推荐,最大512MB)
- 内容理解:分析视频场景、人物、动作、情感
- 视频问答:基于视频内容回答用户问题
- 视频描述:自动生成视频描述和摘要
前置要求
需要设置 ARK_API_KEY 环境变量。
配置方式(推荐)
1. 复制配置模板:
cp .canghe-skills/.env.example .canghe-skills/.env2. 编辑 .canghe-skills/.env 文件,填写你的 API Key:
ARK_API_KEY=your-actual-api-key-here或使用环境变量
export ARK_API_KEY="your-api-key"加载优先级
1. 系统环境变量 (process.env) 2. 当前目录 .canghe-skills/.env 3. 用户主目录 ~/.canghe-skills/.env
使用方法
1. 基础视频分析(Files API 方式 - 推荐)
cd ~/.openclaw/workspace/skills/volcengine-video-understanding
python3 scripts/video_understand.py /path/to/video.mp4 "描述这个视频的内容"2. 视频问答
python3 scripts/video_understand.py /path/to/video.mp4 "视频中出现了哪些人物?"3. 情感分析
python3 scripts/video_understand.py /path/to/video.mp4 "分析视频中人物的情感变化"4. 指定模型和帧率
python3 scripts/video_understand.py /path/to/video.mp4 "总结视频要点" \
--model doubao-seed-2-0-pro-260215 \
--fps 25. 保存结果到文件
python3 scripts/video_understand.py /path/to/video.mp4 "描述视频" --output result.json参数说明
| 参数 | 默认值 | 说明 |
|---|---|---|
video_path | 必填 | 视频文件路径 |
instruction | 必填 | 分析指令/问题 |
--model | doubao-seed-2-0-pro-260215 | 模型 ID |
--fps | 1 | 视频采样帧率(预处理) |
--output | - | 结果输出文件路径 |
支持的模型
doubao-seed-2-0-pro-260215(默认)doubao-seed-2-0-lite-250728doubao-seed-1-6-251015- 其他 Seed 系列视频理解模型
分析示例
示例 1:视频内容描述
python3 scripts/video_understand.py ~/Desktop/video.mp4 "详细描述这个视频的内容,包括场景、人物和动作"示例 2:视频摘要
python3 scripts/video_understand.py ~/Desktop/video.mp4 "用3句话总结这个视频的要点"示例 3:动作识别
python3 scripts/video_understand.py ~/Desktop/video.mp4 "视频中的人物在做什么动作?按时间顺序描述"示例 4:场景分析
python3 scripts/video_understand.py ~/Desktop/video.mp4 "分析视频中的场景变化和环境特征"技术细节
调用流程
1. 上传视频:通过 Files API 上传本地视频文件,指定 FPS 预处理配置 2. 等待处理:等待视频预处理完成(状态变为 processed) 3. 创建任务:调用 Responses API 进行视频理解 4. 获取结果:返回分析结果
API 格式
Files API 上传:
curl https://ark.cn-beijing.volces.com/api/v3/files \
-H "Authorization: Bearer $ARK_API_KEY" \
-F 'purpose=user_data' \
-F 'file=@video.mp4' \
-F 'preprocess_configs[video][fps]=1'Responses API 分析:
{
"model": "doubao-seed-2-0-pro-260215",
"input": [
{
"role": "user",
"content": [
{
"type": "input_video",
"file_id": "file-xxxx"
},
{
"type": "input_text",
"text": "用户指令"
}
]
}
]
}FPS 设置建议
| FPS | 适用场景 |
|---|---|
| 0.3-0.5 | 慢节奏视频、静态场景、节省token |
| 1 | 一般视频分析(默认) |
| 2-3 | 快速动作、细节分析 |
限制
- 视频格式:MP4(推荐)、MOV、AVI
- 文件大小:最大 512MB(Files API 方式)
- 存储时间:上传的文件默认存储 7 天
- 处理时间:根据视频长度和复杂度,通常 10-60 秒
Python API 使用
from scripts.video_understand import analyze_video
result = analyze_video(
file_path="/path/to/video.mp4",
instruction="描述视频内容",
model="doubao-seed-2-0-pro-260215",
fps=1
)
# 提取回答
text = ""
for item in result.get("output", []):
if item.get("type") == "message":
for content in item.get("content", []):
if content.get("type") == "output_text":
text = content.get("text", "")
break
print(text)错误处理
常见错误及解决方案:
| 错误 | 原因 | 解决方案 |
|---|---|---|
| API Key 错误 | 未设置或错误 | 检查 ARK_API_KEY 环境变量 |
| 文件不存在 | 路径错误 | 检查文件路径 |
| 上传失败 | 文件过大或格式不支持 | 检查文件大小(<512MB)和格式 |
| 处理超时 | 视频过长或复杂 | 缩短视频或降低 FPS |
参考文档
#!/usr/bin/env python3
"""
火山视频理解工具
使用火山方舟视频理解 API 分析视频内容
"""
import os
import sys
import json
import time
import argparse
import requests
from pathlib import Path
from typing import Optional
# 添加 common 模块到路径
COMMON_DIR = Path(__file__).parent.parent.parent / "common"
sys.path.insert(0, str(COMMON_DIR))
# 导入环境变量工具
try:
from env_utils import load_env, require_env_key
except ImportError:
print("错误: 无法加载 env_utils 模块", file=sys.stderr)
sys.exit(1)
# 加载环境变量
load_env()
# API 配置
API_KEY = None # 将通过 get_api_key() 获取
BASE_URL = "https://ark.cn-beijing.volces.com/api/v3"
DEFAULT_MODEL = "doubao-seed-2-0-pro-260215"
DEFAULT_FPS = 1
def get_api_key():
"""获取 API Key"""
return require_env_key("ARK_API_KEY")
def upload_video_file(api_key: str, file_path: str, fps: int = 1) -> str:
"""
使用 Files API 上传视频文件,支持预处理配置
Args:
api_key: API 密钥
file_path: 本地视频文件路径
fps: 视频采样帧率(默认 1)
Returns:
file_id: 上传后的文件 ID
"""
headers = {
"Authorization": f"Bearer {api_key}"
}
try:
# 使用 requests 的 multipart 上传,包含预处理配置
with open(file_path, "rb") as f:
files = {
"file": (os.path.basename(file_path), f, "video/mp4"),
"purpose": (None, "user_data")
}
# 添加预处理配置 - FPS
data = {
"preprocess_configs[video][fps]": str(fps)
}
response = requests.post(
f"{BASE_URL}/files",
headers=headers,
files=files,
data=data,
timeout=120
)
print(f"上传响应状态: {response.status_code}")
if response.status_code != 200:
print(f"响应内容: {response.text[:500]}")
response.raise_for_status()
result = response.json()
if result.get("id"):
return result["id"]
else:
raise Exception(f"上传失败: {result}")
except Exception as e:
raise Exception(f"上传文件失败: {e}")
def create_video_understanding_task(
api_key: str,
model: str,
file_id: str,
instruction: str,
fps: int = 1
) -> dict:
"""
创建视频理解任务 - 使用 Responses API 和 Files API file_id
Args:
api_key: API 密钥
model: 模型 ID
file_id: Files API 上传后的文件 ID
instruction: 用户指令/问题
fps: 帧率(默认 1)
Returns:
任务创建结果
"""
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {api_key}"
}
# 使用 Responses API 格式,引用 file_id
payload = {
"model": model,
"input": [
{
"role": "user",
"content": [
{
"type": "input_video",
"file_id": file_id
},
{
"type": "input_text",
"text": instruction
}
]
}
]
}
try:
print(f"使用 Responses API,文件 ID: {file_id}")
response = requests.post(
f"{BASE_URL}/responses",
headers=headers,
json=payload,
timeout=300
)
if response.status_code != 200:
print(f"错误响应: {response.text[:1000]}")
response.raise_for_status()
return response.json()
except Exception as e:
raise Exception(f"创建任务失败: {e}")
def wait_for_file_processing(api_key: str, file_id: str, max_wait: int = 180) -> dict:
"""
等待文件处理完成
Args:
api_key: API 密钥
file_id: 文件 ID
max_wait: 最大等待时间(秒)
Returns:
文件信息
"""
headers = {"Authorization": f"Bearer {api_key}"}
start_time = time.time()
print("⏳ 等待视频预处理完成...")
check_count = 0
while time.time() - start_time < max_wait:
response = requests.get(
f"{BASE_URL}/files/{file_id}",
headers=headers,
timeout=30
)
result = response.json()
status = result.get("status", "unknown")
check_count += 1
# 每10次检查打印一次状态
if check_count % 10 == 0:
print(f" 状态: {status} ({int(time.time() - start_time)}s)...", end="\r", flush=True)
# active 或 processed 状态都可以使用
if status in ["active", "processed"]:
print(f"\n✅ 视频预处理完成 (状态: {status}, 耗时: {int(time.time() - start_time)}s)")
return result
elif status == "error":
raise Exception(f"文件处理失败: {result}")
time.sleep(2)
# 超时但如果是 active 状态,也尝试继续
print(f"\n⚠️ 等待超时,但文件状态为 {status},尝试继续...")
return result
def analyze_video(
file_path: str,
instruction: str,
model: str = DEFAULT_MODEL,
fps: int = DEFAULT_FPS,
wait: bool = True
) -> dict:
"""
分析视频内容 - 使用 Files API 上传(推荐方式)
Args:
file_path: 视频文件路径
instruction: 用户指令/问题
model: 模型 ID
fps: 帧率
wait: 是否等待完成
Returns:
分析结果
"""
api_key = get_api_key()
# 检查文件
if not os.path.exists(file_path):
raise FileNotFoundError(f"文件不存在: {file_path}")
file_size = os.path.getsize(file_path) / 1024 / 1024
print(f"📁 视频文件: {file_path}")
print(f"📦 文件大小: {file_size:.1f} MB")
print(f"🤖 使用模型: {model}")
print(f"🎬 FPS: {fps}")
print(f"📝 指令: {instruction}")
print()
# 步骤 1: 使用 Files API 上传视频
print("☁️ 使用 Files API 上传视频...")
file_id = upload_video_file(api_key, file_path, fps)
print(f"✅ 上传成功,文件ID: {file_id}")
print()
# 步骤 2: 等待文件处理完成
wait_for_file_processing(api_key, file_id)
print()
# 步骤 3: 创建理解任务
print("🧠 分析视频内容...")
print("⏳ 这可能需要一些时间,请耐心等待...")
print()
result = create_video_understanding_task(
api_key=api_key,
model=model,
file_id=file_id,
instruction=instruction,
fps=fps
)
return result
def main():
parser = argparse.ArgumentParser(
description="火山视频理解 - 分析视频内容",
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog="""
示例:
# 基础分析
python3 video_understand.py /path/to/video.mp4 "描述这个视频的内容"
# 指定模型和帧率
python3 video_understand.py /path/to/video.mp4 "总结视频要点" --model doubao-seed-2-0-pro-260215 --fps 2
# 详细分析
python3 video_understand.py /path/to/video.mp4 "分析视频中的人物情感和动作" --fps 1
"""
)
parser.add_argument("video_path", help="视频文件路径")
parser.add_argument("instruction", help="分析指令/问题")
parser.add_argument("--model", default=DEFAULT_MODEL, help=f"模型ID (默认: {DEFAULT_MODEL})")
parser.add_argument("--fps", type=int, default=DEFAULT_FPS, help=f"帧率 (默认: {DEFAULT_FPS})")
parser.add_argument("--output", "-o", help="输出结果到文件")
args = parser.parse_args()
try:
# 执行分析
result = analyze_video(
file_path=args.video_path,
instruction=args.instruction,
model=args.model,
fps=args.fps
)
# 格式化输出
print("\n" + "="*60)
print("📊 分析结果")
print("="*60)
# 提取回答内容 - Responses API 格式
content = ""
if "output" in result:
# Responses API 格式
for item in result.get("output", []):
if item.get("type") == "message":
for content_item in item.get("content", []):
if content_item.get("type") == "output_text":
content = content_item.get("text", "")
break
elif "choices" in result and len(result["choices"]) > 0:
# Chat API 格式(兼容)
content = result["choices"][0].get("message", {}).get("content", "")
if content:
print(content)
else:
print(json.dumps(result, indent=2, ensure_ascii=False))
# 保存到文件
if args.output:
with open(args.output, 'w', encoding='utf-8') as f:
json.dump(result, f, indent=2, ensure_ascii=False)
print(f"\n💾 结果已保存: {args.output}")
print("\n✅ 分析完成!")
except Exception as e:
print(f"\n❌ 错误: {e}", file=sys.stderr)
sys.exit(1)
if __name__ == "__main__":
main()
Related skills
FAQ
What does volcengine-video-understanding extract from video?
volcengine-video-understanding uses Volcengine multimodal models so coding agents can caption footage, summarize scenes, and return structured insights from video content.
How popular is volcengine-video-understanding on Skills.sh?
volcengine-video-understanding shows 445 installs and rank 8 on Skills.sh under freestylefly/canghe-skills among video AI integration skills.