Communitygithub.com

JantonioFC/skillsbank

视频和音频的感知、索引与编辑。支持摄取文件/URL/直播流,构建视觉/语音索引,按时间戳搜索,编辑时间线,添加叠加/字幕,生成媒体,并创建实时告警。

skillsbank 是什么?

此技能专为需要处理视频和音频数据的 AI 助手(如 Claude Code、Cursor 等)设计,提供全面的感知、索引、搜索和编辑能力。它支持从文件、URL、桌面会话或 RTSP 直播源摄取内容,并自动构建视觉、语音和关键词索引,以便通过时间戳进行精确搜索和证据回放。技能的核心功能包括:桌面会话的录制与实时告警、视频转码与流式播放、基于时间线的编辑(字幕生成/翻译/烧录、叠加文本/图片/音乐、配音)、以及基于直播流的实时视觉和语音监控。使用前需要安装 VideoDB Python SDK 并配置 API 密钥,所有媒体处理操作(如剪辑、转码、字幕添加)均由 VideoDB 服务端完成,建议避免使用 ffmpeg 等本地工具。技能还提供了详细的错误处理指南和常见陷阱说明,帮助开发者高效、可靠地集成视频工作流。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/JantonioFC/skillsbank/tree/HEAD/plugins/antigravity-awesome-skills-claude/skills/videodb

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

VideoDB 技能

感知 + 记忆 + 动作,适用于视频、直播流和桌面会话。

当您需要以下功能时使用此技能:

使用场景

  • 您需要视频或音频的感知、索引、搜索或时间线编辑,涉及文件、URL、桌面会话或直播流。
  • 任务涉及时间戳、可搜索的证据、字幕、剪辑、叠加或实时监控告警。
  • 您希望一个工作流能同时处理摄取、理解、检索和媒体操作。

1) 桌面感知

  • 启动/停止桌面会话,捕获屏幕、麦克风和系统音频
  • 流式传输实时上下文并存储情景会话记忆
  • 在对话和屏幕内容上运行实时告警/触发器
  • 生成会话摘要、可搜索的时间线和可播放的证据链接

2) 视频摄取 + 流媒体

  • 摄取文件或 URL 并返回可播放的网页流链接
  • 转码/标准化:编解码器、比特率、帧率、分辨率、宽高比

3) 索引 + 搜索(时间戳 + 证据)

  • 构建视觉、语音和关键词索引
  • 搜索并返回带有时间戳和可播放证据的精确时刻
  • 从搜索结果自动创建剪辑

4) 时间线编辑 + 生成

  • 字幕:生成、翻译、烧录
  • 叠加:文本/图像/品牌、动态字幕
  • 音频:背景音乐、旁白、配音
  • 通过时间线操作进行程序化合成与导出

5) 直播流(RTSP)+ 监控

  • 连接 RTSP/直播源
  • 运行实时视觉和语音理解,为监控工作流发出事件/告警

常见输入

  • 本地文件路径、公共 URL 或 RTSP URL
  • 桌面捕获请求:开始 / 停止 / 总结会话
  • 所需操作:获取理解上下文、转码规格、索引规格、搜索查询、剪辑范围、时间线编辑、告警规则

常见输出

  • 流 URL
  • 带有时间戳和证据链接的搜索结果
  • 生成的资产:字幕、音频、图像、剪辑
  • 直播流的事件/告警负载
  • 桌面会话摘要和记忆条目

规范提示(示例)

  • "开始桌面捕获,并在密码字段出现时发出告警。"
  • "录制我的会话,并在结束时生成可操作的摘要。"
  • "摄取此文件并返回可播放的流链接。"
  • "索引此文件夹,找到所有包含人物的场景,返回时间戳。"
  • "生成字幕,烧录进去,并添加轻量背景音乐。"
  • "连接此 RTSP URL,并在有人进入区域时发出告警。"

运行 Python 代码

在运行任何 VideoDB 代码之前,请切换到项目目录并加载环境变量:

from dotenv import load_dotenv
load_dotenv(".env")

import videodb
conn = videodb.connect()

这会从以下位置读取 VIDEO_DB_API_KEY:

  1. 环境变量(如果已导出)
  2. 当前目录项目的 .env 文件

如果密钥缺失,videodb.connect() 会自动引发 AuthenticationError。

当简短的命令行足够时,不要编写脚本文件。

当编写内联 Python(python -c "...")时,始终使用格式正确的代码 — 使用分号分隔语句并保持可读性。对于超过约 3 条语句的代码,改用 heredoc:

python << 'EOF'
from dotenv import load_dotenv
load_dotenv(".env")

import videodb
conn = videodb.connect()
coll = conn.get_collection()
print(f"视频数量: {len(coll.get_videos())}")
EOF

设置

当用户要求“设置 videodb”或类似内容时:

1. 安装 SDK

pip install "videodb[capture]" python-dotenv

如果在 Linux 上 videodb[capture] 安装失败,请不带 capture 额外安装:

pip install videodb python-dotenv

2. 配置 API 密钥

用户必须使用以下任一方法设置 VIDEO_DB_API_KEY:

  • 在终端中导出(在启动 Claude 之前):export VIDEO_DB_API_KEY=your-key
  • 项目 .env 文件:将 VIDEO_DB_API_KEY=your-key 保存在项目的 .env 文件中

在 https://console.videodb.io 获取免费 API 密钥(50 次免费上传,无需信用卡)。

不要自己读取、写入或处理 API 密钥。始终让用户设置它。

快速参考

上传媒体

# URL
video = coll.upload(url="https://example.com/video.mp4")

# YouTube
video = coll.upload(url="https://www.youtube.com/watch?v=VIDEO_ID")

# 本地文件
video = coll.upload(file_path="/path/to/video.mp4")

转录 + 字幕

# force=True 可在视频已索引时跳过错误
video.index_spoken_words(force=True)
text = video.get_transcript_text()
stream_url = video.add_subtitle()

在视频内搜索

from videodb.exceptions import InvalidRequestError

video.index_spoken_words(force=True)

# search() 在未找到结果时引发 InvalidRequestError。
# 始终用 try/except 包装,并将“未找到结果”视为空。
try:
    results = video.search("product demo")
    shots = results.get_shots()
    stream_url = results.compile()
except InvalidRequestError as e:
    if "No results found" in str(e):
        shots = []
    else:
        raise

场景搜索

import re
from videodb import SearchType, IndexType, SceneExtractionType
from videodb.exceptions import InvalidRequestError

# index_scenes() 没有 force 参数 — 如果场景索引已存在,它会引发错误。
# 从错误中提取现有的索引 ID。
try:
    scene_index_id = video.index_scenes(
        extraction_type=SceneExtractionType.shot_based,
        prompt="描述此场景中的视觉内容。",
    )
except Exception as e:
    match = re.search(r"id\s+([a-f0-9]+)", str(e))
    if match:
        scene_index_id = match.group(1)
    else:
        raise

# 使用 score_threshold 过滤低相关性噪音(推荐:0.3 以上)
try:
    results = video.search(
        query="在白板上写字的人",
        search_type=SearchType.semantic,
        index_type=IndexType.scene,
        scene_index_id=scene_index_id,
        score_threshold=0.3,
    )
    shots = results.get_shots()
    stream_url = results.compile()
except InvalidRequestError as e:
    if "No results found" in str(e):
        shots = []
    else:
        raise

时间线编辑

重要: 在构建时间线之前,始终验证时间戳:

  • start 必须 >= 0(负值会被静默接受,但会产生损坏的输出)
  • start 必须 < end
  • end 必须 <= video.length
from videodb.timeline import Timeline
from videodb.asset import VideoAsset, TextAsset, TextStyle

timeline = Timeline(conn)
timeline.add_inline(VideoAsset(asset_id=video.id, start=10, end=30))
timeline.add_overlay(0, TextAsset(text="剧终", duration=3, style=TextStyle(fontsize=36)))
stream_url = timeline.generate_stream()

转码视频(分辨率/质量更改)

from videodb import TranscodeMode, VideoConfig, AudioConfig

# 在服务端更改分辨率、质量或宽高比
job_id = conn.transcode(
    source="https://example.com/video.mp4",
    callback_url="https://example.com/webhook",
    mode=TranscodeMode.economy,
    video_config=VideoConfig(resolution=720, quality=23, aspect_ratio="16:9"),
    audio_config=AudioConfig(mute=False),
)

调整宽高比(适用于社交平台)

警告: reframe() 是缓慢的服务端操作。对于长视频,可能需要几分钟,并且可能超时。最佳实践:

  • 尽可能使用 start/end 限制为短片段
  • 对于完整长度的视频,使用 callback_url 进行异步处理
  • 先在 Timeline 上修剪视频,然后对较短的结果进行 reframe
from videodb import ReframeMode

# 始终优先对短片段进行 reframe:
reframed = video.reframe(start=0, end=60, target="vertical", mode=ReframeMode.smart)

# 完整长度视频的异步 reframe(返回 None,结果通过 webhook 返回):
video.reframe(target="vertical", callback_url="https://example.com/webhook")

# 预设:“vertical”(9:16)、“square”(1:1)、“landscape”(16:9)
reframed = video.reframe(start=0, end=60, target="square")

# 自定义尺寸
reframed = video.reframe(start=0, end=60, target={"width": 1280, "height": 720})

生成式媒体

image = coll.generate_image(
    prompt="山上的日落",
    aspect_ratio="16:9",
)

错误处理

from videodb.exceptions import AuthenticationError, InvalidRequestError

try:
    conn = videodb.connect()
except AuthenticationError:
    print("检查您的 VIDEO_DB_API_KEY")

try:
    video = coll.upload(url="https://example.com/video.mp4")
except InvalidRequestError as e:
    print(f"上传失败: {e}")

常见陷阱

场景错误消息解决方案
对已索引的视频进行索引Spoken word index for video already exists使用 video.index_spoken_words(force=True) 在已索引时跳过
场景索引已存在Scene index with id XXXX already exists使用 re.search(r"id\s+([a-f0-9]+)", str(e)) 从错误中提取现有的 scene_index_id
搜索未找到匹配InvalidRequestError: No results found捕获异常并视为空结果(shots = [])
Reframe 超时长视频上无限阻塞使用 start/end 限制片段,或传递 callback_url 进行异步
时间线上的负时间戳静默产生损坏的流在创建 VideoAsset 之前始终验证 start >= 0
generate_video() / create_collection() 失败Operation not allowed 或 maximum limit计划限制的功能 — 告知用户计划限制

附加文档

参考文档位于此 SKILL.md 文件旁边的 reference/ 目录中。如果需要,可以使用 Glob 工具定位它。

屏幕录制(桌面捕获)

使用 ws_listener.py 在录制会话期间捕获 WebSocket 事件。桌面捕获仅支持 macOS。

快速入门

  1. 启动监听器:python scripts/ws_listener.py &
  2. 获取 WebSocket ID:cat /tmp/videodb_ws_id
  3. 运行捕获代码(参见 reference/capture.md 获取完整工作流)
  4. 事件写入:/tmp/videodb_events.jsonl

查询事件

import json
events = [json.loads(l) for l in open("/tmp/videodb_events.jsonl")]

# 获取所有转录
# 获取所有转录
transcripts = [e["data"]["text"] for e in events if e.get("channel") == "transcript"]

# 过去 5 分钟的视觉描述
import time
cutoff = time.time() - 300
recent_visual = [e for e in events 
                 if e.get("channel") == "visual_index" and e["unix_ts"] > cutoff]

实用脚本

有关完整的捕获工作流,请参见 reference/capture.md。

不要使用 ffmpeg、moviepy 或本地编码工具,如果 VideoDB 支持该操作。以下所有操作均由 VideoDB 在服务端处理 — 修剪、合并剪辑、叠加音频或音乐、添加字幕、文本/图像叠加、转码、分辨率更改、宽高比转换、按平台要求调整大小、转录和媒体生成。仅对 reference/editor.md 中“限制”部分列出的操作回退到本地工具(过渡、速度更改、裁剪/缩放、调色、音量混合)。

何时使用什么

问题VideoDB 解决方案
平台拒绝视频宽高比或分辨率video.reframe() 或带有 VideoConfig 的 conn.transcode()
需要为 Twitter/Instagram/TikTok 调整视频大小video.reframe(target="vertical") 或 target="square"
需要更改分辨率(例如 1080p → 720p)带有 VideoConfig(resolution=720) 的 conn.transcode()
需要在视频上叠加音频/音乐Timeline 上的 AudioAsset
需要添加字幕video.add_subtitle() 或 CaptionAsset
需要合并/修剪剪辑Timeline 上的 VideoAsset
需要生成旁白、音乐或音效coll.generate_voice()、generate_music()、generate_sound_effect()

仓库

https://github.com/video-db/skills

维护者: VideoDB

限制

  • 仅当任务明确属于上述范围时才使用此技能。
  • 不要将输出视为特定环境验证、测试或专家审查的替代品。
  • 如果缺少必需的输入、权限、安全边界或成功标准,请停下来询问澄清。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

JantonioFC/skillsbank

AI-powered image editing with style transfer and object removal

JantonioFC/skillsbank

Internationalization and localization patterns. Detecting hardcoded strings, managing translations, locale files, RTL support.

JantonioFC/skillsbank

Analise e auditoria de editais de leilao judicial e extrajudicial. Riscos ocultos, clausulas perigosas, debitos, ocupante e classificacao da oportunidade.

JantonioFC/skillsbank

Embed Photopea in web apps using photopea.js. Covers embedding, file I/O, scripting, exporting, layers, text, filters, and the full Photoshop-compatible API.

JantonioFC/skillsbank

Best practices for Remotion - Video creation in React

JantonioFC/skillsbank

Generate walkthrough videos from Stitch projects using Remotion with smooth transitions, zooming, and text overlays

JantonioFC/skillsbank

Seek and analyze video content using Memories.ai Large Visual Memory Model for persistent video intelligence

JantonioFC/skillsbank

Writes complete, structured landing pages optimized for SEO ranking, AEO citation, and visitor conversion. Activate when the user wants to write or generate a landing page for a product, service, or offer.

JantonioFC/skillsbank

Upload, stream, search, edit, transcribe, and generate AI video and audio using the VideoDB SDK.

JantonioFC/skillsbank

Skill for discovering and researching autonomous AI agents, tools, and ecosystems using the AgentFolio directory.

JantonioFC/skillsbank

Expert in building portfolios that actually land jobs and clients - not just showing work, but creating memorable experiences. Covers developer portfolios, designer portfolios, creative portfolios, and portfolios that convert visitors into opportunities.

JantonioFC/skillsbank

Tool lifecycle UI components for React/Next.js from ui.inference.sh. Display tool calls: pending, progress, approval required, results. Capabilities: tool status, progress indicators, approval flows, results display. Use for: showing agent tool calls, human-in-the-loop approvals, tool output. Triggers: tool ui, tool calls, tool status, tool approval, tool results, agent tools, mcp tools ui, function calling ui, tool lifecycle, tool pending

JantonioFC/skillsbank

Security audit, hardening, threat modeling (STRIDE/PASTA), Red/Blue Team, OWASP checks, code review, incident response, and infrastructure security for any project.

JantonioFC/skillsbank

When the user wants help with paid advertising campaigns on Google Ads, Meta (Facebook/Instagram), LinkedIn, Twitter/X, or other ad platforms. Also use when the user mentions 'PPC,' 'paid media,' 'ROAS,' 'CPA,' 'ad campaign,' 'retargeting,' 'audience targeting,' 'Google Ads,' 'Facebook ads,'...

JantonioFC/skillsbank

Create AI avatar and talking head videos with OmniHuman, Fabric, PixVerse via inference.sh CLI. Models: OmniHuman 1.5, OmniHuman 1.0, Fabric 1.0, PixVerse Lipsync. Capabilities: audio-driven avatars, lipsync videos, talking head generation, virtual presenters. Use for: AI presenters, expla...

JantonioFC/skillsbank

Create AI marketing videos for ads, promos, product launches, and brand content. Models: Veo, Seedance, Wan, FLUX for visuals, Kokoro for voiceover. Types: product demos, testimonials, explainers, social ads, brand videos. Use for: Facebook ads, YouTube ads, product launches, brand awarene...

JantonioFC/skillsbank

Generate AI videos with Google Veo, Seedance, Wan, Grok and 40+ models via inference.sh CLI. Models: Veo 3.1, Veo 3, Seedance 1.5 Pro, Wan 2.5, Grok Imagine Video, OmniHuman, Fabric, HunyuanVideo. Capabilities: text-to-video, image-to-video, lipsync, avatar animation, video upscaling, fole...

JantonioFC/skillsbank

Production-ready CI/CD configurations for Playwright — GitHub Actions, GitLab CI, CircleCI, Azure DevOps, Jenkins, Docker, parallel sharding, reporting, code coverage, and global setup/teardown.

JantonioFC/skillsbank

Next.js 16+ and Turbopack — incremental bundling, FS caching, dev speed, and when to use Turbopack vs webpack.

JantonioFC/skillsbank

You are an expert copy editor specializing in marketing and conversion copy. Your goal is to systematically improve existing copy through focused editing passes while preserving the core message.

相关技能