Communitygithub.com

VideoDB スキル

ビデオ・ライブストリーム・デスクトップセッションに対する認識、メモリ、アクション機能を提供します。ファイルやURLからの取り込み、インデックス作成と検索、トランスコード、タイムライン編集、イベントアラートなどをサポートします。

VideoDB スキル とは?

このスキルは、VideoDB SDK を介してビデオ、ライブストリーム、デスクトップキャプチャを操作するための包括的な機能を提供します。開発者はローカルファイルやURL、RTSPフィードから動画を取り込み、再生可能なストリームリンクを取得できます。認識機能は、フレーム抽出、視覚・意味・時間的なインデックス構築を行い、タイムスタンプと証拠リンクを含む正確な瞬間検索を実現します。アクション機能には、コーデック・FPS・解像度・アスペクト比のトランスコード、字幕生成・翻訳・焼き込み、テキスト/画像オーバーレイ、音声ダビング、タイムライン編集、画像・音声・動画の生成メディア作成が含まれます。また、デスクトップキャプチャ(macOS)をサポートし、画面・マイク・システム音声を記録してセッション要約やリアルタイムアラートを生成します。すべての主要な処理はサーバーサイドで実行されるため、ffmpeg などのローカルツールは必要ありません。エラーハンドリング、認証、一般的な落とし穴についてのガイダンスも提供しています。

対応✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Cody-W-Tucker/skills/tree/HEAD/skills/videodb

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

VideoDB スキル は何をしますか?

ビデオ、ライブストリーム、デスクトップセッションのための認識 + メモリ + アクション

使用するタイミング

デスクトップ認識

  • デスクトップセッションを開始/停止し、画面、マイク、システム音声をキャプチャ
  • ライブコンテキストをストリーミングし、エピソードセッションメモリを保存
  • 発話内容や画面で起きていることに対してリアルタイムアラート/トリガーを実行
  • セッションサマリー、検索可能なタイムライン、再生可能な証拠リンクを生成

ビデオ取り込み + ストリーム

  • ファイルやURLを取り込み、再生可能なウェブストリームリンクを返す
  • トランスコード/正規化: コーデック、ビットレート、FPS、解像度、アスペクト比

インデックス + 検索(タイムスタンプ + 証拠)

  • 視覚、発話、キーワードのインデックスを構築
  • 正確な瞬間をタイムスタンプと再生可能な証拠とともに検索して返す
  • 検索結果から自動でクリップを作成

タイムライン編集 + 生成

  • 字幕: 生成、翻訳、焼き込み
  • オーバーレイ: テキスト/画像/ブランディング、モーションキャプション
  • 音声: BGM、ナレーション、吹き替え
  • タイムライン操作によるプログラム的な合成とエクスポート

ライブストリーム(RTSP)+ 監視

  • RTSP/ライブフィードに接続
  • リアルタイムの視覚・発話認識を実行し、監視ワークフロー向けにイベント/アラートを発行

仕組み

共通入力

  • ローカルファイルパス、公開URL、またはRTSP URL
  • デスクトップキャプチャリクエスト: 開始 / 停止 / セッション要約
  • 必要な操作: コンテキスト取得、トランスコード仕様、インデックス仕様、検索クエリ、クリップ範囲、タイムライン編集、アラートルール

共通出力

  • ストリーム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ステートメントより長い場合は、代わりにヒアドキュメントを使用してください:

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 を保存

無料APIキーは console.videodb.io で取得してください(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 でラップし、「No results found」を空として扱います。
try:
    results = video.search("プロダクトデモ")
    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),
)

アスペクト比のリフレーム(SNSプラットフォーム向け)

警告: reframe() は遅いサーバーサイド操作です。長い動画の場合、数分かかりタイムアウトする可能性があります。ベストプラクティス:

  • 可能な場合は常に start/end を使用して短いセグメントに制限する
  • フルレングスの動画の場合は、callback_url を使用して非同期処理を行う
  • まず Timeline で動画をトリミングし、短い結果をリフレームする
from videodb import ReframeMode

# 常に短いセグメントのリフレームを優先:
reframed = video.reframe(start=0, end=60, target="vertical", mode=ReframeMode.smart)

# フルレングス動画の非同期リフレーム(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 existsvideo.index_spoken_words(force=True) を使用してスキップ
シーンインデックスがすでに存在Scene index with id XXXX already existsre.search(r"id\s+([a-f0-9]+)", str(e)) でエラーから既存の scene_index_id を抽出
検索で一致なしInvalidRequestError: No results found例外をキャッチして空の結果として扱う(shots = [])
リフレームがタイムアウト長い動画で無期限にブロックstart/end でセグメントを制限するか、callback_url で非同期処理
タイムラインの負のタイムスタンプ黙って壊れたストリームを生成VideoAsset 作成前に常に start >= 0 を検証
generate_video() / create_collection() 失敗Operation not allowed または maximum limitプラン制限付き機能 — ユーザーにプラン制限について通知

使用例

標準的なプロンプト

  • 「デスクトップキャプチャを開始し、パスワードフィールドが表示されたらアラート」
  • 「セッションを録画し、終了時に実行可能なサマリーを生成」
  • 「このファイルを取り込み、再生可能なストリームリンクを返す」
  • 「このフォルダをインデックスし、人物がいるすべてのシーンをタイムスタンプ付きで見つける」
  • 「字幕を生成し、焼き込んで、軽いBGMを追加」
  • 「このRTSP URLに接続し、人物がゾーンに入ったらアラート」

スクリーンレコーディング(デスクトップキャプチャ)

録画セッション中のWebSocketイベントをキャプチャするには ws_listener.py を使用します。デスクトップキャプチャは macOS のみ をサポートしています。

クイックスタート

  1. 状態ディレクトリを選択: STATE_DIR="${VIDEODB_EVENTS_DIR:-$HOME/.local/state/videodb}"
  2. リスナーを開始: VIDEODB_EVENTS_DIR="$STATE_DIR" python scripts/ws_listener.py --clear "$STATE_DIR" &
  3. WebSocket IDを取得: cat "$STATE_DIR/videodb_ws_id"
  4. キャプチャコードを実行(完全なワークフローは reference/capture.md を参照)
  5. イベントが書き込まれる場所: $STATE_DIR/videodb_events.jsonl

新しいキャプチャ実行を開始するときは常に --clear を使用して、古いトランスクリプトや視覚イベントが新しいセッションに漏れないようにします。

イベントのクエリ

import json
import os
import time
from pathlib import Path

events_dir = Path(os.environ.get("VIDEODB_EVENTS_DIR", Path.home() / ".local" / "state" / "videodb"))
events_file = events_dir / "videodb_events.jsonl"
events = []

if events_file.exists():
    with events_file.open(encoding="utf-8") as handle:
        for line in handle:
            try:
                events.append(json.loads(line))
            except json.JSONDecodeError:
                continue

transcripts = [e["data"]["text"] for e in events if e.get("channel") == "transcript"]
cutoff = time.time() - 300
recent_visual = [
    e for e in events
    if e.get("channel") == "visual_index" and e["unix_ts"] > cutoff
]

追加ドキュメント

リファレンスドキュメントは、この SKILL.md ファイルと同じ階層の reference/ ディレクトリにあります。必要に応じて Glob ツールを使用して見つけてください。

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()

出典

このスキルのリファレンス資料は skills/videodb/reference/ 以下にローカルに配置されています。 実行時に外部リポジトリリンクをたどる代わりに、上記のローカルコピーを使用してください。

Individual skills in this repo

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

Cody-W-Tucker/skills

Landing page quality assessment for paid advertising campaigns. Evaluates message match, page speed, mobile experience, trust signals, form optimization, and conversion rate potential. Use when user says landing page, post-click experience, landing page audit, conversion rate, or landing page optimization.

Cody-W-Tucker/skills

TikTok Ads deep analysis covering creative quality, tracking, bidding, campaign structure, and TikTok Shop. Evaluates 28 checks with emphasis on creative-first strategy, safe zone compliance, and Smart+ campaigns. Use when user says TikTok Ads, TikTok marketing, TikTok Shop, Spark Ads, Smart+, or TikTok campaign.

Cody-W-Tucker/skills

YouTube Ads specific analysis covering campaign types, creative quality, audience targeting, and measurement. Evaluates video ad performance across skippable, non-skippable, bumper, Shorts, Demand Gen, and Connected TV formats. Covers VAC→Demand Gen migration, Shorts creative requirements, and CTV shoppable ads. Use when user says YouTube Ads, video ads, pre-roll, bumper ads, YouTube campaign, Shorts ads, or CTV ads.

Cody-W-Tucker/skills

Craft the story that makes investors say \"I want in.\" Master the narrative structure that Reid Hoffman, Sequoia, and top founders use to raise capital. Use when: **Preparing to fundraise** to develop your story before the deck; **Investor meetings** to structure conversations that convert; **Pitch practice** to refine your narrative arc; **Cold outreach** to write compelling investor emails; **Pivoting** to reframe your story after a change

Cody-W-Tucker/skills

Identify the best GTM motions and tools across 7 motion types: Inbound, Outbound, Paid Digital, Community, Partners, ABM, and PLG. Use when selecting marketing channels, choosing between inbound and outbound strategy, or planning cross-channel campaigns.

Cody-W-Tucker/skills

Produce a print-grade single-page kami (紙 / 纸) document — warm parchment canvas, ink-blue accent, serif at one weight, no italic, no cool grays. The output reads like a professional white paper or studio one-pager, not an app UI. Multilingual by design (EN · zh-CN · ja). One self-contained HTML file, zero dependencies.

Cody-W-Tucker/skills

Optimize landing pages for maximum conversions using proven frameworks from Unbounce and Oli Gardner—apply the \"one goal, one message, one action\" principle with data-driven design, copy, and CTA best practices. Use when: **Create a new landing page** for a campaign; **Optimize an existing landing page** that isn't converting; **Review landing page design** before launch; **Improve form conversion rates** on lead gen pages; **A/B test landing page elements** systematically

Cody-W-Tucker/skills

Advanced motion patterns for React / Next.js — drag & drop, gestures, text animations, SVG path drawing, custom hooks, imperative sequences (useAnimate), loaders, and the full API decision tree. Requires motion-foundations.

Cody-W-Tucker/skills

Motion tokens, spring presets, performance rules, device adaptation, accessibility enforcement, and SSR safety for React / Next.js using motion/react. Foundation layer — all other motion skills depend on this.

Cody-W-Tucker/skills

A single-frame motion-design composition with looping CSS animations — rotating type ring, animated globe, ticking timer, parallax labels. Renders as a hero video poster you can hand straight to HyperFrames or any keyframe-based exporter. Use when the brief asks for "motion design", "animated hero", "loop", "video poster", "title card", or pairs Open Claude Design with HyperFrames for a kinetic export.

Cody-W-Tucker/skills

Production-ready animation patterns for React / Next.js — button, modal, toast, stagger, page transitions, exit animations, scroll, and layout — built on motion-foundations tokens and springs.

Cody-W-Tucker/skills

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

Cody-W-Tucker/skills

Produce a single-file slide deck in the Atelier Zero visual language (warm-paper background, italic-serif emphasis spans, coral terminating dots, surreal collage plates) — Open Design's brand deck recipe. The deck uses **horizontal magazine-style swipe pagination** (←/→, wheel, swipe), a per-slide chrome strip with brand mark and slide counter, an ESC overview grid, a coral progress bar, and inherits the canonical stylesheet + 16-slot image library from the sister `open-design-landing` skill.

Cody-W-Tucker/skills

Produce a world-class single-page editorial landing site in the Atelier Zero visual language (Monocle / Apartamento / Études editorial collage) — the same aesthetic Open Design uses for its own marketing surface. The agent fills a typed `inputs.json` from a brand brief, optionally generates 16 collage assets via gpt-image-2, then runs a pure-function composer that emits a self-contained HTML file; a separate path can mirror the Astro marketing site in `apps/landing-page/`. Drop-in scroll-reveal motion and a Headroom-style sticky nav are wired automatically.

Cody-W-Tucker/skills

Best practices for Remotion - Video creation in React. 29 domain-specific rules covering 3D, animations, audio, captions, charts, transitions, and more.

Cody-W-Tucker/skills

Single-page SaaS landing with hero, features, social proof, pricing, and CTA. Respects the active DESIGN.md color/typography/layout tokens. Trigger keywords: "saas landing", "marketing page", "product landing".

Cody-W-Tucker/skills

Single-page SaaS landing with hero, features, social proof, pricing, and CTA. Respects the active DESIGN.md color/typography/layout tokens. Trigger keywords: "saas landing", "marketing page", "product landing".

Cody-W-Tucker/skills

Master April Dunford's 8-step sales narrative from \"Sales Pitch\" (2023). Transform your positioning into a compelling story that wins enterprise deals. Use when: Structuring B2B sales presentations and demos; Creating pitch decks for complex products; Training sales teams on narrative-driven selling; Converting positioning strategy into sales conversations; Winning against entrenched competitors

Cody-W-Tucker/skills

Swiss-style user-research narrative template in warm-paper editorial aesthetics. Use when users ask for a premium research deck or story-first live artifact with minimalist typography, high-clarity layout, subtle motion, donut breakdowns, and keyboard/click navigation across slides in a single HTML file.

Cody-W-Tucker/skills

Download YouTube videos with customizable quality and format options. Use this skill when the user asks to download, save, or grab YouTube videos. Supports various quality settings (best, 1080p, 720p, 480p, 360p), multiple formats (mp4, webm, mkv), and audio-only downloads as MP3.

関連スキル