Got a massive media library eating up your storage? Thousands of photos, hours of videos, and gigs of audio files piling up? You’re not alone. The average smartphone user has thousands of photos, and video creators have terabytes of footage.
What if you could cut that storage by 60-90% without losing quality? That’s exactly what SmartMediaCompressor (MediaOptimizer Pro) does—intelligently compress your photos, videos, and audio while preserving all metadata.
SmartMediaCompressor is an enterprise-grade media compression tool that converts photos to WebP, videos to H.264/HEVC/AV1, and audio to FLAC—achieving 60-90% storage savings while preserving all metadata and folder structure!
What You’ll Learn
- How SmartMediaCompressor works
- How to set it up on your system
- How to use both GUI and CLI interfaces
- Tips for optimal compression settings
- Real-world use cases
What It Does
SmartMediaCompressor automatically converts your media to modern, efficient formats:
| Media Type | Converts To | Typical Savings |
|---|---|---|
| Photos | WebP | 50-80% smaller |
| Videos | H.264/HEVC/AV1 | 30-70% smaller |
| Audio | FLAC | 40-60% smaller |
The best part? All metadata (EXIF, GPS, timestamps) is preserved, and your folder structure stays exactly the same.
Key Features
📖 🖼️ Smart Photo Compression
Converts JPEG, PNG, TIFF, BMP, and RAW files to WebP format:
- 50-80% smaller file sizes
- Preserves EXIF, GPS, and timestamps
- Maintains transparency
- Adjustable quality (1-100, recommended: 85)
🎬 Advanced Video Optimization
Supports multiple modern codecs:
- H.264 - Best compatibility
- HEVC (H.265) - Great compression
- AV1 - Latest and most efficient
Adjustable CRF quality (0-51, recommended: 23 for near-lossless).
🎵 Lossless Audio Conversion
Convert audio to FLAC:
- 40-60% smaller than WAV
- Perfect lossless quality
- Preserves album art and metadata
- Compression levels 0-8
⚡ Batch Processing
Handle thousands of files effortlessly:
- Parallel processing uses all CPU cores
- Smart skipping of already-processed files
- Resume capability for interrupted operations
- Real-time progress tracking
📖 🛡️ Safety First
Your originals are always safe:
- Non-destructive: never modifies original files
- Checksum verification available
- Error recovery with multiple fallbacks
- Path validation and sanitization
📁 Preserved Structure
Maintains your organized library:
- Original folder hierarchy intact
- Files processed in-place or to destination
- Easy to locate processed files
Real-World Impact
| Scenario | Before | After | Savings |
|---|---|---|---|
| 10,000 Photos | 25 GB | 5 GB | 20 GB |
| 500 Videos | 100 GB | 40 GB | 60 GB |
| Audio Library | 50 GB | 25 GB | 25 GB |
| Total | 175 GB | 70 GB | 60% |
Installation
Step 1: Clone the Repository
git clone https://gitlab.com/krafi/smartmediacompressor.git
cd smartmediacompressor
Step 2: Install Python Dependencies
pip install -r requirements.txt
# For GUI (recommended)
pip install -r requirements_gui.txt
Step 3: Install System Dependencies
sudo apt update
sudo apt install ffmpeg libimage-exiftool-perl python3-pip python3-pil
brew install ffmpeg exiftool python
pip
# Download and3 install Pillow install:
# - FFmpeg: https://ffmpeg.org/
# - ExifTool: https://exiftool.org/
# Add both to system PATH
Usage
Option 1: GUI (Recommended for Beginners)
python3 run_with_gui.py
A beautiful interface opens where you can:
- Drag and drop folders
- Choose compression settings
- Start/stop processing
- Monitor progress
Option 2: Command Line Interface
# Scan a directory
python3 run.py scan /path/to/photos
# Compress with custom settings
python3 run.py compress /path/to/videos --dest /output/path
# Resume interrupted operation
python3 run.py resume
Option 3: Python API
from core import MediaOptimizerPro, CompressionConfig
# Initialize optimizer
optimizer = MediaOptimizerPro()
# Scan directory
results = optimizer.run_scan("/path/to/media")
# Compress with config
config = CompressionConfig(
photo_quality=85,
video_crf=23,
audio_compression=5
)
optimizer.run_compression("/source", "/destination", config)
Configuration Examples
Quality-Focused (Best Quality)
photo_quality = 95 # Near-perfect images
video_crf = 18 # Excellent video quality
audio_compression = 2 # Fast, good compression
Balanced (Recommended)
photo_quality = 85 # Great quality, good size
video_crf = 23 # Near lossless
audio_compression = 5 # Good compression
Maximum Compression
photo_quality = 70 # Smaller files, slight quality loss
video_crf = 28 # Smaller videos
audio_compression = 8 # Maximum compression
Use Cases
1. Free Up Phone Storage
Optimize photos and videos before backing up. Reclaim gigabytes of storage!
2. Cloud Storage Savings
Reduce storage costs for Google Drive, Dropbox, iCloud, etc. Smaller files = lower bills.
3. Website Optimization
Optimize media assets for faster page loads. Your visitors will thank you.
4. Content Creation
Manage large media libraries efficiently. Archive projects in compressed formats.
5. Digital Preservation
Create efficient archives of important memories. All metadata preserved!
6. Enterprise Media Management
Batch process thousands of files for corporate media libraries.
How It Works
The compression pipeline:
1. Scan → Find all media files
2. Analyze → Check file types and sizes
3. Convert → Process with FFmpeg/Pillow
4. Preserve → Copy metadata with ExifTool
5. Verify → Check output quality
6. Report → Show compression results
Technical Stack
- Python 3.8+ - Core logic
- FFmpeg - Video/audio encoding
- Pillow - Image processing
- ExifTool - Metadata preservation
- PySide6 - GUI (optional)
Troubleshooting
📖 FFmpeg not found?
- Verify installation:
ffmpeg -version - Add to PATH if needed
- Restart terminal
📖 Compression taking too long?
- Reduce parallel processes
- Use faster codec (H.264 instead of AV1)
- Increase CRF value for faster encoding
- Exclude already processed files
📖 Quality not good enough?
- Lower CRF value (e.g., 18 instead of 23)
- Increase photo quality (e.g., 90 instead of 85)
- Use slower preset for encoding
📖 Metadata not preserved?
- Verify ExifTool is installed
- Check file permissions
- Try running as administrator
Why This Project is Useful
SmartMediaCompressor solves real problems:
- Massive savings: 60-90% storage reduction
- Quality preserved: Near-lossless compression
- Metadata safe: EXIF, GPS, timestamps intact
- Flexible: GUI, CLI, or Python API
- Safe: Never touches originals
- Fast: Multi-core parallel processing
Combine with OpenCompressify (for Markdown images) and other tools to build a complete media workflow!
Conclusion
SmartMediaCompressor is a powerful tool for anyone dealing with large media libraries. Whether you’re a photographer, videographer, content creator, or just want to free up storage, it delivers professional-grade compression with minimal fuss.
Try it today and see how much storage you can reclaim!
Source Code
View and contribute to the project: SmartMediaCompressor on GitLab
Happy compressing!
Discussion
0 commentsJoin the Discussion
Sign in to post comments and join the conversation.
No comments yet. Be the first to share your thoughts!