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.
A professional video comparison tool that analyzes compression quality and generates interactive HTML reports. Compare original vs compressed videos with detailed metrics (PSNR, SSIM) and frame-by-frame visual comparisons.
# macOS
brew install ffmpeg
# Ubuntu/Debian
sudo apt install ffmpeg
# Windows
# Download from https://ffmpeg.org/download.html
# Navigate to the skill directory
cd /path/to/video-comparer
# Compare two videos
python3 scripts/compare.py original.mp4 compressed.mp4
# Open the generated report
open comparison.html # macOS
# or
xdg-open comparison.html # Linux
# or
start comparison.html # Windows
python3 scripts/compare.py <original> <compressed> [options]
Arguments:
original Path to original video file
compressed Path to compressed video file
Options:
-o, --output PATH Output HTML report path (default: comparison.html)
--interval SECONDS Frame extraction interval in seconds (default: 5)
-h, --help Show help message
# Basic comparison
python3 scripts/compare.py original.mp4 compressed.mp4
# Custom output file
python3 scripts/compare.py original.mp4 compressed.mp4 -o report.html
# Extract frames every 10 seconds (fewer frames, faster processing)
python3 scripts/compare.py original.mp4 compressed.mp4 --interval 10
# Compare with absolute paths
python3 scripts/compare.py ~/Videos/original.mov ~/Videos/compressed.mov
# Batch comparison
for original in originals/*.mp4; do
compressed="compressed/$(basename "$original")"
python3 scripts/compare.py "$original" "$compressed" -o "reports/$(basename "$original" .mp4).html"
done
| Format | Extension | Notes |
|--------|-----------|-------|
| MP4 | .mp4 | Recommended, widely supported |
| MOV | .mov | Apple QuickTime format |
| AVI | .avi | Legacy format |
| MKV | .mkv | Matroska container |
| WebM | .webm | Web-optimized format |
The generated HTML report includes:
scripts/compare.pyALLOWED_EXTENSIONS = {'.mp4', '.mov', '.avi', '.mkv', '.webm'}
MAX_FILE_SIZE_MB = 500 # Maximum file size limit
FFMPEG_TIMEOUT = 300 # FFmpeg timeout (5 minutes)
FFPROBE_TIMEOUT = 30 # FFprobe timeout (30 seconds)
BASE_FRAME_HEIGHT = 800 # Frame height for comparison
FRAME_INTERVAL = 5 # Default frame extraction interval
To change the frame resolution for comparison:
# In scripts/compare.py
BASE_FRAME_HEIGHT = 1200 # Higher resolution (larger file size)
# or
BASE_FRAME_HEIGHT = 600 # Lower resolution (smaller file size)
shell=True in subprocess calls# Install FFmpeg using your package manager
brew install ffmpeg # macOS
sudo apt install ffmpeg # Ubuntu/Debian
sudo yum install ffmpeg # CentOS/RHEL/Fedora
# Options:
1. Compress videos before comparison
2. Increase MAX_FILE_SIZE_MB in compare.py
3. Use shorter video clips
# For very long videos:
python3 scripts/compare.py original.mp4 compressed.mp4 --interval 10
# or
# Increase FFMPEG_TIMEOUT in compare.py
Enable verbose output by modifying the script:
# Add at the top of compare.py
import logging
logging.basicConfig(level=logging.DEBUG)
video-comparer/
├── SKILL.md # Skill description and invocation
├── README.md # This file
├── assets/
│ └── template.html # HTML report template
├── references/
│ ├── video_metrics.md # Quality metrics reference
│ └── ffmpeg_commands.md # FFmpeg command examples
└── scripts/
└── compare.py # Main comparison script (696 lines)
compare.py: Main script with all functionality
template.html: Interactive report template
# Clone the repository
git clone <repository-url>
cd video-comparer
# Create virtual environment (optional but recommended)
python3 -m venv venv
source venv/bin/activate # macOS/Linux
# or
venv\Scripts\activate # Windows
# Install FFmpeg (see Prerequisites section)
# Test the installation
python3 scripts/compare.py --help
# Test with sample videos (you'll need to provide these)
python3 scripts/compare.py test/original.mp4 test/compressed.mp4
# Test error handling
python3 scripts/compare.py nonexistent.mp4 also_nonexistent.mp4
python3 scripts/compare.py original.txt compressed.txt
This skill is part of the claude-code-skills collection. See the main repository for license information.
For issues and questions:
Edit PDFs with natural-language instructions using the nano-pdf CLI.
Control Sonos speakers (discover/status/play/volume/group).
Terminal Spotify playback/search via spogo (preferred) or spotify_player.
Capture frames or clips from RTSP/ONVIF cameras.
CLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).
Monitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.
Category:tools