Files

126 lines
4.6 KiB
Markdown

# Bolt Compress
A local desktop app for batch-compressing and resizing videos and images. Drop in a
handful of files, choose how small you want them, and hit compress. No uploads, no
accounts, no waiting on a website.
Built with **PyQt6**, **Pillow**, and **FFmpeg**.
![Bolt Compress screenshot](docs/screenshot.png)
## Features
- **Drag and drop batch queue** for images, videos, or a mix of both
- **Image tools** — resize to a bounding box, scale by percentage, or keep dimensions;
save as JPEG, WebP, PNG, or the original format; adjust quality; keep or strip metadata
- **Video tools** — H.264, H.265, VP9, and AV1 encoders; quality (CRF), encoding speed,
resolution, and audio bitrate controls
- **Per-file progress and status** with before/after sizes and percentage saved
- **Cancellable background encoding** so the interface stays responsive
- **Output next to originals or in a folder you choose**; existing files are never overwritten
- **Remembers settings** between launches
- **100% offline** — files are processed entirely on your machine
## Requirements
- Python 3.9 or newer
- PyQt6 and Pillow (`requirements.txt`)
- **FFmpeg and ffprobe on `PATH`** for video compression. Images work without FFmpeg.
On Windows, FFmpeg can be installed with:
```powershell
winget install Gyan.FFmpeg
```
Make sure both `ffmpeg` and `ffprobe` resolve from a terminal after installation:
```powershell
ffmpeg -version
ffprobe -version
```
If you prefer not to modify `PATH`, put `ffmpeg.exe` and `ffprobe.exe` in a `bin`
folder beside `app.py`, or point the `BOLT_FFMPEG_DIR` environment variable at the
folder that contains them.
## Run it
```powershell
python -m pip install -r requirements.txt
python app.py
```
Or double-click **`run.bat`** on Windows. You can also pass files or folders directly:
```powershell
python app.py "C:\Videos\holiday.mp4" "C:\Photos"
```
Bolt Compress is also runnable as a module:
```powershell
python -m bolt_compress
```
## How to use it
1. Drag media into the window, or use **Add files** / **Add folder**.
2. Choose **Images** or **Videos** in the settings panel and tune the options.
3. Pick an output destination (or leave it on *Next to originals*).
4. Press **Compress**.
Output filenames use the suffix `-compressed`. If that file already exists,
`-compressed (2)`, `-compressed (3)`, and so on are used. Originals are never modified.
Files that already have a result are skipped on the next run, so you can add more media
without reprocessing the whole batch. Once everything in the queue is finished, the
button changes to **Compress again** if you want a fresh set of copies with new settings.
## Supported formats
**Images in:** JPG/JPEG, PNG, WebP, BMP, TIFF
**Images out:** original format, JPEG, WebP, or PNG
**Videos in:** MP4, MOV, MKV, AVI, WebM, M4V, MPEG, WMV, FLV, TS, 3GP, MTS, M2TS
**Videos out:** MP4 (H.264/H.265) or WebM (VP9/AV1)
Animated images (GIF, APNG, animated WebP) are not supported yet. Multi-page TIFFs are
also skipped to avoid silently dropping frames.
## Notes on video encoding
- The quality slider maps to each codec's CRF value: higher means better quality and a
larger file. The default (`68`) is a good balance for H.264.
- **AV1** produces excellent compression but can be extremely slow. The **Fast** speed
setting is recommended for long videos.
- Resizing caps the shorter edge at the selected resolution and never upscales. For
example, 1080p gives a landscape video a height of 1080 and a portrait video a width
of 1080.
- Audio is re-encoded to AAC for MP4 and Opus for WebM, or removed entirely.
- Only the primary video stream and the audio tracks are carried over. Subtitle and data
tracks are omitted.
- Output video is 8-bit 4:2:0 for broad player compatibility. HDR sources are converted,
so their colors may look different.
- Video metadata is stripped by default to maximize savings; enable **Keep metadata**
if you need chapters or global tags.
## Project layout
```
app.py Launcher
bolt_compress/
app.py Application setup and entry point
main_window.py Main window, queue, drag/drop, destinations
settings_panel.py Image and video settings UI
processing.py Pillow/FFmpeg engines and background worker
media.py Probing, path handling, FFmpeg discovery
models.py Shared data models
theme.py Dark theme, app mark, media icons
widgets.py Empty-state drop target
assets/ Small SVG assets used by the stylesheet
run.bat Windows launcher
requirements.txt
docs/screenshot.png Interface preview
```