Metadata-Version: 2.4
Name: video-compress
Version: 0.3.1
Summary: Compress video by 90% without losing much quality, similar to what Pied Piper achieves.
Project-URL: Repository, https://github.com/jiacai2050/my-works/tree/main/video-compress
Project-URL: Issues, https://github.com/jiacai2050/my-works/issues
Author-email: Jiacai Liu <dev@liujiacai.net>
License-Expression: GPL-3.0
License-File: LICENSE
Keywords: compress,ffmpeg,videos
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Software Development
Requires-Python: >=3.6.0
Provides-Extra: dev
Requires-Dist: hatch; extra == 'dev'
Description-Content-Type: text/markdown

# Video-compress

[![](https://img.shields.io/pypi/v/video-compress.svg)](https://pypi.org/project/video-compress)
[![](https://github.com/jiacai2050/my-works/actions/workflows/vc-ci.yml/badge.svg)](https://github.com/jiacai2050/video-compress/actions/workflows/ci.yml)

Compress video by 90% without losing much quality, similar to what [Pied
Piper](https://en.wikipedia.org/wiki/Silicon_Valley_(TV_series))
achieves.

![](pied-piper.jpg)

> Inspired by <https://x.com/mortenjust/status/1818027566932136062>

# Install

First install [ffmpeg](https://www.ffmpeg.org/download.html), then

``` bash
pip3 install -U video-compress
```

Or install latest nightly version

``` bash
pip3 install --force-reinstall -U git+https://github.com/jiacai2050/video-compress.git
```

This will install two commands: `vc`{.verbatim},
`video-compress`{.verbatim}, which are identical.

If you prefer to use
[uvtool](https://docs.astral.sh/uv/concepts/tools/):

``` bash
uv tool install Video-compress
```

# Usage

``` example
usage: vc [-h] [-v] [--verbose] [-t THREADS] [--crf CRF] [--delete]
          [<video path> ...]

Compress video by 90% without losing much quality, similar to what Pied Piper
achieves.

positional arguments:
  <video path>

options:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  --verbose             show verbose log
  -t THREADS, --threads THREADS
                        max threads to use for compression. (default: 6)
  --crf CRF             constant rate factor, range from 0-51. Higher values
                        mean more compression, smaller file size, but lower
                        quality. (default: 30)
  --delete              delete input video after compress successfully
```

Positional arguments can be either video files or directories.

For each directory, `vc`{.verbatim} will iteratively walk the dir to
search for all videos to compress, the compressed video will be named
after `${input}-compressed.mp4`{.verbatim}.
