<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: DeepLab</title>
    <description>The latest articles on DEV Community by DeepLab (deeplab).</description>
    <link>https://dev.to/deeplab</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F13595%2Fc667ee8d-bcd6-42f8-8753-66255c1290f1.png</url>
      <title>DEV Community: DeepLab</title>
      <link>https://dev.to/deeplab</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/deeplab"/>
    <language>en</language>
    <item>
      <title>Fit any video under the limit: meet DeepShrink, a one-command media compressor</title>
      <dc:creator>Alexander Pervushen</dc:creator>
      <pubDate>Tue, 21 Jul 2026 08:40:51 +0000</pubDate>
      <link>https://dev.to/deeplab/fit-any-video-under-the-limit-meet-deepshrink-a-one-command-media-compressor-2j8b</link>
      <guid>https://dev.to/deeplab/fit-any-video-under-the-limit-meet-deepshrink-a-one-command-media-compressor-2j8b</guid>
      <description>&lt;p&gt;You have a 300 MB screen recording. Discord wants it under 8 MB. Your email won't take more than 20. So you either google &lt;em&gt;"compress video to 8mb"&lt;/em&gt; and land on an ad-riddled web converter that uploads your file to someone else's server and stamps a watermark on it — or you open HandBrake and start guessing at CRF values — or you hand-write an &lt;code&gt;ffmpeg&lt;/code&gt; command, recompute the bitrate for the fifth time this month, and forget the audio track again.&lt;/p&gt;

&lt;p&gt;None of those answer the actual question: &lt;strong&gt;"make this ≤ N MB, without me thinking about it."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That's the whole reason &lt;a href="https://github.com/deeplabua/deepshrink" rel="noopener noreferrer"&gt;DeepShrink&lt;/a&gt; exists.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;deepshrink gameplay.mp4 &lt;span class="nt"&gt;--for&lt;/span&gt; discord
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  gameplay.mp4   1920x1080  2m14s   312.4 MB
  target         Discord (8 MB)
  plan           H.264 · 456 kbps video · 96 kbps audio · two-pass
  ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓  100%   pass 2/2

  ✓ gameplay.shrink.mp4   7.6 MB   (−97.6%)   VMAF 91.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One command. Local. No upload, no watermark, no guessing. And when you say &lt;code&gt;--target 8MB&lt;/code&gt;, the result is &lt;em&gt;guaranteed&lt;/em&gt; ≤ 8 MB — not "roughly."&lt;/p&gt;

&lt;h2&gt;
  
  
  What it actually is
&lt;/h2&gt;

&lt;p&gt;DeepShrink is a small, open-source CLI written in Rust. It doesn't reinvent encoding — it drives &lt;strong&gt;ffmpeg&lt;/strong&gt; for you and does the one thing ffmpeg makes annoying: hitting an exact output size.&lt;/p&gt;

&lt;p&gt;Under the hood it probes the file with &lt;code&gt;ffprobe&lt;/code&gt;, works out the bitrate budget for your target size (with a little headroom for container overhead), runs a two-pass H.264/H.265 encode for video or picks the right codec bitrate for audio (AAC / Opus / MP3), and can optionally hold a quality floor with VMAF so it never over-compresses. You don't touch any of that. You say how big, it figures out how.&lt;/p&gt;

&lt;p&gt;The design goals, in order:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One obvious command solves 80% of cases.&lt;/strong&gt; &lt;code&gt;deepshrink video.mp4 --target 8MB&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Presets instead of flags.&lt;/strong&gt; You shouldn't need to know what a bitrate is.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Never wreck the original.&lt;/strong&gt; Output is a new file (&lt;code&gt;video.shrink.mp4&lt;/code&gt;); the source is untouched unless you explicitly pass &lt;code&gt;--overwrite&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local and private.&lt;/strong&gt; Your file never leaves your machine.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Scope today is &lt;strong&gt;video and audio&lt;/strong&gt; — one engine, ffmpeg. Images, PDFs, and other formats are a deliberate future step, not a half-baked afterthought.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing with Homebrew (recommended on macOS)
&lt;/h2&gt;

&lt;p&gt;This is the frictionless path, and it's the one I'd reach for first:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;deeplabua/tap/deepshrink
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. Because the formula declares &lt;code&gt;depends_on "ffmpeg"&lt;/code&gt;, Homebrew pulls &lt;strong&gt;ffmpeg in as a dependency automatically&lt;/strong&gt; — so there are zero manual runtime steps. Install, and it works.&lt;/p&gt;

&lt;p&gt;If you'd rather tap first and install by short name (handy if you'll install other tools from the same tap later):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew tap deeplabua/tap
brew &lt;span class="nb"&gt;install &lt;/span&gt;deepshrink
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify it landed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;deepshrink &lt;span class="nt"&gt;--version&lt;/span&gt;
deepshrink &lt;span class="nt"&gt;--help&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Updating later is just &lt;code&gt;brew upgrade deepshrink&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing with cargo (from crates.io)
&lt;/h2&gt;

&lt;p&gt;If you already live in the Rust toolchain, DeepShrink is on crates.io:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo &lt;span class="nb"&gt;install &lt;/span&gt;deepshrink
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This compiles from source, so it's slower than the prebuilt Homebrew bottle and you need a Rust toolchain installed. Worth knowing about &lt;strong&gt;one difference from the brew path&lt;/strong&gt;: &lt;code&gt;cargo install&lt;/code&gt; does &lt;strong&gt;not&lt;/strong&gt; bring ffmpeg along. DeepShrink expects &lt;code&gt;ffmpeg&lt;/code&gt; and &lt;code&gt;ffprobe&lt;/code&gt; to be on your &lt;code&gt;PATH&lt;/code&gt;, and if they aren't, it exits cleanly (code &lt;code&gt;3&lt;/code&gt;) with a hint rather than crashing.&lt;/p&gt;

&lt;p&gt;So on a fresh machine, install ffmpeg alongside it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# macOS&lt;/span&gt;
brew &lt;span class="nb"&gt;install &lt;/span&gt;ffmpeg

&lt;span class="c"&gt;# Debian / Ubuntu&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;ffmpeg

&lt;span class="c"&gt;# Windows (Scoop)&lt;/span&gt;
scoop &lt;span class="nb"&gt;install &lt;/span&gt;ffmpeg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then the same check as before:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;deepshrink &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  brew vs cargo, quickly
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;code&gt;brew install deeplabua/tap/deepshrink&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;&lt;code&gt;cargo install deepshrink&lt;/code&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Speed&lt;/td&gt;
&lt;td&gt;Prebuilt bottle, instant&lt;/td&gt;
&lt;td&gt;Compiles from source&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rust toolchain needed&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ffmpeg&lt;/td&gt;
&lt;td&gt;Pulled in automatically&lt;/td&gt;
&lt;td&gt;You install it yourself&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Best for&lt;/td&gt;
&lt;td&gt;Most people, especially macOS&lt;/td&gt;
&lt;td&gt;Rust devs who already have the toolchain&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Prebuilt binaries for macOS, Linux, and Windows are also attached to every &lt;a href="https://github.com/deeplabua/deepshrink/releases" rel="noopener noreferrer"&gt;GitHub release&lt;/a&gt; if you'd rather not use a package manager at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using it
&lt;/h2&gt;

&lt;p&gt;The headline command — fit a file under an absolute size:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;deepshrink big.mp4 &lt;span class="nt"&gt;--target&lt;/span&gt; 8MB
deepshrink talk.wav &lt;span class="nt"&gt;--target&lt;/span&gt; 500KB
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Don't want to memorize platform limits? Use a &lt;strong&gt;destination preset&lt;/strong&gt; and DeepShrink applies the right cap:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;deepshrink clip.mp4 &lt;span class="nt"&gt;--for&lt;/span&gt; discord        &lt;span class="c"&gt;# 8 MB&lt;/span&gt;
deepshrink clip.mp4 &lt;span class="nt"&gt;--for&lt;/span&gt; email          &lt;span class="c"&gt;# 20 MB&lt;/span&gt;
deepshrink clip.mp4 &lt;span class="nt"&gt;--for&lt;/span&gt; telegram       &lt;span class="c"&gt;# only recompresses for quality&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Built-in presets today: &lt;code&gt;discord&lt;/code&gt;, &lt;code&gt;discord-nitro&lt;/code&gt;, &lt;code&gt;email&lt;/code&gt;, &lt;code&gt;telegram&lt;/code&gt;, &lt;code&gt;whatsapp&lt;/code&gt;, and &lt;code&gt;web&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Prefer a relative cut instead of a hard ceiling?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;deepshrink video.mp4 &lt;span class="nt"&gt;--reduce&lt;/span&gt; 70%        &lt;span class="c"&gt;# 70% smaller than the source&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Audio is a first-class citizen, not an afterthought — great for podcasts, voice memos, and lectures:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;deepshrink lecture.wav &lt;span class="nt"&gt;--target&lt;/span&gt; 10MB
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  lecture.wav     stereo 48kHz   58m02s   638.1 MB (PCM)
  target          10 MB
  plan            Opus · ~22 kbps · mono (speech)
  ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓  100%

  ✓ lecture.shrink.opus   9.4 MB   (−98.5%)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Got a whole folder? Batch it — DeepShrink walks the directory, skips files that are already small or unsupported, and prints a summary instead of dying on the first hiccup:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;deepshrink ./recordings &lt;span class="nt"&gt;--recursive&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A few flags worth knowing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;--dry-run&lt;/code&gt; — show the plan (chosen bitrate, expected size) without encoding a thing.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--vmaf &amp;lt;n&amp;gt;&lt;/code&gt; — hold a quality floor; it won't compress below the VMAF score you ask for.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--codec h265&lt;/code&gt; — smaller files at the same quality, when you don't need maximum compatibility.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--json&lt;/code&gt; — machine-readable output, for scripts and CI.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;--overwrite&lt;/code&gt; — replace the original in place (written atomically via a temp file, so an interrupted run won't corrupt your source).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why bother, over a web converter?
&lt;/h2&gt;

&lt;p&gt;Because DeepShrink is the intersection people actually want: the &lt;strong&gt;precision and privacy of native ffmpeg&lt;/strong&gt; with the &lt;strong&gt;simplicity of a web converter&lt;/strong&gt; — and none of the downsides of either. Your file stays on your disk. You get an exact size, not an approximation. There are no watermarks, no queues, and no "upload your file to continue." It's one static binary that works offline.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Homebrew:&lt;/strong&gt; &lt;code&gt;brew install deeplabua/tap/deepshrink&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;cargo:&lt;/strong&gt; &lt;code&gt;cargo install deepshrink&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Source &amp;amp; releases:&lt;/strong&gt; &lt;a href="https://github.com/deeplabua/deepshrink" rel="noopener noreferrer"&gt;github.com/deeplabua/deepshrink&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's open source and free. If it saves you a trip to a sketchy converter even once, consider dropping a ⭐ on the repo — that's what keeps small tools like this alive.&lt;/p&gt;

&lt;p&gt;Try it on that 300 MB file you've been avoiding. &lt;code&gt;--target 8MB&lt;/code&gt;. Done.&lt;/p&gt;

</description>
      <category>rust</category>
      <category>cli</category>
      <category>ffmpeg</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
