PyMontage
Automatic video slideshow creator with smart layouts and audio crossfading. Runs locally on your browser
Install / Use
/learn @Ariel-Gal/PyMontageREADME
🎬 PyMontage - Automatic Video Slideshow Creator
PyMontage is a powerful web-based application that automatically creates professional video slideshows from your photos and music. Upload your images, select a soundtrack, and let PyMontage do the rest!
Version 1.0.1 Release - Enhanced with Google Fonts integration, automatic server cleanup, and improved font management system.
✨ Features
- 🖼️ Smart Image Processing: Automatically organizes and displays photos with intelligent layouts (2x2 grids, 1x3 grids, collages, single images)
- 🎵 Audio Synchronization: Perfectly syncs slideshow duration with your background music
- 🎶 Multiple Soundtrack Support: Add multiple audio files with smooth crossfading between tracks
- 🎨 Flexible Layout Modes: Enable/disable specific layout types (Grid 2x2, Grid 1x3, Collage, Single)
- 📊 Real-time Progress Bar: Track video creation progress with detailed status updates
- ⚙️ Full Customization: Control resolution, timing, transitions, fonts, and quality settings
- 🎬 Professional Output: High-quality video output with smooth transitions and title cards
- 🔤 Custom Fonts: Choose from built-in Windows fonts or download from Google Fonts
- 🔎 Font Search: Search and instantly download any font from Google Fonts library
- 🧹 Auto Cleanup: Automatic cleanup of temporary files and cache on shutdown
- 🌐 Web Interface: Easy-to-use browser-based interface with drag-and-drop support
- 📱 Format Support: Supports JPG, PNG, HEIC, GIF, BMP, TIFF, WebP, and more
- 🎥 Hardware Acceleration: Automatic GPU detection for faster rendering (NVIDIA NVENC)
- 🗂️ Smart File Management: Add images incrementally, preview selections, and remove specific files
🚀 Quick Start
Prerequisites
- Python 3.8 or higher
- FFmpeg installed on your system (Download FFmpeg)
Installation
-
Clone the repository:
git clone https://github.com/Ariel-Gal/PyMontage.git cd PyMontage -
Create and activate virtual environment:
Windows:
python -m venv venv venv\Scripts\activatemacOS/Linux:
python -m venv venv source venv/bin/activate -
Install dependencies:
pip install -r requirements.txt -
Prepare media paths (pick one):
- Default (repo-relative): place photos in
input/photos/, background track asinput/audio.mp3, and ensureoutput/exists for the rendered video. - Custom paths: set env vars before running:
(macOS/Linux: useset PYMONTAGE_IMAGE_FOLDER="C:\path\to\photos" # Windows set PYMONTAGE_AUDIO_FILE="C:\path\to\music.mp3" set PYMONTAGE_OUTPUT_FILE="C:\path\to\slideshow.mp4"export VAR=value)
- Default (repo-relative): place photos in
-
Run the application:
python app.py -
Open your browser: Navigate to
http://127.0.0.1:5000
📖 Usage
- Upload Images:
- Click "Select Images" and choose multiple photos
- You can add more images later without removing previous selections
- Preview thumbnails show all selected images
- Remove specific images by clicking the × button
- Select Music:
- Upload one or more MP3/WAV files
- Multiple tracks will be smoothly crossfaded with adjustable overlap duration
- Total duration is calculated including crossfade transitions
- Add Titles (optional): Set custom intro and outro text
- Advanced Settings (optional): Click "Show Advanced Settings" to customize:
- Video Resolution: Choose from presets (720p to 4K) or custom dimensions
- Timing Settings: Control transition duration, intro/outro card duration, and pauses
- Layout Modes: Enable/disable specific layouts (Grid 2×2, Grid 1×3, Collage, Single)
- Display Weights: Adjust relative duration for each layout type
- Video Quality: Set FPS, bitrate, and compression quality
- Text Styling: Choose font family and adjust font sizes
- Image Processing: Set maximum image width for memory optimization
- Create Video:
- Click "Create & Download Video"
- Watch the progress bar for status updates
- Processing may take several minutes
- Download: Your video will automatically download when ready
⚙️ Configuration Options
Paths & environment variables
- Default (repo-relative): images in
input/photos/, audio ininput/audio.mp3, output tooutput/slideshow.mp4. - Override for CI/servers by setting
PYMONTAGE_IMAGE_FOLDER,PYMONTAGE_AUDIO_FILE,PYMONTAGE_OUTPUT_FILE.
Basic Settings
- Intro Text: Opening title displayed at the beginning
- Outro Text: Closing title displayed at the end
Advanced Settings
- Resolution: Synchronized presets (720p, 1080p, 2K, 4K) or custom dimensions
- Timing Settings:
- Transition Duration: Crossfade time between slides (0-3 seconds)
- Intro Card Duration: How long the opening title displays
- Outro Card Duration: How long the closing title displays
- Opening Pause: Black screen before intro (0-10 seconds)
- Closing Pause: Black screen after outro (0-10 seconds)
- Audio Settings:
- Audio Crossfade Duration: Smooth transition overlap between multiple soundtracks (0-10 seconds)
- Layout Modes: Select which layout types to enable:
- Grid 2×2: 4 horizontal images per slide
- Grid 1×3: 3 vertical images per slide
- Collage 1×2: 2 images per slide
- Single Image: 1 image per slide
- Display Weights: Relative duration for different slide types
- Grid Weight: Duration multiplier for 2×2 grid slides
- Triple Weight: Duration multiplier for 1×3 grid slides
- Collage Weight: Duration multiplier for 2-image slides
- Single Weight: Duration multiplier for single image slides
- Video Quality:
- FPS: 24 (cinematic), 30 (standard), or 60 (smooth)
- Bitrate: 2000k (low) to 15000k (ultra)
- CRF Quality: 18 (best quality) to 32 (smaller file)
- Text Styling:
- Font Family: Choose from built-in Windows fonts or search and download from Google Fonts
- Title Font Size: Size for intro/outro text (30-200)
- Date Font Size: Size for date overlays (20-150)
- Font Search: Live search to find and download fonts from Google Fonts library
- Image Processing:
- Max Image Width: Downscale images to save memory (1920-4800 pixels)
🛠️ Technical Details
Architecture
- Backend: Flask (Python web framework) with signal handlers for graceful shutdown
- Video Processing: MoviePy, OpenCV, FFmpeg
- Audio Analysis: librosa
- Frontend: HTML5, Bootstrap 5, vanilla JavaScript with async font management
- Font Management: Google Fonts API integration with local caching and automatic downloads
- Cleanup System: Automatic cleanup of temporary files, cache, and bytecode on exit
File Structure
PyMontage/
├── app.py # Flask web server
├── video_engine.py # Core video creation logic
├── templates/
│ └── index.html # Web interface
├── requirements.txt # Python dependencies
├── README.md # This file
├── input/
│ ├── photos/ # Default images location
│ └── audio.mp3 # Default soundtrack
└── output/ # Rendered videos (default target)
Supported Formats
- Images: JPG, JPEG, PNG, GIF, BMP, TIF, TIFF, WebP, HEIC, HEIF
- Audio: MP3, WAV, M4A, FLAC, OGG
- Output: MP4 (H.264 video, AAC audio)
🔧 Troubleshooting
FFmpeg Not Found
Ensure FFmpeg is installed and available in your system PATH:
ffmpeg -version
HEIC Images Not Working
Install pillow-heif for HEIC support (included in requirements.txt):
pip install pillow-heif
GPU Acceleration Not Working
- Ensure NVIDIA drivers are up to date
- Check CUDA installation
- The application will automatically fall back to CPU encoding if GPU is unavailable
Memory Issues with Large Images
The application automatically downscales images to optimize memory usage. Adjust the "Max Image Width" setting in Advanced Settings (default: 3840px).
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
👨💻 Author
Ariel Gal
- GitHub: @Ariel-Gal
🙏 Acknowledgments
- MoviePy - Video editing library
- Flask - Web framework
- Bootstrap - UI framework
- FFmpeg - Multimedia framework
📧 Support
If you encounter any issues or have questions, please open an issue on GitHub.
Made with ❤️ by Ariel Gal
Related Skills
claude-opus-4-5-migration
84.4kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
docs-writer
99.5k`docs-writer` skill instructions As an expert technical writer and editor for the Gemini CLI project, you produce accurate, clear, and consistent documentation. When asked to write, edit, or revie
model-usage
341.0kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
TrendRadar
50.0k⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。
