Communitygithub.com

JantonioFC/skillsbank

影片與音訊感知、索引與編輯。支援檔案/網址/即時串流匯入,建立視覺/語音索引,透過時間戳記搜尋,編輯時間軸,加入疊加層/字幕,生成媒體,並建立即時警報。

skillsbank 是什麼?

此技能為 AI 代理(如 Claude Code、Cursor、Codex)提供全面的影片與音訊處理能力。它能處理檔案、網址、桌面錄製會話與即時串流(RTSP),並支援從感知、索引、搜尋到時間軸編輯與媒體生成的完整工作流程。 主要功能包括桌面錄製(螢幕、麥克風與系統音訊)並產生可搜尋的會話記憶與即時警報;影片與音訊的索引與搜尋(視覺、語音與關鍵字),並返回精確的時間戳記與可直接播放的證據連結;時間軸編輯(字幕生成與嵌入、文字/圖片疊加、背景音樂、旁白與配音);以及即時串流監控,可在偵測到特定視覺或語音事件時觸發警報。 此技能支援主要開發平台,並利用 VideoDB SDK 進行伺服器端處理,避免使用 ffmpeg 或 moviepy 等本地工具。它會自動處理 API 金鑰驗證,並提供完善的錯誤處理指引,例如索引重複或搜尋無結果時的處理方式。開發者可以透過標準的 Python 程式碼內嵌或使用 heredoc 方式執行命令。 簡而言之,對於任何需要影片或音訊的感知、記憶與自動化操作的開發工作,此技能都能顯著簡化流程。

相容平台✓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 技能

感知 + 記憶 + 影片、即時串流與桌面錄製會話的行動。

當你需要以下功能時,請使用此技能:

使用時機

  • 需要從檔案、網址、桌面錄製會話或即時串流中,進行影片或音訊感知、索引、搜尋或時間軸編輯。
  • 任務涉及時間戳記、可搜尋的證據、字幕、剪輯、疊加層或即時監控警報。
  • 想要一個整合了匯入、理解、檢索與媒體動作的工作流程。

1) 桌面感知

  • 啟動/停止桌面錄製會話,捕捉螢幕、麥克風與系統音訊。
  • 串流即時上下文,並儲存事件式的會話記憶。
  • 對語音內容與螢幕上發生的事件,執行即時警報/觸發器。
  • 產生會話摘要、可搜尋的時間軸,以及可播放的證據連結。

2) 影片匯入 + 串流

  • 匯入檔案或網址,並回傳可播放的網路串流連結。
  • 轉碼/正規化:編碼、位元率、幀率、解析度、畫面比例。

3) 索引 + 搜尋(時間戳記 + 證據)

  • 建立視覺、語音與關鍵字索引。
  • 搜尋並回傳帶有時間戳記與可播放證據的精確時刻。
  • 從搜尋結果自動建立剪輯。

4) 時間軸編輯 + 生成

  • 字幕:生成、翻譯、嵌入。
  • 疊加層:文字/圖片/品牌標誌、動態字幕。
  • 音訊:背景音樂、旁白、配音。
  • 透過時間軸操作進行程式化組合與匯出。

5) 即時串流 (RTSP) + 監控

  • 連接 RTSP/即時來源。
  • 執行即時視覺與語音理解,並對監控工作流程發出事件/警報。

常見輸入

  • 本地檔案路徑、公開網址或 RTSP 網址。
  • 桌面錄製請求:開始 / 停止 / 摘要會話。
  • 所需的操作:取得上下文以進行理解、轉碼規格、索引規格、搜尋查詢、剪輯範圍、時間軸編輯、警報規則。

常見輸出

  • 串流網址。
  • 帶有時間戳記與證據連結的搜尋結果。
  • 生成的資產:字幕、音訊、圖片、剪輯。
  • 即時串流的事件/警報酬載。
  • 桌面會話摘要與記憶條目。

範例提示(參考)

  • "啟動桌面錄製,並在密碼欄位出現時發出警報。"
  • "錄製我的會話,並在結束時產生可操作的摘要。"
  • "匯入此檔案,並回傳一個可播放的串流連結。"
  • "為此資料夾建立索引,並找出所有人物的場景,回傳時間戳記。"
  • "生成字幕,將其嵌入,並加入輕柔的背景音樂。"
  • "連接此 RTSP 網址,並在有人進入區域時發出警報。"

執行 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 檔案:在專案的 .env 檔案中儲存 VIDEO_DB_API_KEY=your-key

請在 https://console.videodb.io 取得免費 API 金鑰(50 次免費上傳,無需信用卡)。

請勿自行讀取、寫入或處理 API 金鑰。務必讓使用者自行設定。

快速參考

上傳媒體

# 網址
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 進行非同步處理
Timeline 上的負時間戳記悄悄產生損壞的串流在建立 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。

當 VideoDB 支援該操作時,請勿使用 ffmpeg、moviepy 或本地編碼工具。 以下所有操作均由 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.

相關技能