OpenSource-Hub

claude-video

CLI ツール

bradautomates/claude-video

Claude があらゆる動画を視聴・分析できるようにします。

概要

Claude と統合されたコマンドラインツールで、動画のダウンロード、フレームの抽出、音声の文字起こしが可能です。YouTube などのさまざまなソースをサポートし、完全な動画分析ワークフローを提供します。ユーザーは動画コンテンツに関する質問を行い、視覚および聴覚情報に基づいた回答を得ることができます。

README プレビュー

# /watch\n\n**Give Claude the ability to watch any video.**\n\nClaude Code (recommended — auto-updates via marketplace):\n```\n/plugin marketplace add bradautomates/claude-video\n/plugin install watch@claude-video\n```\n\nCodex, Cursor, Copilot, Gemini CLI, or any of 50+ [Agent Skills](https://agentskills.io) hosts:\n```bash\nnpx skills add bradautomates/claude-video -g\n```\n(`-g` installs globally for your user, available across all projects. Drop it to scope per-project.)\n\nMore install options (claude.ai web, manual) in the [Install](#install) section below.\n\nZero config to start — `yt-dlp` and `ffmpeg` install on first run via `brew` on macOS (Linux/Windows print exact commands). Captions cover most public videos for free. Whisper API key is only needed when a video has no captions.\n\n---\n\nClaude can read a webpage, run a script, browse a repo. What it can't do, out of the box, is *watch a video*. You paste a YouTube link and it has to either guess from the title or pull a transcript that's missing 90% of what's on screen.\n\nWith Claude Video `/watch` you can paste a URL or a local path, ask a question, and Claude fetches captions first, downloads only what it needs, extracts frames (scene-aware, or fast keyframes at `efficient` detail), pulls a timestamped transcript (free captions when available, Whisper API as fallback), and `Read`s every frame as an image. By the time it answers, it has *seen* the video and *heard* the audio.\n\n```\n/watch https://youtu.be/dQw4w9WgXcQ what happens at the 30 second mark?\n```\n\n## What people actually use it for\n\n**Analyze someone else's content.** `/watch https://youtu.be/ what hook did they open with?` Claude looks at the first frames, reads the opening transcript, breaks down the structure. Same for ad creative, competitor launches, podcast intros, anything where the *how* matters as much as the *what*.\n\n**Diagnose a bug from a video.** Someone sends you a screen recording of something broken. `/watch bug-rep

FAQ (5)

トラブル対応
WindowsでPython CLIを実行した際に発生する「UnicodeEncodeError: 'charmap' codec can't encode character '→'」を修正するにはどうすればよいですか?

これは、Windows のコンソールが UTF-8 ではなく cp1252 を使用することが多い一方で、レポートが →、…、— などの文字を出力するために発生します。

一時的なユーザーの回避策:

setx PYTHONUTF8 1

実行後、ターミナルを閉じて再度開いてください。現在の PowerShell セッションのみに適用する場合は、次を使用します:

$env:PYTHONUTF8 = "1"

恒久的なアプリケーション側の修正: プログラムの起動時に、レポートが出力される前に stdout と stderr を UTF-8 に再設定します:

import sys

for stream in (sys.stdout, sys.stderr):
    try:
        stream.reconfigure(encoding="utf-8")
    except (AttributeError, ValueError):
        pass

このヘルパーは、watch.py、frames.py、whisper.py、transcribe.py、setup.py、download.py など、すべてのエントリーポイントから呼び出してください。TextIOWrapper.reconfigure() は Python 3.7+ で利用可能です。対象のプロジェクトでは Python 3.10+ が必要です。非 ASCII 文字を単に削除するだけではいけません。他のレポート出力でも同じ cp1252 エラーが発生する可能性があるためです。

参照 Issue #61
トラブル対応
Claude Codeにwatch@claude-videoをインストールした後に「Unknown command: /watch」というエラーを修正するにはどうすればよいですか?

スラッシュコマンドが失敗するのは、Claude Code 2.1.126 が allowed-tools の YAML インラインリスト形式を解析できないためです。~/.claude/plugins/cache/claude-video/watch/0.1.2/commands/watch.md を編集して、以下を:

allowed-tools: [Bash, Read, AskUserQuestion]

次のように置き換えてください:

allowed-tools: Bash, Read, AskUserQuestion

この変更は次のコマンドで直接適用できます:

sed -i '' 's/^allowed-tools: \[Bash, Read, AskUserQuestion\]$/allowed-tools: Bash, Read, AskUserQuestion/' ~/.claude/plugins/cache/claude-video/watch/0.1.2/commands/watch.md

Claude Code を完全に終了してから再度開き、/watch を実行するか、オートコンプリートから /watch:watch を選択してください。恒久的な修正は、プラグインのメンテナーが main 上の commands/watch.md にこの1行の変更を加えることです。frontmatter のバリデーションを追加することで、リグレッションを防ぐことができます。

参照 Issue #6
トラブル対応
Windows では、なぜ /watch レポートに動画のタイトルとアップローダーが表示されないのですか?

watch v0.1.3 以降にアップグレードしてください。このバグは、scripts/download.py が encoding="utf-8" を指定せずに Path.read_text() を呼び出していることが原因で発生します。Windows では Python が cp1252 を使用するため、yt-dlp の video.info.json に含まれる非 ASCII 文字が UnicodeDecodeError を引き起こします。その後、広範な except によって URL のみが暗黙的に残され、タイトルとアップローダーが省略されてしまいます。古いバージョンに修正を適用するには、次のように変更します:

raw = json.loads(info_path.read_text())

を次のように変更します:

raw = json.loads(info_path.read_text(encoding="utf-8"))

また、パースの失敗を暗黙的に無視するのではなく、ログに記録してください。例:

except Exception as exc:
    print(f"[watch] info.json parse failed: {exc}", file=sys.stderr)
    info = {"url": url}

一時的な回避策として、出力ディレクトリから video.info.json を明示的に UTF-8 として読み直してください。Windows のコンソール出力が絵文字やその他の非 ASCII 文字を含むタイトルで失敗する場合は、コマンドを実行する前に PYTHONUTF8=1 または PYTHONIOENCODING=utf-8 を設定してください。

参照 Issue #4
トラブル対応
Python の subprocess からユーザー指定の URL を渡す際に、yt-dlp のオプションインジェクションを防ぐにはどうすればよいですか?

yt-dlp の argv 配列で URL の直前に "--" を挿入し、パーサーがオプションの処理を停止するようにしてください。また、URL を検証し、- で始まる入力を拒否してください。

cmd = [
    "yt-dlp",
    "-N", "8",
    "-o", output_template,
    "--",
    url,
]
subprocess.run(cmd, check=True)

多層防御の一環として URL 検証を強化します:

from urllib.parse import urlparse

def is_url(source: str) -> bool:
    if source.startswith("-"):
        return False
    parsed = urlparse(source)
    return parsed.scheme in ("http", "https") and bool(parsed.netloc)

ffmpeg/ffprobe については、これらのツールは -- をオプションの終端として扱わないため、-- に依存しないでください。代わりに、Path.resolve() を使用してユーザーが制御するパスを絶対パスに解決してください。この問題は claude-video v0.1.3/commit c333c22 で修正されました。

参照 Issue #2
トラブル対応
claude-videoを使用して、自動生成された動画の文字起こしで誤って認識された単語を修正するにはどうすればよいですか?

現在、修正済みのVTT/SRTファイルを書き出すワンクリックオプションはありませんが、2パスのワークフローで対応できます:

1. /watch <url> --detail transcript を実行し、Claudeに生のタイムスタンプ付きトランスクリプトと、固有名詞、同音異義語、急激な文脈の変化などの疑わしいセグメントを尋ねます。すでにキャプション付きのURLの場合、ツールは yt-dlp が取得したVTTを使用し、動画のダウンロードをスキップします。
2. 動画をダウンロードし、問題のあるタイムスタンプのみを再確認します:

/watch <local-video> --detail transcript --timestamps 1:23,4:56,7:08 --no-whisper

Claudeはそれらのタイムスタンプのフレームのみを抽出し、トランスクリプトと比較して、文脈を考慮した修正を提案できます。それらの修正はVTT/SRTファイルに手動で適用してください。

参照 Issue #66