12afbdf34306d4d431fa16f84956d48f43cf1ba3
Synology Thumbnail Generator
A Python script that generates thumbnails for Synology Photo Station, optimized for video formats and files that the NAS doesn't handle well.
🚀 Major Features
⚡ Ultra-Fast Icaros Cache Integration
- Instant thumbnails from Icaros cache (milliseconds vs seconds)
- Alphabetical algorithm discovered and implemented
- 1920x1080 source quality from cache
- Automatic fallback to Windows providers and FFmpeg
🎯 Supported Formats
- Videos: mp4, webm, avi, mkv, mov, wmv, flv, m4v, ts
- Images: psd (Photoshop), blend (Blender)
- Optimized for formats Synology doesn't handle well
🔄 Multi-Tier Processing
- Icaros Cache (fastest - milliseconds)
- Windows Thumbnail Providers (fast - seconds)
- FFmpeg/Direct Processing (slower - reliable fallback)
🎉 Performance Breakthrough
Before: 5-10 seconds per video thumbnail (FFmpeg only)
After: ~50 milliseconds per video thumbnail (Icaros cache)
Speedup: 100-200x faster for cached videos!
📋 Requirements
- Python 3.6+
- PIL/Pillow:
pip install Pillow - FFmpeg (for unsupported formats): https://ffmpeg.org/download.html
- Icaros (optional, for ultra-fast thumbnails): http://carlosdelgado.com/
Optional Dependencies
psd-tools: For direct PSD processing (pip install psd-tools)olefile: For advanced cache integration (pip install olefile)
💻 Usage
python psthumbgen.py --directory "R:\Your\Video\Directory"
The script will:
- Try Icaros cache first (if available)
- Fall back to Windows providers
- Use FFmpeg as final fallback
- Generate all Synology thumbnail sizes
🔧 Icaros Integration
Automatic Detection
The script automatically detects and uses Icaros cache from:
C:\Program Files\Icaros\IcarosCache\C:\Program Files (x86)\Icaros\IcarosCache\%LocalAppData%\Icaros\IcarosCache\%AppData%\Icaros\IcarosCache\
Algorithm Discovery
After extensive analysis, we discovered Icaros uses alphabetical sorting for cache mapping:
- Collect all video files from monitored directories
- Sort alphabetically (case-insensitive)
- Map position in sorted list to cache index
- Extract thumbnail directly from binary cache
📁 Output Structure
For each video file, creates:
video_directory/
├── eaDir_tmp/
│ └── video_file.mp4/
│ ├── SYNOVIDEO_VIDEO_SCREENSHOT.jpg (1280px)
│ ├── SYNOPHOTO_THUMB_XL.jpg (1280px)
│ ├── SYNOPHOTO_THUMB_B.jpg (640px)
│ ├── SYNOPHOTO_THUMB_M.jpg (320px)
│ ├── SYNOPHOTO_THUMB_PREVIEW.jpg (160px)
│ └── SYNOPHOTO_THUMB_S.jpg (120px)
🎯 Use Cases
- Video Libraries: Fast thumbnails for large video collections
- Creative Files: PSD and Blender file previews
- Network Shares: Works with SMB/network drives
- Synology NAS: Perfect for Photo Station integration
🛠️ Technical Details
Icaros Cache Format
- Binary format:
.icdbfiles containing JPEG thumbnails - Index structure:
ICDBsignature with embedded JPEGs - Multiple sizes: Typically 96px, 1280px, 2560px variants
- Alphabetical mapping: Direct position-based extraction
Windows Integration
- Uses Windows thumbnail providers via shell32
- Supports formats with installed codec packs
- Faster than FFmpeg for supported formats
- Automatic format detection and fallback
🔍 Troubleshooting
No Icaros Cache Found
- Install Icaros: http://carlosdelgado.com/
- Configure monitored directories in IcarosConfig
- Rebuild cache for current files
FFmpeg Not Found
- Download from: https://ffmpeg.org/download.html
- Add to system PATH
- Restart command prompt/PowerShell
Slow Performance
- Install Icaros for 100-200x speedup
- Enable hardware acceleration in graphics drivers
- Use SSD storage for cache
📊 Algorithm Research
This project involved extensive reverse engineering of Icaros cache format:
- ✅ Alphabetical sorting algorithm discovered
- ❌ Hash-based approaches (MD5, CRC32, Windows hash) all failed
- 🔬 106 cache entries analyzed and mapped
- 🎯 Verification through manual thumbnail content checking
🤝 Contributing
Contributions welcome! Areas for improvement:
- Additional video format support
- Performance optimizations
- Cache format documentation
- Cross-platform compatibility
📄 License
This project is provided as-is for educational and personal use.
🎉 Achievement Unlocked: Ultra-Fast Thumbnail Generation!
Description
Languages
Python
75.6%
PowerShell
11.5%
Batchfile
7.3%
Shell
5.6%