A bash script that creates professional MP4 slideshows from a folder of images using FFmpeg.
- âś… Supports multiple image formats (PNG, JPG, JPEG, GIF, BMP, TIFF, HEIC, HEIF)
- âś… Configurable photo duration (default: 5 seconds)
- âś… Automatic resolution normalization to web-friendly 1920x1080
- âś… Ken Burns effect with randomized pan/zoom directions for cinematic motion
- âś… Blurred backgrounds using dominant colors from each image (no more black bars!)
- âś… Date overlays - Automatically extracts and displays photo dates from EXIF metadata
- âś… Title slide - Add a custom title screen at the beginning of your slideshow
- âś… Image sorting - Sort by filename, EXIF date taken, or file creation date
- âś… Background music - Add one or more MP3 files with auto-calculated photo timing
- âś… Multiple transition effects: fade, wipe, slide, or random
- âś… Proper portrait/landscape handling with auto-orientation
- âś… Parallel image processing for faster performance (4x speedup with GNU Parallel)
- âś… Temporary file management for optimized processing
- âś… MP4 output format
- FFmpeg: Core video processing engine
sudo apt-get install ffmpeg
- ImageMagick: Better image preprocessing
sudo apt-get install imagemagick
- ExifTool: For date metadata extraction and overlay
sudo apt-get install libimage-exiftool-perl
- GNU Parallel: For parallel image processing (4x faster)
sudo apt-get install parallel
- Clone or download this repository
- Make the script executable (already done):
chmod +x create_slideshow.sh
./create_slideshow.sh -s /path/to/photos./create_slideshow.sh -s SOURCE_FOLDER [OPTIONS]| Option | Description | Default |
|---|---|---|
-s, --source |
Source folder with images (required) | - |
-d, --duration |
Duration each photo is shown (seconds) | 5 |
-t, --transition |
Transition type: fade, wipe, slide, random | fade |
-k, --ken-burns |
Enable Ken Burns effect (pan/zoom) | disabled |
-o, --output |
Output filename | slideshow_TIMESTAMP.mp4 |
-r, --resolution |
Output resolution (WxH) | 1920x1080 |
--title |
Add title slide with specified text | none |
--sort |
Sort order: filename, date, created | filename |
-m, --music |
Add music file (mp3). Can be used multiple times | none |
-h, --help |
Show help message | - |
./create_slideshow.sh -s ./vacation_photos./create_slideshow.sh -s ./wedding_photos -d 7 -t random -k./create_slideshow.sh -s ./photos -d 3 -t fade -o my_slideshow.mp4./create_slideshow.sh -s ./photos --title "Our Family Vacation 2025"./create_slideshow.sh -s ./photos --sort date./create_slideshow.sh -s ./photos -m song1.mp3 -m song2.mp3 -t random./create_slideshow.sh -s ./photos -r 1280x720- fade: Smooth fade between images
- wipe: Left-to-right wipe transition
- slide: Sliding transition effect
- random: Randomly select from fade, wipe, and slide for each transition
The Ken Burns effect adds cinematic motion to still images by slowly panning and zooming. Each image gets a random direction (left, right, up, or down) with a smooth zoom for varied, professional-looking motion. Enable with the -k flag:
./create_slideshow.sh -s ./photos -kFeatures:
- Random pan direction for each image (left/right/up/down)
- Smooth zoom from 1.0x to 1.1-1.2x
- Optimized for performance with simplified algorithm
- Automatic use of "faster" encoding preset
Instead of black letterbox/pillarbox bars, the script creates a blurred, color-matched background from each image:
- Background is a blurred, zoomed version of the image
- Uses dominant colors from the photo
- Sharp image centered on top
- Professional Instagram/social media style
- Automatically applied to all portrait and non-16:9 images
Add a custom title slide at the beginning of your slideshow with the --title option. The title appears as white text centered on a black background.
Features:
- Simple, elegant black background with white text
- Centered 72-point font
- Same duration as your photo duration setting
- Transitions smoothly into your first photo
Example:
./create_slideshow.sh -s ./photos --title "Summer Vacation 2025" -d 5The title slide will be shown for 5 seconds before transitioning to the first photo.
Add background music to your slideshow with automatic timing! The script automatically calculates photo duration to perfectly match your music length.
Features:
- Multiple files: Add one or more MP3 files using
-mflag multiple times - Auto-timing: Photo duration is automatically calculated to match total music length
- Smart concatenation: Multiple songs are joined with 2-second silence between them
- Perfect sync: Video length matches music length exactly (with
-shortestflag)
How it works:
Total duration = Music1 + 2sec + Music2 + 2sec + Music3...
Photo duration = Total duration / Number of images
Examples:
# Single music file
./create_slideshow.sh -s ./photos -m background_music.mp3
# Multiple music files (automatically concatenated)
./create_slideshow.sh -s ./wedding_photos -m ceremony.mp3 -m reception.mp3 -m dance.mp3
# Music with title slide and sorting
./create_slideshow.sh -s ./photos --title "Our Journey" --sort date -m soundtrack.mp3 -t randomNote: When music is provided, the -d duration parameter is ignored as timing is auto-calculated.
Control the order of images in your slideshow with the --sort option:
Sort Options:
- filename (default): Alphabetical order by filename
- date: Chronological order by EXIF date taken (DateTimeOriginal or CreateDate)
- created: Chronological order by file creation/modification time
Features:
- date mode: Extracts EXIF metadata (requires exiftool), falls back to file time if no EXIF data
- created mode: Uses file system creation/modification timestamp
- All modes sort in ascending order (oldest to newest, A to Z)
Examples:
# Sort by date taken from EXIF metadata
./create_slideshow.sh -s ./photos --sort date
# Sort by file creation time
./create_slideshow.sh -s ./photos --sort created
# Default alphabetical sorting (no --sort needed)
./create_slideshow.sh -s ./photosPerfect for chronological vacation slideshows or organizing photos by their actual capture date!
Photos with EXIF metadata automatically get a date overlay in the lower right corner:
- Extracts date from
DateTimeOriginalorCreateDateEXIF tags - Formatted as: "Monday, January 1, 2020"
- Displayed on a semi-transparent dark gradient background
- White text for excellent readability
- Only shown when date metadata is available
- Requires
exiftool(install:sudo apt-get install libimage-exiftool-perl)
- Output Format: MP4 (H.264 codec)
- Default Resolution: 1920x1080 (Full HD)
- Frame Rate: 25 fps
- Transition Duration: 1 second (hardcoded)
- Image Processing:
- Auto-orientation applied to fix rotated images
- Portrait/landscape detection with blurred color-matched backgrounds
- Parallel processing with GNU Parallel (4 concurrent jobs)
- Images preprocessed to PNG for consistent processing
- Ken Burns: Uses zoompan filter with trim for precise duration control
- Encoding:
- Default preset: "medium" for quality
- Ken Burns preset: "faster" for performance
- CRF 23 for balanced quality/size
- Temporary Files: Automatically cleaned up after processing
- Ensure your source folder contains supported image formats
- Check that the path is correct
- Make sure FFmpeg is installed:
ffmpeg -version - Update FFmpeg to the latest version if you encounter filter issues
- The script will work without ImageMagick but with slightly reduced image quality
- Install ImageMagick for best results
- Reduce the resolution with
-r 1280x720 - Process fewer images at a time
- Use lower resolution for faster processing:
-r 1280x720 - Disable Ken Burns effect if not needed (it's more CPU intensive)
- Install GNU Parallel for faster image processing:
sudo apt-get install parallel - Preprocess images to similar sizes before running the script
- The script automatically converts high-res images to web resolution for efficiency
- Ken Burns effect uses a simplified algorithm and faster encoding preset for better performance
If GNU Parallel is installed, the script will automatically process images concurrently (4 at a time), significantly speeding up the preprocessing phase:
sudo apt-get install parallel# Create a test folder with some images
mkdir test_photos
cp ~/Pictures/*.jpg test_photos/
# Create a basic slideshow (no Ken Burns, fade transitions)
./create_slideshow.sh -s test_photos
# Create a professional slideshow with all features
./create_slideshow.sh -s test_photos \
-d 6 \
-t random \
-k \
-o my_awesome_slideshow.mp4What you get:
- 6 seconds per photo
- Random transitions (fade/wipe/slide)
- Ken Burns effect with varied pan directions
- Blurred backgrounds for portrait images
- Professional, polished output
- v1.7 - Background music support with auto-calculated photo timing
- v1.6 - Image sorting by filename, EXIF date taken, or file creation date
- v1.5 - Title slide feature with custom text on black background
- v1.4 - Automatic date overlays from EXIF metadata with gradient backgrounds
- v1.3 - Blurred color-matched backgrounds instead of black bars
- v1.2 - Randomized Ken Burns pan directions (left/right/up/down)
- v1.1 - Performance optimizations with GNU Parallel support
- v1.0 - Initial release with transitions and Ken Burns effect
Free to use and modify.
Feel free to submit issues and enhancement requests!