New to Claude Skills? Learn how to install them โ†’

daymade on GitHub

Video Comparer

Free

Analyze video quality and compression results effortlessly.

Get this skill

Free ยท Opens the source repo

What Video Comparer does

Video Comparer is a powerful tool designed for developers and designers who need to assess the quality of video files, particularly in the context of compression. This skill allows you to compare two videosโ€”an original and a compressed versionโ€”by generating an interactive HTML report that highlights key quality metrics such as Peak Signal-to-Noise Ratio (PSNR) and Structural Similarity Index (SSIM). With this tool, you can visually analyze the differences between the two videos through frame-by-frame comparisons in multiple viewing modes: slider, side-by-side, and grid.

The skill leverages FFmpeg and Python to extract video metadata and perform quality calculations. Users can execute a simple command to initiate the comparison, and the generated report includes detailed information about the video parameters, quality metrics, and visual comparisons. The report is self-contained, meaning it can be viewed offline without the need for a server, which makes it convenient for quick assessments or presentations.

Video Comparer is especially useful for those working with video content who need to evaluate the effectiveness of different codecs, analyze the impact of bitrate reduction, or simply compare the quality of videos before and after compression. The skill is designed to handle common video formats and provides clear error messages for troubleshooting, ensuring a smooth user experience.

Whether you are a video editor, a software developer working on media applications, or a designer needing to present video quality analyses, Video Comparer offers a straightforward and effective solution for your video comparison needs.

When to use it

Use this skill when you need to compare original and compressed videos or analyze video compression quality and efficiency.

When not to use it

This skill may not be suitable for real-time video processing or for analyzing videos larger than 500MB without adjustments.

What you can build with it

Comparing Original and Compressed Videos

Use this skill to evaluate the quality differences between an original video and its compressed version.

Analyzing Codec Performance

Assess how different codecs affect video quality and determine the best settings for compression.

Batch Processing of Videos

Automate the comparison of multiple video files by using a loop to generate reports for a batch of originals and compressed videos.

How to install Video Comparer

View source

1. Install with the skills CLI

npx skills add daymade/claude-code-skills/video-comparer --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by daymade

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

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

# 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):

# 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 styling

Frequently asked questions about Video Comparer

Similar skills