Communitygithub.com

ComeOnOliver/skillshub

このスキルは、2つの動画を比較して圧縮結果や品質の違いを分析する際に使用します。PSNRやSSIMなどの品質メトリクスとフレームごとの視覚的な比較を含むインタラクティブなHTMLレポートを生成します。

skillshub とは?

このスキルは、元の動画と圧縮後の動画を比較し、品質評価のためのインタラクティブなHTMLレポートを生成します。PSNR(ピーク信号対雑音比)とSSIM(構造的類似性指標)という2つの標準的な品質メトリクスを計算し、スライダー、サイドバイサイド、グリッドの3つの表示モードでフレームごとの視覚比較を提供します。このスキルは、動画圧縮の品質と効率を評価したり、コーデックの性能やビットレート削減の影響を分析する際に特に役立ちます。対応プラットフォームは、Claude Code、Coder、CodexなどのAIエージェントツールで、FFmpegとPython 3.8以上が必要です。スクリプトは自動的にFFmpeg/FFprobeのインストール確認、ファイルの存在確認、サイズ制限チェック、パスのセキュリティ検証を行い、問題があれば明確なエラーメッセージと解決方法を表示します。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/daymade/claude-code-skills/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-string、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)にスケーリングし、base64データURLとして自己完結型のHTMLに埋め込みます。処理後、一時ファイルは自動的に削除されます。

出力レポート

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

  • スライダーモード: ドラッグして元の動画と圧縮後の動画を表示(デフォルト)
  • サイドバイサイドモード: 同時表示による直接比較
  • グリッドモード: コンパクトな2カラムレイアウト
  • 拡大縮小コントロール: 50%〜200%の倍率
  • 自己完結型フォーマット(サーバー不要、オフラインで動作)

重要な実装の詳細

セキュリティ

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

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

よくあるエラーシナリオ

「FFmpeg が見つかりません」: プラットフォームのパッケージマネージャーを使用してFFmpegをインストールします(必要条件のセクションを参照)

「ファイルが大きすぎます」: 比較する前に動画を圧縮するか、scripts/compare.py 内の MAX_FILE_SIZE_MB を調整します

「操作がタイムアウトしました」: FFMPEG_TIMEOUT 定数を増やすか、より大きな --interval 値を使用します(処理するフレーム数が減ります)

「フレーム数が一致しません」: 動画の再生時間やフレームレートが異なります。スクリプトは自動的に最小フレーム数に切り詰め、警告を表示します

設定

スクリプトには、ファイルサイズ制限、タイムアウト、フレーム寸法、抽出間隔の調整可能な定数が含まれています。動作をカスタマイズするには、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 20 individual skills — each has its own dedicated page.

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

関連スキル