Video Compressor and Trimmer
A pure Python web application for compressing and trimming videos with high accuracy. The application uses 2-pass encoding to ensure the output file size matches the target size specified by the user.
Features
- Video Trimming: Specify start and end times for the output.
- Custom Resolution: Choose from 1080p, 720p, 480p, 360p, or keep original.
- Frame Rate Control: Adjust FPS to further reduce file size.
- Exact Target Size: Specify the output size in MB.
- History Tracking: Keep a local record of all compression tasks in a SQLite database.
Prerequisites
- Python 3.8 or higher.
- FFmpeg must be installed on your system and added to your PATH.
- Windows:
winget install ffmpeg - macOS:
brew install ffmpeg - Linux:
sudo apt install ffmpeg
- Windows:
Installation
- Clone the repository or download the source code.
- Navigate to the project directory.
- Create a virtual environment:
python -m venv venv - Activate the virtual environment:
- Windows:
.\venv\Scripts\activate - macOS/Linux:
source venv/bin/activate
- Windows:
- Install the required dependencies:
pip install -r requirements.txt
Usage
- Run the Streamlit application:
streamlit run app.py - Open the URL provided in your terminal (usually
http://localhost:8501). - Upload a video file (MP4, MOV, AVI, MKV).
- Configure your compression settings in the sidebar or main panel:
- Set start and end times for trimming.
- Select desired resolution and FPS.
- Enter the target output size in MB.
- Click the "Compress & Export" button.
- Once processing is complete, download your compressed video.
- Check the "History" tab to view past compression details.
License
This project is licensed under the MIT License - see the LICENSE file for details.