<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[rusat]]></title><description><![CDATA[rusat]]></description><link>https://rusat.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Thu, 29 Oct 2026 09:18:01 GMT</lastBuildDate><atom:link href="https://rusat.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[I Built fp: Compress Videos to a Target File Size]]></title><description><![CDATA[I built fp, a Rust CLI that uses FFmpeg to compress videos to a target file size through automated CRF search.]]></description><link>https://rusat.hashnode.dev/i-built-fp-compress-videos-to-a-target-file-size</link><guid isPermaLink="true">https://rusat.hashnode.dev/i-built-fp-compress-videos-to-a-target-file-size</guid><category><![CDATA[Rust]]></category><category><![CDATA[cli]]></category><category><![CDATA[Open Source]]></category><category><![CDATA[FFmpeg]]></category><dc:creator><![CDATA[satvik upadhyaya]]></dc:creator><pubDate>Sun, 11 Oct 2026 19:33:42 GMT</pubDate><content:encoded><![CDATA[<p>Ever tried compressing a video to fit under a specific file size using FFmpeg?</p>
<p>You end up guessing bitrates, tweaking CRF values and running FFmpeg repeatedly until the output finally fits.</p>
<p>I wanted to make that process simpler. so I built <a href="https://github.com/SATVIKsynopsis/fp"><code>fp</code></a>, a CLI that searches for a suitable compression setting to fit a video under a maximum size.</p>
<pre><code class="language-bash">fp compress video.mp4 --size 25mb
</code></pre>
<p>Specify the size limit and <code>fp</code> handles the trial and error.</p>
<h2>How it works</h2>
<p>Built with Rust and powered by FFmpeg, <code>fp</code>:</p>
<ul>
<li><p>Uses <code>ffprobe</code> to inspect video metadata.</p>
</li>
<li><p>Tries different CRF values and measures actual output sizes.</p>
</li>
<li><p>Searches within a bounded number of attempts.</p>
</li>
<li><p>Validates the output against the requested size limit.</p>
</li>
<li><p>Supports dry runs, custom output paths, and verbose mode.</p>
</li>
</ul>
<h2>A real example</h2>
<p>I tested it on a 99.8 MB, 1080p video with a target of 25 MB.</p>
<table>
<thead>
<tr>
<th>Attempt</th>
<th>CRF</th>
<th>Output</th>
</tr>
</thead>
<tbody><tr>
<td>1</td>
<td>34</td>
<td>48.5 MB</td>
</tr>
<tr>
<td>2</td>
<td>40</td>
<td>30.8 MB</td>
</tr>
<tr>
<td>3</td>
<td>43</td>
<td>25.3 MB</td>
</tr>
<tr>
<td>4</td>
<td>44</td>
<td>23.7 MB</td>
</tr>
</tbody></table>
<p>The final output was <strong>76.2% smaller</strong> than the original and stayed under the requested limit.</p>
<h2>No Rust installation? No problem.</h2>
<p>Besides installing it through Cargo, <code>fp</code> also provides <strong>prebuilt binaries for supported platforms</strong> through GitHub Releases. You can download the appropriate binary, extract it and run it without building the project from source.</p>
<ul>
<li><p><strong>Cargo:</strong> <code>cargo install ffrp</code></p>
</li>
<li><p><strong>Prebuilt binaries:</strong> <a href="https://github.com/SATVIKsynopsis/fp/releases/latest">Download from GitHub Releases</a></p>
</li>
</ul>
<p>You'll still need FFmpeg and ffprobe installed and available on your PATH.</p>
<h2>What's next?</h2>
<p>There's still room to improve the CLI and explore features like splitting videos into smaller chunks without re encoding.</p>
<p>The project is open source and I would love feedback, suggestions and contributions.</p>
<p><strong>GitHub:</strong> <a href="https://github.com/SATVIKsynopsis/fp">https://github.com/SATVIKsynopsis/fp</a></p>
<p>If you try it, let me know how it goes!</p>
]]></content:encoded></item></channel></rss>