Simple script to traverse all the video files and compress them to optimize disk space for large files
Project description
🖥️ About
Welcome to the HandbrakeCLI Batch Compressor project!
This application is designed to compress video files in bulk using the HandbrakeCLI. It offers many features to customize the compression process such as:
- deletion of original files
- show statistics during and after the compression
- smart filtering and skipping of files based on your specified rules (see usage)
📑 Table of Contents
✨ Features
- Bulk Compression: Compress multiple video files at once using HandbrakeCLI.
- Custom Compression Options: Pass any options available in HandbrakeCLI, like encoders and quality settings.
- File Management: Automatically detect compressed and incomplete files if your process is interrupted.
- Filter Features: Smart filters allow skipping videos that don't meet your criteria (e.g., resolution, bitrate, or frame rate).
- Statistics: Optionally display compression stats during and after the process.
- Replace Original Files: Automatically delete original files if they are successfully compressed.
- Automatic Installation: Automatically install HandbrakeCLI and dependencies if not already installed.
📸 Screenshots
🛠️ Installation
-
Install python:
- Window:
winget install Python.Python.3.12
- Linux:
sudo apt-get install python3
- macOS:
brew install python
- Window:
-
Install the handbrake-batch-compressor package:
pip install handbrake-batch-compressor
-
Run the application:
handbrake-batch-compressor --help
🚀 Usage and Examples
Highly recommended to see both --help and --guide before compression.
⚙️ Advanced Usage
You can specify more options such as HandbrakeCLI settings, file extensions, and whether to delete the originals after processing.
python main.py -t ./videos -o "--encoder x264 --quality 20" \
--progress-extension c \
--complete-extension x \
--show-stats \
--effective-compression-behavior delete_original \
--ineffective-compression-behavior delete_compressed
🧠 Smart Filters
Smart filters allow you to apply conditions that control which videos will be processed based on their characteristics.
- Minimum Bitrate: Skips videos with a bitrate lower than the specified value.
- Minimum Frame Rate: Skips videos with a frame rate lower than the specified value.
- Minimum Resolution: Skips videos with a resolution lower than the specified threshold.
These filters help avoid unnecessary processing of low-quality videos.
📜 License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file handbrake_batch_compressor-3.0.0.tar.gz.
File metadata
- Download URL: handbrake_batch_compressor-3.0.0.tar.gz
- Upload date:
- Size: 17.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d73d69c2afa35b0afa8e6b576716155732526e6edd593b759966cbd8b412b998
|
|
| MD5 |
5069943c9738d25992e07ea5f75f2b79
|
|
| BLAKE2b-256 |
a43c940dbc413509545b485e924eab15c135c8fc71ded563ff91acbf3cfc24a2
|
Provenance
The following attestation bundles were made for handbrake_batch_compressor-3.0.0.tar.gz:
Publisher:
release.yaml on Glitchy-Sheep/handbrake-batch-compressor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
handbrake_batch_compressor-3.0.0.tar.gz -
Subject digest:
d73d69c2afa35b0afa8e6b576716155732526e6edd593b759966cbd8b412b998 - Sigstore transparency entry: 173491395
- Sigstore integration time:
-
Permalink:
Glitchy-Sheep/handbrake-batch-compressor@df5506d7dbc0c70b1157a0d2240148c2b14ae633 -
Branch / Tag:
refs/tags/3.0.0 - Owner: https://github.com/Glitchy-Sheep
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@df5506d7dbc0c70b1157a0d2240148c2b14ae633 -
Trigger Event:
push
-
Statement type:
File details
Details for the file handbrake_batch_compressor-3.0.0-py3-none-any.whl.
File metadata
- Download URL: handbrake_batch_compressor-3.0.0-py3-none-any.whl
- Upload date:
- Size: 24.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e76cab2514df0cd7f1fcd5a466d3bbd1201abdecb7cde5dba53e99292541e593
|
|
| MD5 |
2f715413b596b94bfb58b688cac0989e
|
|
| BLAKE2b-256 |
4fbcdba8a74041aabf0010989e6995a49cb48ab4b71bc752e10012b784a90826
|
Provenance
The following attestation bundles were made for handbrake_batch_compressor-3.0.0-py3-none-any.whl:
Publisher:
release.yaml on Glitchy-Sheep/handbrake-batch-compressor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
handbrake_batch_compressor-3.0.0-py3-none-any.whl -
Subject digest:
e76cab2514df0cd7f1fcd5a466d3bbd1201abdecb7cde5dba53e99292541e593 - Sigstore transparency entry: 173491396
- Sigstore integration time:
-
Permalink:
Glitchy-Sheep/handbrake-batch-compressor@df5506d7dbc0c70b1157a0d2240148c2b14ae633 -
Branch / Tag:
refs/tags/3.0.0 - Owner: https://github.com/Glitchy-Sheep
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@df5506d7dbc0c70b1157a0d2240148c2b14ae633 -
Trigger Event:
push
-
Statement type: