100% Local β’ Zero Cloud Egress β’ Sub-Second Rescans with SQLite Caching
Finding duplicate videos is hard when files have been:
- π Horizontally flipped / mirrored (common on social media platforms)
- π Rescaled to different resolutions (e.g. 4K original vs 1080p / 720p clips)
- ποΈ Re-encoded with different bitrates or codecs (H.264, HEVC, AV1, VP9)
- β±οΈ Slightly trimmed or adjusted
Traditional byte-hashing (MD5/SHA256) fails on all of these. dedupr extracts normalized perceptual keyframe hashes across both standard and mirrored orientations, detects near-duplicates with sub-frame accuracy, elects the best master video, and organizes your media library according to customizable metadata rules.
- πͺ Mirror & Flip Invariant: Detects videos even when flipped horizontally.
- β‘ GPU & Multi-Core Acceleration: Leverages your NVIDIA RTX GPU (CUDA / NVDEC / D3D11VA) and multi-threaded CPU worker pools for lightning-fast scanning.
- π Automatic Master Election: Elects the highest quality copy (best resolution, highest bitrate, original orientation) and isolates lower-quality dupes to a quarantine folder.
- π Smart Template Routing: Dynamically organize collections using rich metadata templates:
{resolution}/{codec}/{year}-{month}or custom regex group patterns. - β‘ Instant Incremental Rescans: SQLite database caching ensures already-processed videos are skipped on subsequent runs.
- π‘οΈ Safe Dry-Run Simulation: Preview every duplicate match and file action before writing a single byte to disk.
- π 100% Local & Private: No cloud APIs, zero telemetry, no network calls.
flowchart LR
A["π₯ Video Library"] --> B["β‘ Multi-Threaded Scanner"]
B --> C["π Metadata & GPU Decoder"]
C --> D[("πΎ SQLite Cache (.dedupr.db)")]
C --> E["πΌοΈ Dual-Orientation Perceptual Fingerprinter"]
E --> F["π Duplicate Clusterer & Master Election"]
F --> G["π‘οΈ Quarantine Duplicates"]
F --> H["ποΈ Template & Regex Router"]
H --> I["β¨ Clean Organized Media Library"]
- Python 3.10+
- FFmpeg (recommended for GPU HW acceleration)
# Clone the repository
git clone https://github.com/kaiser62/dedupr.git
cd dedupr
# Create and activate virtual environment
python -m venv .venv
# Windows (PowerShell)
.\.venv\Scripts\Activate.ps1
# Linux / macOS
source .venv/bin/activate
# Install in editable mode
pip install -e .Fast multi-threaded scan of your video library. Fingerprints are indexed in .dedupr.db.
# Basic scan (auto-detects CPU cores & GPU)
dedupr scan "C:/Videos"
# High-performance scan with 16 workers and CUDA hardware decoding
dedupr scan "C:/Videos" --workers 16 --hwaccel cudaScans for duplicate groups (exact, resized, mirrored, re-encoded) and isolates lower quality copies into duplicates/.
# 1. Preview duplicate clusters safely without moving any files
dedupr dedup "C:/Videos" --dry-run
# 2. Execute deduplication and quarantine duplicates
dedupr dedup "C:/Videos" --workers 8 --hwaccel cuda
# Export duplicate report to JSON
dedupr dedup "C:/Videos" --json > duplicates_report.jsonβββββββββββββββββββββββ³βββββββββββββββββββββ³βββββββββββββββ³ββββββββββββββ³βββββββββββ³βββββββββββ
β Status β Filename β Relationship β Resolution β Size β Bitrate β
β‘ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©
β MASTER (Keep) β clip_master.mp4 β Original β 4K (3840x2160)β 1.25 GB β 45000 kbpsβ
β DUPLICATE β clip_mirror_720.mp4β MIRRORED β 720p (1280x720)β 142 MB β 4200 kbpsβ
β DUPLICATE β clip_1080p_reenc.mp4β RESIZED β 1080p (1920x1080)β 450 MBβ 8000 kbpsβ
βββββββββββββββββββββββ΄βββββββββββββββββββββ΄βββββββββββββββ΄ββββββββββββββ΄βββββββββββ΄βββββββββββ
Organize messy video folders into structured directories using metadata templates.
# Organize by Resolution, Codec, and Date
dedupr sort "C:/Videos" "C:/SortedVideos" \
--template "{resolution}/{codec}/{year}-{month}" \
--mode move \
--dry-run| Variable | Description | Example |
|---|---|---|
{resolution} |
Resolution category | 4K, 1440p, 1080p, 720p, 480p |
{codec} |
Video compression codec | h264, hevc, vp9, av1 |
{audio_codec} |
Audio compression codec | aac, mp3, opus, none |
{fps} |
Frames per second | 60, 30, 24 |
{aspect} |
Aspect ratio | 16-9, 9-16, 4-3, 1-1 |
{year} |
Creation / modification year | 2026 |
{month} |
Creation / modification month | 08 |
{day} |
Creation / modification day | 29 |
{ext} |
Original file extension | mp4, mkv, mov |
Runs the complete scan, deduplication, quarantine, and library organization in a single command:
dedupr all "C:/RawVideos" "C:/CleanMediaLibrary" --workers 8 --hwaccel cudaUsage: dedupr [OPTIONS] COMMAND [ARGS]...
Commands:
scan Scan video files, extract metadata & perceptual fingerprints.
dedup Find and isolate near-duplicates (mirrored, re-scaled, re-encoded).
sort Sort and organize videos into structured subdirectories.
all Full pipeline: scan + dedup + sort clean masters.
Global Options:
-w, --workers INTEGER Number of worker threads (default: auto CPU count).
-g, --hwaccel TEXT GPU hardware acceleration: auto, cuda, d3d11va, none.
-n, --dry-run Simulate actions without touching disk.
--json Export results as JSON.
pytest -vDistributed under the MIT License. See LICENSE for more information.