2025-10-15 18:28:09 -06:00
2025-10-15 18:28:09 -06:00
2025-06-27 09:03:31 -06:00
2014-07-19 08:40:52 +02:00
2025-06-27 09:03:31 -06:00
2025-10-15 18:28:09 -06:00
2025-07-01 23:27:50 -06:00
2025-10-15 18:28:09 -06:00
2025-10-12 16:08:36 -06:00
2025-07-01 23:27:50 -06:00

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

  1. Icaros Cache (fastest - milliseconds)
  2. Windows Thumbnail Providers (fast - seconds)
  3. 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

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:

  1. Try Icaros cache first (if available)
  2. Fall back to Windows providers
  3. Use FFmpeg as final fallback
  4. 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:

  1. Collect all video files from monitored directories
  2. Sort alphabetically (case-insensitive)
  3. Map position in sorted list to cache index
  4. 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: .icdb files containing JPEG thumbnails
  • Index structure: ICDB signature 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

FFmpeg Not Found

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
No description provided
Readme 436 KiB
Languages
Python 75.6%
PowerShell 11.5%
Batchfile 7.3%
Shell 5.6%