deepshrink 0.2.1

Shrink media to a target size with one command. Local, private, no watermarks.
deepshrink-0.2.1 is not a library.

DeepShrink

Fit any video or audio under a size limit — one command, local, no watermarks.

CI Crates.io License: MIT OR Apache-2.0

deepshrink compresses a video or audio file to a target size in a single command. Need a clip under Discord's 8 MB limit, an email's 25 MB cap, or a Telegram / WhatsApp size? Point DeepShrink at the file — it does the bitrate math, runs a two-pass encode, and lands under the limit. Locally, without uploading to anyone's server, and without watermarks.

A thin, fast Rust layer over ffmpeg.

Status: early development (pre-alpha). v0.1 targets video and audio.

Why

Everyone hits upload limits — Discord (8 / 25 / 50 MB), email (~25 MB), Telegram, WhatsApp, bug trackers, CI artifacts. The usual options are web converters (upload your file to a stranger's server, watermarks, queues), HandBrake (powerful, but hitting exactly N MB is manual trial and error), or hand-written ffmpeg commands (recompute the bitrate every time). DeepShrink answers the one question directly: make it ≤ N MB, don't make me think.

Install

Homebrew (macOS / Linux) — pulls in ffmpeg for you:

brew install deeplabua/tap/deepshrink

From crates.io (expects ffmpeg on your PATH):

cargo install deepshrink

Or download a prebuilt binary from the releases page.

DeepShrink shells out to ffmpeg / ffprobe. The Homebrew formula installs ffmpeg automatically; other methods expect it on your PATH (brew install ffmpeg, or your platform's package manager).

Usage

Fit a video under Discord's 8 MB limit:

deepshrink gameplay.mp4 --for discord

Target an explicit size, or shrink by a percentage:

deepshrink big.mp4 --target 8MB
deepshrink clip.mp4 --reduce 70%

Compress audio (podcast, voice memo, music):

deepshrink lecture.wav --target 10MB

Preview the plan without encoding, or batch a whole folder:

deepshrink big.mp4 --target 8MB --dry-run
deepshrink ./clips --recursive --for telegram

Target a perceptual quality instead of a size, or pick a more efficient codec:

deepshrink clip.mp4 --vmaf 93            # smallest file that still scores VMAF ≥ 93
deepshrink clip.mp4 --codec h265         # HEVC — smaller at the same quality

--vmaf searches the encoder's quality setting (CRF) for the smallest output that meets your target VMAF, and reports the score it achieved. It needs an ffmpeg built with the libvmaf filter; without it, DeepShrink skips the measurement and encodes at a sensible default. When a size target is set, --vmaf reports the VMAF actually achieved.

The original file is never modified — DeepShrink writes a new *.shrink.* file unless you pass --overwrite.

Platform presets

Preset Limit
discord 8 MB
discord-nitro 500 MB
email 20 MB
telegram 2 GB
whatsapp 16 MB

Platform limits change over time — verify against the current service.

How it works

ffprobe reads the file's duration and streams. DeepShrink computes the video / audio bitrate that fits the target (minus container overhead), then runs a two-pass encode for video, or picks a codec bitrate for audio. If the result overshoots the target, it corrects once. Run with --dry-run to see the plan first.

Scope

v0.1 handles video and audio (the ffmpeg engine). Images, PDF, and office files are a planned "universal compressor" path built on pluggable engines. GIFs are handled by a sibling tool, DeepGif.

Part of DeepLab

DeepShrink is part of DeepLab — a line of tools for developers and product teams.

License

Licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.