video-comparer
This skill should be used when comparing two videos to analyze compression results or quality differences. Generates interactive HTML reports with quality metrics (PSNR, SSIM) and frame-by-frame visual comparisons. Triggers when users mention "compare videos", "video quality", "compression analysis", "before/after compression", or request quality assessment of compressed videos.
Best use case
video-comparer is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
This skill should be used when comparing two videos to analyze compression results or quality differences. Generates interactive HTML reports with quality metrics (PSNR, SSIM) and frame-by-frame visual comparisons. Triggers when users mention "compare videos", "video quality", "compression analysis", "before/after compression", or request quality assessment of compressed videos.
Teams using video-comparer should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/video-comparer/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How video-comparer Compares
| Feature / Agent | video-comparer | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
This skill should be used when comparing two videos to analyze compression results or quality differences. Generates interactive HTML reports with quality metrics (PSNR, SSIM) and frame-by-frame visual comparisons. Triggers when users mention "compare videos", "video quality", "compression analysis", "before/after compression", or request quality assessment of compressed videos.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Video Comparer
## Overview
Compare two videos and generate an interactive HTML report analyzing compression results. The script extracts video metadata, calculates quality metrics (PSNR, SSIM), and creates frame-by-frame visual comparisons with three viewing modes: slider, side-by-side, and grid.
## When to Use This Skill
Use this skill when:
- Comparing original and compressed videos
- Analyzing video compression quality and efficiency
- Evaluating codec performance or bitrate reduction impact
- Users mention "compare videos", "video quality", "compression analysis", or "before/after compression"
## Core Usage
### Basic Command
```bash
python3 scripts/compare.py original.mp4 compressed.mp4
```
Generates `comparison.html` with:
- Video parameters (codec, resolution, bitrate, duration, file size)
- Quality metrics (PSNR, SSIM, size/bitrate reduction percentages)
- Frame-by-frame comparison (default: frames at 5s intervals)
### Command Options
```bash
# Custom output file
python3 scripts/compare.py original.mp4 compressed.mp4 -o report.html
# Custom frame interval (larger = fewer frames, faster processing)
python3 scripts/compare.py original.mp4 compressed.mp4 --interval 10
# Batch comparison
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
```
## Requirements
### System Dependencies
**FFmpeg and FFprobe** (required for video analysis and frame extraction):
```bash
# macOS
brew install ffmpeg
# Ubuntu/Debian
sudo apt update && sudo apt install ffmpeg
# Windows
# Download from https://ffmpeg.org/download.html
# Or use: winget install ffmpeg
```
**Python 3.8+** (uses type hints, f-strings, pathlib)
### Video Specifications
- **Supported formats:** `.mp4` (recommended), `.mov`, `.avi`, `.mkv`, `.webm`
- **File size limit:** 500MB per video (configurable)
- **Processing time:** ~1-2 minutes for typical videos; varies by duration and frame interval
## Script Behavior
### Automatic Validation
The script automatically validates:
- FFmpeg/FFprobe installation and availability
- File existence, extensions, and size limits
- Path security (prevents directory traversal)
Clear error messages with resolution guidance appear when validation fails.
### Quality Metrics
The script calculates two standard quality metrics:
**PSNR (Peak Signal-to-Noise Ratio):** Pixel-level similarity measurement (20-50 dB scale, higher is better)
**SSIM (Structural Similarity Index):** Perceptual similarity measurement (0.0-1.0 scale, higher is better)
For detailed interpretation scales and quality thresholds, consult `references/video_metrics.md`.
### Frame Extraction
The script extracts frames at specified intervals (default: 5 seconds), scales them to consistent height (800px) for comparison, and embeds them as base64 data URLs in self-contained HTML. Temporary files are automatically cleaned after processing.
### Output Report
The generated HTML report includes:
- **Slider Mode**: Drag to reveal original vs compressed (default)
- **Side-by-Side Mode**: Simultaneous display for direct comparison
- **Grid Mode**: Compact 2-column layout
- **Zoom Controls**: 50%-200% magnification
- Self-contained format (no server required, works offline)
## Important Implementation Details
### Security
The script implements:
- Path validation (absolute paths, prevents directory traversal)
- Command injection prevention (no `shell=True`, validated arguments)
- Resource limits (file size, timeouts)
- Custom exceptions: `ValidationError`, `FFmpegError`, `VideoComparisonError`
### Common Error Scenarios
**"FFmpeg not found"**: Install FFmpeg via platform package manager (see Requirements section)
**"File too large"**: Compress videos before comparison, or adjust `MAX_FILE_SIZE_MB` in `scripts/compare.py`
**"Operation timed out"**: Increase `FFMPEG_TIMEOUT` constant or use larger `--interval` value (processes fewer frames)
**"Frame count mismatch"**: Videos have different durations/frame rates; script auto-truncates to minimum frame count and shows warning
## Configuration
The script includes adjustable constants for file size limits, timeouts, frame dimensions, and extraction intervals. To customize behavior, edit the constants at the top of `scripts/compare.py`. For detailed configuration options and their impacts, consult `references/configuration.md`.
## Reference Materials
Consult these files for detailed information:
- **`references/video_metrics.md`**: Quality metrics interpretation (PSNR/SSIM scales, compression targets, bitrate guidelines)
- **`references/ffmpeg_commands.md`**: FFmpeg command reference (metadata extraction, frame extraction, troubleshooting)
- **`references/configuration.md`**: Script configuration options and adjustable constants
- **`assets/template.html`**: HTML report template for customizing viewing modes and stylingRelated Skills
video-to-gif
Convert video clips to optimized GIFs with speed control, cropping, text overlays, and file size optimization. Create perfect GIFs for social media, documentation, and presentations.
video-title-optimizer
Optimize video titles for maximum click-through rate (CTR) and YouTube/TikTok SEO. Generates multiple title variations balancing curiosity, keywords, and platform best practices. Use when naming videos, improving CTR, or A/B testing titles.
video-script-writer
Write engaging video scripts for YouTube, TikTok, and other platforms. Creates complete scripts with hooks, main content, and CTAs. Supports various formats including tutorials, vlogs, reviews, explainers, and storytelling. Use when creating video scripts, writing YouTube content, or planning video structure.
video-script-collaborial
将视频脚本转换为更适合实际录制的口语化表达,去除书面化语言,增加自然感和亲和力。当用户提到"视频脚本"、"录制"、"口语化"、"自然一点"、"像说话一样"、"太书面了"时使用此技能。
video-hook-generator
Generate attention-grabbing hooks for the first 3 seconds of videos. The hook determines if viewers stay or scroll. Creates multiple hook variations for A/B testing. Use when crafting video openings, improving retention, or creating scroll-stopping content for YouTube, TikTok, or Reels.
video-analytics-interpreter
Interpret YouTube Analytics, TikTok Analytics, and video performance data. Identifies trends, explains metrics, and provides actionable recommendations for growth. Use when analyzing video performance, understanding metrics, or optimizing channel strategy.
youtube-to-markdown
Use when user asks YouTube video extraction, get, fetch, transcripts, subtitles, or captions. Writes video details and transcription into structured markdown file.
youtube-seo-optimizer
Optimize YouTube videos for search and discovery. Generates SEO-optimized titles, descriptions, tags, hashtags, and chapters. Includes keyword research and competitor analysis. Use when publishing videos, improving discoverability, or optimizing existing content.
webfluence
Content web architecture framework. Use when diagnosing offer doc usage, content-to-conversion pathways, or why someone isn't getting sales despite traffic.
youtube-downloader
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.
thumbnail-concept-generator
Generate thumbnail concepts and ideas for YouTube, TikTok, and other video platforms. Creates detailed visual briefs with composition, text, colors, and emotion suggestions. Use when planning thumbnails, improving CTR, or briefing designers.
tapestry
Unified content extraction and action planning. Use when user says "tapestry <URL>", "weave <URL>", "help me plan <URL>", "extract and plan <URL>", "make this actionable <URL>", or similar phrases indicating they want to extract content and create an action plan. Automatically detects content type (YouTube video, article, PDF) and processes accordingly.