Midjourney Video to Seamless Loop using FFmpeg - Complete Automation Script
Posted on - June 18, 2025 by Andy Cinquin
MidjourneyFFmpegSeamless LoopAI VideoWebP AnimationVideo ProcessingAutomationBash Script
An automatic Bash script to convert videos to seamlessly looping animated WebP files on Fedora, integrated into Nautilus context menu.
✨ Features
- Automatic conversion: Converts any video to animated WebP
- Seamless looping: Creates fade effect between end and beginning for perfect loops
- Context menu: Accessible directly via right-click on video files
- Notifications: Shows progress and results via system notifications
- Auto cleanup: Automatically removes temporary files
- Quality optimization: Balanced settings between quality and file size
🎯 Supported Formats
Input: MP4, AVI, MKV, MOV, WMV, FLV, WebM, 3GP, M4V Output: Animated WebP (30fps, infinite loop)
📋 Requirements
- Fedora Linux (tested on Fedora 38+)
- GNOME Desktop Environment with Nautilus
- Sudo access for installation
🚀 Quick Installation
-
Create the files below in a folder:
-
Copy the content of each script (see sections below)
-
Make the installation script executable:
-
Run the installation:
./install.sh
🎬 Usage
Via context menu (recommended)
- Open Nautilus (Files)
- Navigate to a folder containing videos
- Right-click on any video file
- Select "Convert to Animated WebP"
- Wait for conversion to complete (notifications shown)
- WebP file will be created with
_loop.webp
suffix
Via command line
video-to-webp.sh
📁 COMPLETE SCRIPTS TO CREATE
1. 📝 File: video-to-webp.sh
2. 🗂️ File: video-to-webp.desktop
3. 🚀 File: install.sh
4. 🧪 File: test.sh
📋 INSTALLATION INSTRUCTIONS
🚀 One-Time Installation:
you can also, copy the script into your folder share nautilus.
for me it's "/home/andycinquin/.local/share/nautilus/scripts"

⚙️ Advanced Configuration
Modify settings in
video-to-webp.sh
:FPS_INTERMEDIATE=24
🔧 Conversion Process
The script automatically performs 3 steps:
- Normalization: Convert to constant framerate (24fps)
- Seamless loop: Create fade between end and beginning
- WebP export: Final conversion to animated WebP (30fps)
🐛 Troubleshooting
Context menu doesn't appear
pkill nautilus && nautilus &
FFmpeg not found
Permission errors
Complete reinstallation
📊 Example Results
- 10MB MP4 video → ~2-3MB WebP
- Visual quality: Excellent for short animations
- Conversion time: ~30 seconds for 10 seconds of video
- Compatibility: Works in all modern browsers
🎯 Ideal Use Cases
- GIF replacement: Reduced size, superior quality
- Web animations: Optimized performance
- Social media: Modern and efficient format
- Presentations: Smooth and lightweight animations
🛠️ Uninstallation
To completely remove the system:
📁 File Structure
video-to-webp-converter/
├── video-to-webp.sh # Main conversion script
├── video-to-webp.desktop # Nautilus action file
├── install.sh # Automatic installation script
└── test.sh # Test and verification script
📝 Technical Notes
- Seamless loop: Uses FFmpeg's
xfade
for imperceptible fade - Optimization: CRF 18 to balance quality/size
- Cleanup: Automatic removal of temporary files
- Security: Input validation and robust error handling
🤝 Contributing
Feel free to report bugs or suggest improvements!
Author: Assistant
License: MIT
Version: 1.0.0
License: MIT
Version: 1.0.0
✨ Complete portable kit! Copy each script, install and enjoy one-click animated WebP conversion! ✨
🚀 Thanks for reading!
If you enjoyed this article, feel free to share it around.
💡 Got an idea? Let's talk !☕