Communitygithub.com

ComeOnOliver/skillshub

應在比較兩個影片以分析壓縮結果或品質差異時使用。產生互動式 HTML 報表,包含品質指標(PSNR、SSIM)與逐幀視覺比較。當使用者提及「比較影片」、「影片品質」、「壓縮分析」、「壓縮前後」或要求評估壓縮影片品質時觸發。

skillshub 是什麼?

此技能用於比較兩個影片以分析壓縮結果,尤其適合開發者或多媒體工程師評估編解碼器效能或位元率降低的影響。它會提取影片元數據,計算 PSNR(峰值訊噪比)與 SSIM(結構相似性)兩種標準品質指標,並產生一個互動式 HTML 報告。報告提供三種檢視模式:滑桿拖曳、並排顯示與網格布局,並支援縮放功能(50%–200%)。支援多種影片格式(如 .mp4、.mov、.mkv),且輸出檔案為獨立 HTML,無需伺服器即可離線使用。此技能適用於 Claude Code、Cursor 等能執行 Python 腳本的 AI 編碼工具,使用者只需提供原始影片與壓縮後影片的路徑即可自動執行比較。腳本內建驗證機制(如檢查 FFmpeg 安裝、檔案大小限制、路徑安全性),並提供清晰的錯誤訊息與解決指引。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/daymade/claude-code-skills/video-comparer

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Video Comparer

概述

比較兩個影片並產生互動式 HTML 報告,分析壓縮結果。腳本會提取影片元數據、計算品質指標(PSNR、SSIM),並建立逐幀視覺比較,提供三種檢視模式:滑桿、並排和網格。

何時使用此技能

在以下情況使用此技能:

  • 比較原始與壓縮後的影片
  • 分析影片壓縮品質與效率
  • 評估編解碼器效能或位元率降低的影響
  • 使用者提及「比較影片」、「影片品質」、「壓縮分析」或「壓縮前後」

核心用法

基本指令

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
  • 檔案大小限制: 每部影片 500MB(可設定)
  • 處理時間: 一般影片約 1-2 分鐘;依時長與幀間隔而異

腳本行為

自動驗證

腳本會自動驗證:

  • FFmpeg/FFprobe 安裝與可用性
  • 檔案存在性、副檔名與大小限制
  • 路徑安全性(防止目錄遍歷)

驗證失敗時會顯示清晰的錯誤訊息並提供解決指引。

品質指標

腳本計算兩種標準品質指標:

PSNR(峰值訊噪比): 像素層級的相似度測量(20-50 dB 範圍,越高越好)

SSIM(結構相似性指標): 感知層級的相似度測量(0.0-1.0 範圍,越高越好)

如需詳細的解讀尺規與品質閾值,請參閱 references/video_metrics.md。

幀提取

腳本會以指定的間隔(預設:5 秒)提取幀,將它們縮放至一致的高度(800px)以便比較,並以 base64 資料 URL 嵌入至獨立 HTML 中。處理完成後會自動清理暫存檔案。

輸出報告

產生的 HTML 報告包含:

  • 滑桿模式: 拖曳以顯示原始與壓縮版本(預設)
  • 並排模式: 同時顯示以進行直接比較
  • 網格模式: 緊湊的雙欄布局
  • 縮放控制: 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

相關技能