- H.264 Codec - Video compression standard
- AAC Audio - Audio compression
- UUID - Unique file identification
- Threading - Background processing
- Subprocess - FFmpeg integration
A modern web application for optimizing video files with lossless compression. Perfect for reducing file sizes while maintaining visual quality.
- π¬ Drag & Drop Upload: Easy file upload with drag-and-drop interface
- π Real-time Progress: Live progress tracking during optimization
- π File Size Comparison: Shows original vs optimized file sizes
- π― Lossless Compression: Uses H.264 with CRF 18 for visually lossless quality
- π± Responsive Design: Works on desktop and mobile devices
- ποΈ Multiple Formats: Supports MP4, AVI, MOV, MKV, WMV, FLV, WebM, M4V
- β‘ Background Processing: Non-blocking video optimization
- π§Ή Auto Cleanup: Automatically removes old files
- Python 3.7+ installed on your system
- FFmpeg installed and available in your PATH
sudo apt update
sudo apt install ffmpegbrew install ffmpegDownload from FFmpeg official website or use Chocolatey:
choco install ffmpeg- Clone or download this repository
- Navigate to the project directory
- Install Python dependencies:
pip install -r requirements.txt- Run the Flask application:
python app.py- Open your web browser and go to:
http://localhost:5000
- Upload Video: Drag and drop your video file onto the upload area or click to browse
- Monitor Progress: Watch the real-time progress bar and status updates
- Download Result: Once optimization is complete, click the download button to get your optimized video
The application uses the following FFmpeg settings for optimal compression:
- Video Codec: H.264 (libx264)
- Preset: veryslow (best compression)
- CRF: 18 (visually lossless quality)
- Audio Codec: AAC
- Audio Bitrate: 128k
- Web Optimization: Fast start enabled
optimiser/
βββ app.py # Main Flask application
βββ requirements.txt # Python dependencies
βββ README.md # This file
βββ templates/
β βββ index.html # Web interface
βββ uploads/ # Temporary upload directory
βββ output/ # Optimized video output directory
The application uses FFmpeg with the following optimization strategy:
- H.264 Codec: Industry standard for video compression
- CRF 18: Constant Rate Factor ensures visually lossless quality
- Veryslow Preset: Maximizes compression efficiency
- AAC Audio: Efficient audio compression
- Fast Start: Optimizes for web streaming
- Processing Speed: Depends on video length and system performance
- Compression Ratio: Typically 20-60% size reduction
- Quality: Visually lossless (CRF 18)
- Memory Usage: Minimal, processes files in chunks
- MP4 (recommended)
- AVI
- MOV
- MKV
- WMV
- FLV
- WebM
- M4V
- FFmpeg not found: Ensure FFmpeg is installed and in your system PATH
- Large file uploads: The application handles large files, but upload time depends on your internet connection
- Processing errors: Check that your video file is not corrupted and is in a supported format
- "No file selected": Make sure you've selected a video file
- "Invalid file type": Ensure your file is in a supported format
- "Optimization failed": Check your video file for corruption
python app.pyThe application runs on http://localhost:5000 with debug mode enabled.
You can modify the FFmpeg parameters in the optimize_video function in app.py:
cmd = [
'ffmpeg', '-i', input_path,
'-c:v', 'libx264', # Video codec
'-preset', 'veryslow', # Compression preset
'-crf', '18', # Quality setting (lower = better quality)
'-c:a', 'aac', # Audio codec
'-b:a', '128k', # Audio bitrate
'-movflags', '+faststart', # Web optimization
'-y', # Overwrite output
output_path
]This project is open source and available under the MIT License.
Feel free to submit issues, feature requests, or pull requests to improve this application.
