CLI Video Compressor
Pack is a simple yet powerful CLI video compressor.
It reduces file sizes by up to 60% while maintaining high quality, using FFmpeg under the hood. Compress individual videos or entire folders with ease.
Installation | Upgrade
You might be sure that you have installed Python 3.10+ and FFmpeg. The CLI app uses FFmpeg under the hood, so make sure you have it installed and added to your PATH.
pip install -U vidpack
Prerequisites
```console
# MacOS
brew install ffmpeg
# Ubuntu
sudo apt install ffmpeg
# ArchLinux
sudo pacman -S ffmpeg
# Fedora
sudo dnf install ffmpeg
```
Basic Usage
To compress a video or multiple videos, you will use the pack command, followed by the required input argument (a file or a directory).
pack INPUT [OPTIONS]
Options
Pack offers several options to customize the compression process:
--output,-o: Specifies the output file to save the compressed video.--quality,-q: Defines the video quality level (0-100). Default value: 75.--overwrite,-w: Overwrites the output file if it already exists.--delete-original,-d: Deletes the original video after successful compression.--codec,-c: Specifies the video codec to use for compression(h264,libx265). Default ish264.
Usage Examples
To compress a video named video.mp4, simply run:
pack video.mp4
This command will compress video.mp4 with default settings(quality: 75) and save the result as video_compressed.mp4 in the same directory.
Show more examples
Specify an output file
If you want to specify the name or location of the compressed file:
pack video.mp4 --output compressed/small_video.mp4
This command will compress video.mp4 and save the result as small_video.mp4 in the compressed directory.
Adjust compression quality
To compress a video with a specific quality (e.g., 60):
pack video.mp4 -q 60
This will compress the video with lower quality, resulting in a smaller file size.
Compress all videos in a directory
To compress all videos in a directory:
pack /path/to/my/videos
This command will compress all videos in the specified directory and save the results in the same directory.
Overwrite existing files
If you want to overwrite existing compressed files:
pack video.mp4 --output output.mp4 --overwrite
This will overwrite the file output.mp4 if it already exists.
Delete the original file after compression
To delete the original video file after successful compression:
pack video.mp4 --delete-original
The original video.mp4 will be deleted after compression.
Specify a video codec
To compress a video with a specific video codec (e.g., libx265):
pack video.mp4 --codec libx265
This will compress the video with the libx265 codec, resulting in a smaller file size. Currently, only h264 and libx265 codecs are supported.
Use multiple options
You can combine multiple options in a single command:
pack video.mp4 -o compressed.mp4 -q 80 -w -d
This command will compress video.mp4 with a quality of 80, save the result as compressed.mp4, overwrite if the file exists, delete the original, and display detailed information during the process.
Additional Notes
- The quality option (
-q) affects both visual quality and file size. A lower value will result in a smaller file but lower visual quality, while a higher value will maintain better quality but with a larger file size. - It's always recommended to backup your original videos before using the delete option (
-d).
Contributors
See my other projects
Metadata
Release files for vidpack 0.3.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vidpack-0.3.3.tar.gz | 8.3 kB | With provenance | Details for vidpack-0.3.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vidpack-0.3.3-py3-none-any.whl | Python 3 | none | any | Details for vidpack-0.3.3-py3-none-any.whl |
Total release size: 18.7 kB
Release files / vidpack-0.3.3.tar.gz
| Download URL | vidpack-0.3.3.tar.gz |
|---|---|
| Size | 8.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bf77287e5815a64b69b798104230957c6b2f0c7505d55df490c0e248e48cbda0
|
|
BLAKE2b-256 checksum How to use checksums |
41706eb2de0a2e5e7888d81ee0d7a5e3af6b790457891694ece6d7bbe1a1812d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 20, 2025.
Transparency logRelease files / vidpack-0.3.3-py3-none-any.whl
| Download URL | vidpack-0.3.3-py3-none-any.whl |
|---|---|
| Size | 10.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3bcfa7ecdc1e884eec539ec8e2a572ddda04b507526c86296bf90b412c18993e
|
|
BLAKE2b-256 checksum How to use checksums |
3e99cbf39f80bd78efcd4b289631ec1605af2d5c5ebe5807a727930976156203
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 20, 2025.
Transparency logSecurity for vidpack 0.3.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for vidpack-0.3.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 20, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.