An open API service indexing awesome lists of open source software.

https://github.com/kevin-pottier/videotoolbox

Python project to either compress a video file to the limit you want or to translate subtitle file. It now includes video upscaling
https://github.com/kevin-pottier/videotoolbox

easy-script ffmpeg ffmpeg-gui ffmpeg-script ffmprobe image-restoration python pytorch quick-script real-esrgan real-esrgan-gui script tkinter tkinter-gui tkinter-python video-upscaling

Last synced: about 2 months ago
JSON representation

Python project to either compress a video file to the limit you want or to translate subtitle file. It now includes video upscaling

Awesome Lists containing this project

README

          

# VideoCompress

Modern, user-friendly Python GUI for compressing one or multiple video files and translating subtitles, with per-file progress, ETA, advanced batch features, and a fast, responsive, multi-threaded subtitle translation workflow with GUI progress bar.

## Features
- Unified video compression: select one or multiple videos, all in one workflow.
- Batch mode: see all progress bars in a scrollable window, with per-file ETA.
- Modern UI: clean, dark-themed interface, clear fonts, colors, and spacing.
- Subtitle handling: for each video, choose to ignore, softcode, or hardcode subtitles.
- Efficient batch subtitle workflow: first select which videos need subtitles, then only configure those.
- Subtitle translation: translate .srt files between languages with a fast, multi-threaded workflow, real-time GUI progress bar, and completion notification.
- Robust error handling and user feedback throughout.

## Requirements
- Python 3.8+
- FFmpeg and FFprobe installed and available in your system PATH
- Python packages listed in `requirements.txt`:
- `colorama` (for colored terminal output)
- `pysrt` (for reading/writing subtitle files)
- `deep-translator` (for Google Translate API)
- `tkinter` (standard library)

## Usage
1. Install requirements:
`pip install -r requirements.txt`
2. Install FFmpeg and make sure it is in your system PATH.
3. Run the app:
`python main.py`
4. Choose a mode:
- **Video Compression**: Select one or more videos, configure subtitles, output format, and size. Batch mode shows a scrollable window with per-file progress and ETA.
- **Subtitle Translation**: Translate a subtitle file between languages. The translation is fast (multi-threaded), the GUI remains responsive, and a progress bar shows real-time status. When finished, a message box confirms completion and the window closes automatically.

## Major Changes
- Unified single and batch video compression into one workflow.
- Modernized all GUIs (fonts, colors, spacing, centering).
- Added scrollable progress window for batch compression.
- Improved subtitle workflow: select which videos need subtitles before configuring options.
- Per-file progress bars and ETA in batch mode.
- Robust error handling and user feedback throughout.

## License
MIT

## Making an .exe (Windows executable)
You can create a standalone `.exe` for easy sharing and use on Windows:

1. **Install PyInstaller** (if not already installed):
```bash
pip install pyinstaller
```

2. **Build the executable** (from the project folder):
```bash
pyinstaller --onefile --add-data "main.py;." --add-data "gui_helpers.py;." --add-data "gui_film.py;." --add-data "gui_subtitle.py;." --add-data "compression.py;." --add-data "utils.py;." main.py
```
- `--onefile`: Bundle everything into a single .exe
- `--add-data ";."`: Ensures each Python module is included (repeat for all .py files in the project)
- If you use additional data files (like themes), add them with more `--add-data` options.

3. **Find your .exe** in the `dist` folder as `main.exe`. You can rename it if you wish.

4. **Distribute**: Share the `.exe` file with others. They do not need Python installed.

**Note:**
- If you see missing module errors, add them with more `--add-data` or check your imports.

## Changelog

### July 2025
- Subtitle translation workflow now fully implemented:
- Uses Google Translate (deep-translator) to translate all lines between any supported languages.
- Fast, multi-threaded translation for speed.
- Real-time progress bar in the GUI (not just command line).
- Output saved as `_translated.srt`.
- GUI remains responsive during translation, and a completion message is shown when done.
- Requirements updated: now uses `colorama`, `pysrt`, and `deep-translator`.
- `.gitignore` and documentation updated to reflect new modular structure and ignored files.

## Troubleshooting

- Only third-party packages (like `colorama`) are listed in `requirements.txt`. Standard Python libraries such as `os`, `subprocess`, and `tkinter` are included with every Python installation and do not need to be installed separately. If you encounter errors about missing standard libraries, your Python installation may be broken—reinstall Python from the official website to fix this.

---
Feel free to modify the project for your own needs!