Metadata-Version: 2.4
Name: cli-compress
Version: 0.1.0
Summary: Compress images, gifs, video, and audio to a target file size using ffmpeg.
Author-email: your name <maximus.sandone@gmail.com>
License-Expression: MIT
Classifier: Environment :: Console
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# cli-compress

Compress images, gifs, video, and audio to a target file size with ffmpeg.

## Requirements

- Python 3.8+
- ffmpeg + ffprobe on PATH
  - macOS: `brew install ffmpeg`
  - Linux: `sudo apt install ffmpeg`
  - Windows: `winget install ffmpeg`

## Install

```
pip install -e .
```

This gives you a `compress` command on Windows, Linux, and macOS.

## Usage

```
compress input.mp4 -s 10mb
compress photo.png -s 200kb
compress meme.gif -s 3mb
compress song.wav -s 5mb
compress video.mov -s 1gb -o out.mp4
```

- `-s/--size` accepts `kb`, `mb`, `gb` (also `kib`/`mib`/`gib`, same thing) or a raw byte count.
- `-o/--output` is optional; defaults to `<name>_compressed.<ext>`.
- Lossless audio (`.wav`, `.flac`) can't be bitrate-targeted, so it's re-encoded to `.mp3` by default.
- `.png` has no useful quality knob for size targeting, so it's re-encoded to `.jpg` by default.

Video and audio use bitrate math against the clip's duration. Images and gifs
iteratively shrink resolution (and fps, for gifs) until they fit.
