DeepShrink
Fit any video or audio under a size limit — one command, local, no watermarks.
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:
From crates.io (expects ffmpeg on your PATH):
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:
Target an explicit size, or shrink by a percentage:
Compress audio (podcast, voice memo, music):
Preview the plan without encoding, or batch a whole folder:
Target a perceptual quality instead of a size, or pick a more efficient codec:
--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
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
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.