Communitygithub.com

daymade/claude-code-skills

2つの動画を比較し、画質指標(PSNR、SSIM)とフレーム単位のビジュアル比較を含むインタラクティブなHTMLレポートを生成します。動画の圧縮結果や品質の分析に使用します。

claude-code-skills とは?

このスキルは、オリジナル動画と圧縮動画を比較し、詳細なインタラクティブHTMLレポートを生成するためのツールです。PSNR(ピーク信号対雑音比)とSSIM(構造的類似性指標)という標準的な画質評価指標を計算し、スライダー、サイドバイサイド、グリッドの3つの表示モードでフレームごとの視覚比較を提供します。主な使用ケースは、ビデオ圧縮の品質分析、コーデックのパフォーマンス評価、ビットレート削減の影響評価などです。このスキルは、Claude CodeやCursorなどのAIエージェント環境で動作し、ffmpegとPython 3.8+に依存します。スクリプトは自動検証、セキュリティ対策(パスの検証、コマンドインジェクション防止)、エラーハンドリングを備えており、自己完結型のHTMLレポートを生成するため、サーバー不要でオフラインでも動作します。カスタムフレーム間隔や出力ファイル名の指定も可能で、バッチ処理にも対応しています。

対応✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/daymade/claude-code-skills/tree/HEAD/video-comparer

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

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

ドキュメント

Video Comparer (動画比較ツール)

概要

2つの動画を比較し、圧縮結果を分析するインタラクティブなHTMLレポートを生成します。このスクリプトは、動画のメタデータを抽出し、品質指標(PSNR、SSIM)を計算し、スライダー、サイドバイサイド、グリッドの3つの表示モードでフレームごとの視覚比較を作成します。

このスキルを使用するタイミング

以下のような場合にこのスキルを使用します:

  • オリジナル動画と圧縮動画を比較する場合
  • 動画圧縮の品質と効率を分析する場合
  • コーデックのパフォーマンスやビットレート削減の影響を評価する場合
  • ユーザーが「動画を比較」、「動画品質」、「圧縮分析」、「圧縮前/圧縮後」などと言及した場合

基本的な使い方

基本コマンド

python3 scripts/compare.py original.mp4 compressed.mp4

以下の内容を含む comparison.html を生成します:

  • 動画パラメータ(コーデック、解像度、ビットレート、長さ、ファイルサイズ)
  • 品質指標(PSNR、SSIM、サイズ/ビットレート削減率)
  • フレームごとの比較(デフォルト:5秒間隔のフレーム)

コマンドオプション

# カスタム出力ファイル
python3 scripts/compare.py original.mp4 compressed.mp4 -o report.html

# カスタムフレーム間隔(大きいほどフレーム数が減り、処理が高速化)
python3 scripts/compare.py original.mp4 compressed.mp4 --interval 10

# バッチ比較
for original in originals/*.mp4; do
    compressed="compressed/$(basename "$original")"
    output="reports/$(basename "$original" .mp4).html"
    python3 scripts/compare.py "$original" "$compressed" -o "$output"
done

必要条件

システム依存関係

FFmpeg および FFprobe(動画解析とフレーム抽出に必要):

# macOS
brew install ffmpeg

# Ubuntu/Debian
sudo apt update && sudo apt install ffmpeg

# Windows
# https://ffmpeg.org/download.html からダウンロード
# または:winget install ffmpeg

Python 3.8+(タイプヒント、f-strings、pathlib を使用)

動画仕様

  • 対応フォーマット: .mp4(推奨)、.mov、.avi、.mkv、.webm
  • ファイルサイズ制限: 動画1本あたり500MB(設定可能)
  • 処理時間: 通常の動画で約1〜2分。動画の長さとフレーム間隔によって異なります

スクリプトの動作

自動検証

スクリプトは自動的に以下を検証します:

  • FFmpeg/FFprobe のインストールと利用可能性
  • ファイルの存在、拡張子、サイズ制限
  • パスの安全性(ディレクトリトラバーサルを防止)

検証に失敗した場合は、解決方法を示す明確なエラーメッセージが表示されます。

品質指標

スクリプトは2つの標準的な品質指標を計算します:

PSNR(ピーク信号対雑音比): ピクセルレベルの類似性を測定(20〜50 dBの範囲、値が高いほど優れている)

SSIM(構造的類似性指標): 知覚的な類似性を測定(0.0〜1.0の範囲、値が高いほど優れている)

詳細な解釈スケールと品質しきい値については、references/video_metrics.md を参照してください。

フレーム抽出

スクリプトは指定された間隔(デフォルト:5秒)でフレームを抽出し、比較のために一定の高さ(800px)にスケーリングし、自己完結型HTMLにbase64データURLとして埋め込みます。処理後、一時ファイルは自動的に削除されます。

出力レポート

生成されたHTMLレポートには以下が含まれます:

  • スライダーモード: ドラッグしてオリジナルと圧縮を切り替え(デフォルト)
  • サイドバイサイドモード: 直接比較するための同時表示
  • グリッドモード: コンパクトな2カラムレイアウト
  • ズームコントロール: 50%〜200%の拡大表示
  • 自己完結型フォーマット(サーバー不要、オフラインでも動作)

重要な実装の詳細

セキュリティ

スクリプトは以下を実装しています:

  • パス検証(絶対パス、ディレクトリトラバーサル防止)
  • コマンドインジェクション防止(shell=True不使用、引数を検証)
  • リソース制限(ファイルサイズ、タイムアウト)
  • カスタム例外:ValidationError、FFmpegError、VideoComparisonError

よくあるエラーシナリオ

「FFmpeg not found」:プラットフォームのパッケージマネージャーを使用してFFmpegをインストールしてください(必要条件のセクションを参照)

「File too large」:比較する前に動画を圧縮するか、scripts/compare.py の MAX_FILE_SIZE_MB を調整してください

「Operation timed out」:FFMPEG_TIMEOUT 定数を増やすか、より大きな --interval 値を使用してください(処理するフレーム数が減ります)

「Frame count mismatch」:動画の長さまたはフレームレートが異なります。スクリプトは自動的に最小フレーム数に切り詰め、警告を表示します

設定

スクリプトには、ファイルサイズ制限、タイムアウト、フレーム寸法、抽出間隔の調整可能な定数が含まれています。動作をカスタマイズするには、scripts/compare.py の上部にある定数を編集してください。詳細な設定オプションとその影響については、references/configuration.md を参照してください。

参考資料

詳細情報については、以下のファイルを参照してください:

  • references/video_metrics.md:品質指標の解釈(PSNR/SSIMスケール、圧縮目標、ビットレートガイドライン)
  • references/ffmpeg_commands.md:FFmpegコマンドリファレンス(メタデータ抽出、フレーム抽出、トラブルシューティング)
  • references/configuration.md:スクリプト設定オプションと調整可能な定数
  • assets/template.html:表示モードとスタイルをカスタマイズするためのHTMLレポートテンプレート

Individual skills in this repo

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

daymade/claude-code-skills

>- Generates Chinese/Japanese speech with StepFun's Contextual TTS — default stepaudio-2.5-tts, stepaudio-3-tts for whisper/inline-() prosody. Replaces step-tts-2's voice_label with natural-language instruction. Use for emotional/prosody-controlled synthesis, batch voice lines, migrating from step-tts-2, or cloned voices (2.5/step-tts-2, not v3). Triggers on 阶跃 TTS, 语音合成, 配音. Not for transcription (use stepfun-asr).

daymade/claude-code-skills

Download YouTube videos and HLS streams (m3u8) from platforms like Mux, Vimeo, etc. using yt-dlp and ffmpeg. Use this skill when users request downloading videos, extracting audio, handling protected streams with authentication headers, or troubleshooting download issues like nsig extraction failures, 403 errors, or cookie extraction problems.

daymade/local-conversation-history

Entry point for local AI conversation history across providers. Routes a request to the one skill that owns it, by platform (Claude Code, OpenAI Codex, Kimi CLI) and action (read evidence vs continue interrupted work), and owns the one job none of them own alone: a single inventory spanning all three providers. Use when the provider is unknown or plural ("our history", "what have I been working on", "which chats did I have"), when the user wants Kimi CLI history at all, when it is unclear whether they need evidence or resumption, or when they ask for this skill by name. Vague recall that names no platform ("we discussed this once, when was it?") belongs here rather than to a single-provider reader, because a Claude-only answer to an unscoped question cannot support an absence claim. When the platform and the action are both already clear, load that executor skill directly instead — except Kimi CLI, which has no reader or continuation skill of its own and always routes through here.

daymade/ppt-creator

Create professional slide decks from topics or documents. Generates structured content with data-driven charts, speaker notes, and complete PPTX files. Applies persuasive storytelling principles (Pyramid Principle, assertion-evidence). Supports multiple formats (Marp, PowerPoint). Use for presentations, pitches, slide decks, or keynotes.

daymade/prompt-optimizer

Transform vague prompts into precise, well-structured specifications using EARS (Easy Approach to Requirements Syntax) methodology. This skill should be used when users provide loose requirements, ambiguous feature descriptions, or need to enhance prompts for AI-generated code, products, or documents. Triggers include requests to "optimize my prompt", "improve this requirement", "make this more specific", or when raw requirements lack detail and structure.

daymade/qa-expert

This skill should be used when establishing comprehensive QA testing processes for any software project. Use when creating test strategies, writing test cases following Google Testing Standards, executing test plans, tracking bugs with P0-P4 classification, calculating quality metrics, or generating progress reports. Includes autonomous execution capability via master prompts and complete documentation templates for third-party QA team handoffs. Implements OWASP security testing and achieves 90% coverage targets.

daymade/read-claude-code-history

Reads, searches, and exports local Claude Code history without resuming work. Covers recent session inventory, exact session timelines, verbatim human input including queued mid-turn prompts, full-event keyword search, hybrid recall when wording changed, end-state triage, and deleted-file recovery across active Claude homes plus registered archives. Use whenever the user asks what they or Claude said, wants a Claude Code session ID or original context, remembers prior work vaguely, needs an old file from a transcript, or must prove what a Claude session contained before continuing it. Also owns the only Kimi CLI surface, via its Kimi inventory and search flags. For Codex history use read-codex-history; when the request names no platform at all or spans providers, start at local-conversation-history.

daymade/read-codex-history

Reads, searches, and exports local OpenAI Codex history without continuing the old task. Lists recent Codex sessions, extracts exact prompt-ledger inputs by Session, locates a rollout by verified session_meta identity, reconstructs one chronological user/assistant timeline with fork and compaction lineage, and performs bounded keyword search across live and archived rollouts. Use whenever the user asks what they told Codex, wants recent original inputs, a Codex Session ID, full prior context, fork ancestry, or evidence of what a Codex run did. For Claude Code history use read-claude-code-history.

daymade/twitter-reader

Fetch Twitter/X post content including long-form Articles with full images and metadata. Use when Claude needs to retrieve tweet/article content, author info, engagement metrics, and embedded media. Supports individual posts and X Articles (long-form content). Automatically downloads all images to local attachments folder and generates complete Markdown with proper image references. Preferred over Jina for X Articles with images.

関連スキル