
Byted Las Long Video Understand
- 18 installs
- 411 repo stars
- Updated August 4, 2026
- bytedance/agentkit-samples
byted-las-long-video-understand is a Claude skill that wraps Volcengine LAS to run LLM-based deep understanding of long videos up to 3 hours and produce summaries, chapters and video Q&A.
About
This skill wraps the Volcengine LAS long-video-understanding operator through the lasutil CLI so an agent can analyze long-form videos. A developer uses it to summarize meeting recordings, lectures or webinars, extract chapters and key moments, and ask questions about video content. It runs an async submit-then-poll workflow and requires a LAS_API_KEY, with token-based billing that cannot be precisely pre-estimated.
- Wraps the Volcengine LAS las_long_video_understand operator for LLM-based deep video comprehension
- Handles long videos up to 3 hours / 10GB via an async submit-poll workflow
- Generates summaries, chapter breakdowns, event timelines and answers questions about video content
Byted Las Long Video Understand by the numbers
- 18 all-time installs (skills.sh)
- Ranked #1,005 of 1,335 Generative Media skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
byted-las-long-video-understand capabilities & compatibility
Requires a Volcengine LAS_API_KEY; billed per token by video length and complexity, not free.
- Capabilities
- video analysis · video summarization · video qa
- Use cases
- video generation · transcription · research
- Pricing
- Bring your own API key
What byted-las-long-video-understand says it does
基于大模型提供多维度、精细化的视频结构化理解。支持小时级(最大 3h)视频的全局理解、事件与行为识别、视频问答、高效摘要及结构化输出。
**环境变量**: `LAS_API_KEY` (必填)
本 skill 按 token 计费,由于视频长且分析复杂,提交前无法精确预估费用。
npx skills add https://github.com/bytedance/agentkit-samples --skill byted-las-long-video-understandAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 18 |
|---|---|
| repo stars | ★ 411 |
| Last updated | August 4, 2026 |
| Repository | bytedance/agentkit-samples ↗ |
What it does
Analyze and summarize long videos up to 3h/10GB and answer questions about their content using Volcengine LAS models.
Who is it for?
Summarizing long meeting recordings, lectures, webinars or movies and extracting chapters, timelines and answers about their content.
Skip if: Short clips or tasks needing precise upfront cost estimates, since billing is token-based and cannot be pre-estimated.
When should I use this skill?
The user wants to analyze or summarize a long video (up to 3h/10GB), extract chapters or key moments, or ask questions about video content.
What you get
Returns a structured video summary with chapters, event timeline, key moments and answers to questions about the footage.
- video final_summary
- chapter and event timeline
- key-moment clips
By the numbers
- supports videos up to 3 hours and 10GB
- 6-step submit-poll workflow (Step 0 to Step 5)
Files
LAS 视频精细理解(las_long_video_understand)
基于大模型提供多维度、精细化的视频结构化理解。支持小时级(最大 3h)视频的全局理解、事件与行为识别、视频问答、高效摘要及结构化输出。
设计模式
本 skill 主要采用:
- Tool Wrapper:封装
lasutilCLI 调用 - Pipeline:包含 Step 0 → Step N 的顺序工作流
核心 API 与配置
- 算子 ID:
las_long_video_understand - API: 异步(
submit→poll) - 环境变量:
LAS_API_KEY(必填) - 支持时长: 最大支持 3h (10G) 视频。
详细参数与接口定义见 references/api.md。
Gotchas
- 不可精确预估:按 Token 计费,受视频时长和复杂度影响极大。
- 密钥安全:若聊天框屏蔽密钥,让用户在当前目录创建
env.sh并写入export LAS_API_KEY="...",SDK 会自动读取。 - 免责声明:最终回复结果时必须包含:"本方式的计费均为预估计费,与实际费用有差距,实际费用以运行后火山产生的账单为准。计费说明请参考 Volcengine LAS 定价。",且禁止使用"实际费用"字眼描述预估价。
工作流(严格按步骤执行)
复制此清单并跟踪进度:
执行进度:
- [ ] Step 0: 前置检查
- [ ] Step 1: 初始化与准备
- [ ] Step 2: 预估价格
- [ ] Step 3: 提交异步任务
- [ ] Step 4: 轮询任务状态
- [ ] Step 5: 结果呈现Step 0: 前置检查(⚠️ 必须在第一轮对话中完成)
在接受用户的任务后,不要立即开始执行,必须首先进行以下环境检查: 1. 检查 `LAS_API_KEY` 与 `LAS_REGION`:确认环境变量或 .env 中是否已配置。
- 若无,必须立即向用户索要(提示:
LAS_REGION常见为cn-beijing)。 - 注意:
LAS_REGION必须与您的 API Key 及 TOS Bucket 所在的地域完全一致。如果用户中途切换了 Region,必须提醒用户其 TOS Bucket 也需对应更换,否则会导致权限异常或上传失败。
2. 检查输入路径:
- 如果用户要求处理的是本地文件,则需要先通过 File API 上传至 TOS(只需
LAS_API_KEY,无需额外 TOS 凭证)。 - 如果算子的输出结果存放在 TOS 上,且用户需要下载回本地,则需要
VOLCENGINE_ACCESS_KEY和VOLCENGINE_SECRET_KEY。对于仅需要上传输入文件的场景,TOS 凭证不再必须。
3. 确认无误后:才能进入下一步。
Step 1: 初始化与准备
环境初始化(Agent 必做):
# 执行统一的环境初始化与更新脚本(会自动创建/激活虚拟环境,并检查更新)
source "$(dirname "$0")/scripts/env_init.sh" las_long_video_understand
workdir=$LAS_WORKDIR如果网络问题导致更新失败,脚本会跳过检查,使用本地已安装的 SDK 继续执行。
- 处理本地文件时:先本地检查格式和时长,预估价格,用户确认后再上传:
# 提前检查视频格式(避免参数错误)
./scripts/check_format.sh <local_path>
# 本地使用 ffprobe 获取时长(无需上传即可预估价格)
duration_sec=$(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:noprint_section=1 <local_path>)计算预估价格并等待用户确认后,再执行上传:
# 用户确认后,上传到 TOS
lasutil file-upload <local_path>上传成功后返回 JSON,取其中的 tos_uri(格式 tos://bucket/key)传给算子作为输入路径。
Step 2: 预估价格(⚠️ 必须获得用户确认)
本 skill 按 token 计费,由于视频长且分析复杂,提交前无法精确预估费用。
1. 查阅 references/prices.md 的说明。 2. 说明此任务产生的 token 量可能会非常大(特别是对于长视频)。 3. 将计费单价告知用户并强制暂停执行,明确等待用户回复确认。在用户明确回复"继续"、"确认"等同意指令前,绝对禁止进入下一步(执行/提交任务)。提示:预估仅供参考,实际以火山账单为准。计费说明请参考 Volcengine LAS 定价。
Step 3: 提交异步任务 (Submit)
构造 data.json:
{
"video_url": "<url>",
"query": "请总结这个视频的主要内容",
"fps": 1.0,
"model_name": "doubao-seed-2-0-lite-260215"
}执行命令:
data=$(cat "$workdir/data.json")
lasutil submit las_long_video_understand "$data" > "$workdir/submit.json"
task_id=$(cat "$workdir/submit.json" | jq -r '.metadata.task_id')
echo "Task ID: $task_id"Step 4: 轮询任务状态 (Poll)
# 获取任务状态
lasutil poll las_long_video_understand "$task_id" > "$workdir/poll.json"
cat "$workdir/poll.json" | jq -r '.metadata.task_status'- 如果状态是
PENDING或RUNNING,等待一段时间后再次执行上述命令。由于是长视频理解,耗时可能较长。 - 如果状态是
COMPLETED,继续 Step 5。 - 如果状态是
FAILED,向用户报告错误error_msg。
Step 4: 异步查询 (Poll)
⚠️ 异步任务与后台轮询约束:
- 如果环境支持后台任务,可以使用优化后的后台轮询脚本自动轮询直到完成:
mkdir -p "./output/${task_id}"
./scripts/poll_background.sh ${task_id} "./output/${task_id}" & disown脚本特性:
- 动态间隔:前 5 次 30s,5-10 次 60s,10 次后 120s
- 完成标记:生成
COMPLETED标记文件 - 适合长视频理解这类耗时较长的任务
- 如果环境不支持后台任务,手动轮询:
# 获取任务状态
lasutil poll las_long_video_understand "$task_id" > "$workdir/poll.json"
cat "$workdir/poll.json" | jq -r '.metadata.task_status'- 如果状态是
PENDING或RUNNING,等待一段时间后再次执行上述命令。由于是长视频理解,耗时可能较长。 - 如果状态是
COMPLETED,继续 Step 5。 - 如果状态是
FAILED,向用户报告错误error_msg。
Step 5: 结果呈现
处理结果:
使用脚本自动生成结果展示(自动包含计费声明):
./scripts/generate_result.md.sh ${task_id} "./output/${task_id}" <estimated_price>手动处理:
# 解析最终摘要
cat "$workdir/poll.json" | jq -r '.data.final_summary'
# 可选:保存 clips 详情到本地
cat "$workdir/poll.json" | jq '.data.clips' > "./output/${task_id}/clips_detail.json"向用户展示: 1. 使用生成的 markdown 展示 2. 呈现视频的 final_summary(最终摘要) 3. 如果有精彩片段问答或特定 query 回答,结合 clips 提取并展示 4. 自动包含计费声明 ✅
byted-las-long-video-understand 自检清单(Skill Hub)
- SKILL.md 顶部包含 YAML frontmatter(name/description)
- 文档不包含任何真实密钥、Token、Cookie(只引用
LAS_API_KEY环境变量名) - 文档包含预估价格步骤,且 references/prices.md 提供单价说明
- 推荐流程为 submit + 短轮询 poll,不包含阻塞等待示例
- 批处理示例包含 tos-ls、batch-submit、batch-poll,并强调
--max-seconds以避免 openclaw 阻塞 - 大批量支持在 workdir 下按 batch_001/batch_002 分批隔离 inputs/data/state
- 常见问题包含 openclaw
task_id 为 null、$RANDOM不可用等环境差异 - skill 目录内不包含临时文件(如
__pycache__、.DS_Store、大体积输出文件)
{
"skill_name": "byted-las-long-video-understand",
"evals": [
{
"id": 1,
"prompt": "我有一个两小时的长视频 test.mp4,我想提取它的全文摘要和各个章节的重点,请用 Python 脚本实现。",
"expected_output": "包含 las_sdk.file.upload 将文件上传至 TOS 的步骤,使用 client.media.process 调用 byted-las-long-video-understand 技能,并获取返回结果中的章节列表和摘要。"
},
{
"id": 2,
"prompt": "我有一个 TOS 上的会议视频 tos://bucket/meeting.mp4,我需要提问:这个视频里主要讨论了哪些产品的发版计划?请给出代码。",
"expected_output": "包含调用 client.media.process 并在 data 中配置 qa_list 参数的示例代码。"
},
{
"id": 3,
"prompt": "如果我需要长视频的高光片段提取,该如何配置 data.json?",
"expected_output": "说明需要在调用时启用 highlights_extraction 或者配置相关分析任务的字段。"
}
]
}# Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
las_long_video_understand API 参考
las_long_video_understand 为异步算子:先 submit 获取 task_id,再 poll 轮询直到 COMPLETED/FAILED。
Base / Region
- API Base:
https://operator.las.<region>.volces.com/api/v1 - Region:
cn-beijingcn-shanghai
鉴权:Authorization: Bearer $LAS_API_KEY
Submit 请求体
| 字段名 | 类型 | 是否必选 | 说明 |
|---|---|---|---|
| operator_id | string | 是 | 固定为 las_long_video_understand(CLI 自动填充) |
| operator_version | string | 是 | 固定为 v1(CLI 自动填充) |
| data | long_video_understand | 是 | `data.json` 的内容对应此字段,详情见下表 |
data 参数 (long_video_understand)
| 字段名 | 类型 | 是否必选 | 说明 |
|---|---|---|---|
| video_url | string | 是 | 视频 URL(http/https 或 tos://) |
| query | string | 否 | 视频理解的查询,例如 "请总结这个视频的主要内容" |
| fps | float | 否 | 抽帧率 |
| media_resolution | string | 否 | 媒体分辨率 |
| model_name | string | 否 | 默认使用的模型名称,如 "doubao-seed-2-0-lite-260215" |
| reasoning_effort | string | 否 | 推理消耗程度 |
| clip_context | string | 否 | 片段上下文 |
Poll 响应结构 (data 对象)
COMPLETED 状态下,data 包含以下核心字段:
| 字段名 | 类型 | 说明 |
|---|---|---|
| final_summary | string | 视频的最终总结 |
| video_duration | float | 视频总时长 |
| resolution | string | 视频分辨率 |
| total_clips | int | 总片段数 |
| clips | list | 包含每个视频片段的详情,如 clip_id, start_time, end_time, duration, answer 等 |
| token_usages | list | 各模型的 token 消耗统计 |
LAS 视频精细理解(las_long_video_understand)计费说明
该算子主要通过底层的豆包视觉模型(如 doubao-seed-2-0-lite 等)进行推理,计费基于 Token 消耗。
主要计费项:
- 输入 Token (Prompt Tokens):视频抽帧处理后的图片、音频转文本、以及用户文本 prompt。
- 输出 Token (Completion Tokens):模型生成的文本结果。
由于视频长度、抽帧率、分析复杂度不同,Token 消耗量差异极大,无法在提交前精确预估最终费用。
请注意:本方式的计费均为预估计费,与实际费用有差距,实际费用以运行后火山引擎产生的账单为准。
#!/bin/bash
# ==============================================================================
# 视频格式预检查
# Usage: scripts/check_format.sh <file_path>
# ==============================================================================
FILE_PATH="$1"
if [ -z "$FILE_PATH" ]; then
echo "❌ 错误: 请提供文件路径"
exit 1
fi
# 获取文件扩展名并转小写
EXT=$(echo "$FILE_PATH" | awk -F. '{print tolower($NF)}')
# 允许的视频格式
ALLOWED_FORMATS="mp4 wmv avi mkv mov flv webm mpg mpeg"
if [[ " $ALLOWED_FORMATS " =~ " $EXT " ]]; then
echo "✅ 格式检查通过: $EXT"
exit 0
else
echo "⚠️ 警告: 文件扩展名 '$EXT' 不在推荐格式列表中"
echo " 推荐格式: $ALLOWED_FORMATS"
echo " 请确认输入格式正确"
exit 1
fi
#!/bin/bash
# ==============================================================================
# LAS SDK & Skill 环境初始化与更新脚本
# 用法: source scripts/env_init.sh <operator_id>
# ==============================================================================
OPERATOR_ID=$1
if [ -z "$OPERATOR_ID" ]; then
echo "❌ 错误: 必须提供 operator_id"
return 1 2>/dev/null || exit 1
fi
# 1. 虚拟环境隔离
# Find project root dynamically, then check for .las_venv
# skill structure: <project_root>/skills/<skill>/scripts/env_init.sh
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "${SCRIPT_DIR}/../../.." && pwd)"
# 优先复用项目根目录的虚拟环境,不存在才创建新的
if [ -d "${PROJECT_ROOT}/.las_venv" ]; then
source "${PROJECT_ROOT}/.las_venv/bin/activate"
elif [ ! -d ".las_venv" ]; then
python3 -m venv .las_venv
source .las_venv/bin/activate
else
source .las_venv/bin/activate
fi
# 2. 获取远程 manifest
manifest_url="https://las-ai-cn-beijing-online.tos-cn-beijing.volces.com/operator_cards_serving/public/skills/sdk/manifest.json"
manifest=$(curl -sf "$manifest_url" || echo '{}')
# 3. 比较 SDK 版本并自动更新
local_ver=$(lasutil --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' || echo "0.0.0")
remote_ver=$(echo "$manifest" | jq -r '.sdk_version // "unknown"')
if [ "$local_ver" = "0.0.0" ] || [ "$local_ver" != "$remote_ver" ]; then
echo "📦 SDK 更新: $local_ver → $remote_ver,正在安装..."
pip install --quiet --upgrade https://las-ai-cn-beijing-online.tos-cn-beijing.volces.com/operator_cards_serving/public/skills/sdk/las_sdk-0.2.0-py3-none-any.whl
fi
# 4. 检查当前算子的参数变更
op_changes=$(echo "$manifest" | jq -r ".operators.${OPERATOR_ID}.changes_since // {} | to_entries[] | \" 自 \(.key) 起: \(.value[])\"" 2>/dev/null)
if [ -n "$op_changes" ]; then
echo "⚠️ 算子 ${OPERATOR_ID} 有参数更新:"
echo "$op_changes"
echo "建议使用 find-skills 检索并更新此 skill 到最新版本。"
fi
# 5. 初始化工作目录
export LAS_WORKDIR=$(mktemp -d /tmp/las_work_XXXXXX)
echo "✅ 环境初始化完成,工作目录: $LAS_WORKDIR"
#!/bin/bash
# ==============================================================================
# 生成结果展示 markdown 模板,自动包含计费声明
# Usage: scripts/generate_result.md.sh <task_id> <output_dir> <estimated_price>
# ==============================================================================
TASK_ID="$1"
OUTPUT_DIR="$2"
ESTIMATED_PRICE="$3"
if [ -z "$TASK_ID" ] || [ -z "$OUTPUT_DIR" ]; then
echo "❌ 错误: 参数不全"
exit 1
fi
STATUS=$(cat "${OUTPUT_DIR}/COMPLETED" 2>/dev/null || echo "UNKNOWN")
cat <<EOF
# 长视频理解结果
## 任务信息
- **任务 ID**: \`${TASK_ID}\`
- **最终状态**: \`${STATUS}\`
EOF
if [ -n "$ESTIMATED_PRICE" ]; then
cat <<EOF
- **预估计费**: ${ESTIMATED_PRICE} 元
EOF
fi
if [ -f "${OUTPUT_DIR}/result.json" ]; then
cat <<EOF
## 分析结果
请查看完整结果在: \`${OUTPUT_DIR}/\`
EOF
fi
cat <<'EOF'
---
本方式的计费均为预估计费,与实际费用有差距,实际费用以运行后火山产生的账单为准。计费说明请参考 [Volcengine LAS 定价](https://www.volcengine.com/docs/6492/1544808)。
EOF
#!/bin/bash
# ==============================================================================
# 后台轮询脚本 - 动态间隔
# Usage: scripts/poll_background.sh <task_id> [output_dir]
# ==============================================================================
TASK_ID="$1"
OUTPUT_DIR="${2:-output/${TASK_ID}}"
if [ -z "$TASK_ID" ]; then
echo "❌ 错误: 请提供 task_id"
exit 1
fi
# 加载环境
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "${SCRIPT_DIR}/../../.." && pwd)"
if [ -f "${PROJECT_ROOT}/.env" ]; then
source "${PROJECT_ROOT}/.env"
export LAS_API_KEY LAS_REGION
fi
# 激活虚拟环境
if [ -d "${PROJECT_ROOT}/.las_venv" ]; then
source "${PROJECT_ROOT}/.las_venv/bin/activate"
fi
OPERATOR_ID="las_long_video_understand"
mkdir -p "${OUTPUT_DIR}"
echo "$(date): Starting background polling for task ${TASK_ID}" >> "${OUTPUT_DIR}/poll.log"
# 轮询计数,用于动态调整间隔
ATTEMPT=0
# Poll until terminal state
while true; do
((ATTEMPT++))
# 动态调整轮询间隔:
# - 前 5 次: 60秒
# - 5-10 次: 120秒
# - 10次之后: 300秒(长视频理解时间更长)
if [ $ATTEMPT -le 5 ]; then
SLEEP=60
elif [ $ATTEMPT -le 10 ]; then
SLEEP=120
else
SLEEP=300
fi
# Save full response first, then extract status
FULL_OUTPUT=$(lasutil poll "${OPERATOR_ID}" "${TASK_ID}")
echo "$FULL_OUTPUT" > "${OUTPUT_DIR}/last_poll.json"
# Extract status
STATUS=$(echo "$FULL_OUTPUT" | python3 -c "
import json
import sys
try:
data = json.load(sys.stdin)
print(data['metadata']['task_status'])
except Exception as e:
print('ERROR')
")
echo "$(date): Attempt $ATTEMPT, status = ${STATUS}, next poll in ${SLEEP}s" >> "${OUTPUT_DIR}/poll.log"
if [ "$STATUS" = "COMPLETED" ] || [ "$STATUS" = "FAILED" ] || [ "$STATUS" = "TIMEOUT" ] || [ "$STATUS" = "CANCELED" ]; then
# Save final result
echo "$FULL_OUTPUT" > "${OUTPUT_DIR}/result.json"
# Create completion flag
echo "$STATUS" > "${OUTPUT_DIR}/COMPLETED"
echo "$(date): Poll completed, final status = ${STATUS}" >> "${OUTPUT_DIR}/poll.log"
exit 0
fi
sleep "$SLEEP"
done
Related skills
FAQ
How long a video can this skill handle?
It supports videos up to 3 hours and 10GB in size.
What credentials are required?
It requires the LAS_API_KEY environment variable, and it is billed by token so cost cannot be precisely pre-estimated.