you need to learn FFmpeg RIGHT NOW!!


FFmpeg Converts ANYTHING -
The Trick Book I Wish I Had

This issue is brought to you by:

Learn backend development the smart way
with boot.dev


Use the code DEVOPSTOOLBOX to get 25% off your first payment for boot.dev.

The title of this newsletter isn't an exaggeration.
There's a single, free tool that can genuinely convert, create, and manipulate almost any media file you throw at it.
It’s the hidden engine powering everything from YouTube, through OBS, online media converters, to the video player on your phone.
When I first heard of it, probably 7-8 years ago, not only I didn't know half the things it could do (GIFs? seriously??) I would literally go on StackOverflow and copy paste my way to a WAV -> MP3 conversion.

So this, is the guide I with I had back then. And if "guide" is too big of a promise, then a trick booklet.
A problem we all face is digital clutter.
When you need to create a GIF, you search for an "online GIF creator" (or try looking for an existing one bc you don't have the skills).
When a video file is too big to email, you look for a "video compressor" or pay the price for an overkill hosting solution.
Need to grab the audio from a clip? That’s another tool.
Most people solve this by using a patchwork of different apps and websites for each specific task.
The issue is that this approach is inefficient and often risky.
You end up uploading your files to questionable servers, navigating websites littered with ads, and running unknown code in your browser.
All for a simple conversion you could have done locally, in 5 seconds, with a tool you probably already have installed.
Worse yet, most of these services are just fancy wrappers for that very same tool anyway.
So, how can we solve this differently?
By going directly to the source.
Instead of relying on a dozen different tools, you can use FFmpeg’s simple command-line interface to do it all yourself, faster and more securely.
It might seem intimidating, like a cryptic language for "genius dark basement engineers," but the truth is you don't need to be an expert.
You just need a handful of copy-paste commands to handle 99% of your media needs.


Ready to put it into action?

Key FFmpeg flags to remember:
"-i" holds the input
"-vf" - video filter, will hold, well, the filter, but also a set of comma-separated key value pairs
"-c:v" - converters like libx264 / mp3 etc
"-vn" - used when it's audio only, stands for "video no" or "no video"
The output file always comes last. And that's, pretty much it...
Here's a good list to remember, just replace the placeholder file names with your own, or parametrize them into your local snippets:

  1. Create a High-Quality GIF from a Video

Instead of using shady online converters, you can create a perfectly sized GIF with one line:

ffmpeg -i input.mp4 -vf "fps=10,scale=920:-1:flags=lanczos" output.gif
  • What it does: The -vf (video filter) flag is where the magic happens. We're setting the GIF to 10 frames per second (fps=10) and scaling its width to 920 pixels. The -1 for the height tells FFmpeg to automatically calculate it to maintain the original aspect ratio. lanczos is a high-quality resizing algorithm, especially good for downscaling.

2. Create a High-Quality GIF from a Video

Yes, FFmpeg handles images, too! This is perfect for quickly optimizing images for a website without opening a heavy application.

ffmpeg -i large_image.png -vf "scale=800:-1" compressed_image.jpg
  • What it does: Just like with the GIF, we use the scale filter. We set the width to 800 pixels and use -1 to preserve the aspect ratio, avoiding the "lovely distorted image" problem mentioned in the script.

3. Rip Audio from a Video File

Need to extract audio from a ckip? Incredibly useful for saving podcasts, music, or talks from video clips.

ffmpeg -i video_with_audio.mp4 -vn -c:a mp3 audio_only.mp3

4. Compress a Video (The Smart Way)

This is one of FFmpeg's main selling points. The following command uses a popular codec to drastically reduce file size while maintaining great quality.

ffmpeg -i huge_video.mp4 -c:v libx264 -crf 23 smaller_video.mp4
  • What it does: We're setting the video codec (-c:v) to libx264, a widely used standard. The crf (Constant Rate Factor) value of 23 is a fantastic default that provides a great balance between quality and file size. A lower number means higher quality (and a larger file), while a higher number does the opposite.

5. Need to burn text directly onto a video? FFmpeg can do that without re-rendering in a complex video editor.

ffmpeg -i input.mp4 -vf "drawtext=text='Your Text Here':fontcolor=white:fontsize=24:x=10:y=10" output_watermarked.mp4
  • What it does: We use the drawtext video filter to specify the text, color, size, and x and y coordinates for where it should appear on the screen.


While this is my list that covers most of the common tasks I use FFmpeg daily, I can't remember each and every flag and configuration.
My trick is Atuin, and specifically, Atuin scripts!
Every time I use a one line FFmpeg command, I script it using Atuin, parameterize anything worth tweaking later, and use my arsenal of snippets when I need a gif, audio channel fixing, compressing a video and what not!

Thank you for reading.

Feel free to reply directly with any question or feedback.

Have a great weekend!

ESPRESSO FRIDAYS

Every once in a while I send hand picked things I've learned. Kind of like your filter to the tech internet. No spam, I promise!

Read more from ESPRESSO FRIDAYS

You’ve been parsing JSON wrong your whole life This issue is brought to you by: Secure Your AI Future at DevSecCon 2025 Software development is undergoing a seismic shift as AI transforms how we build, deploy, and secure applications. Register for the 1st-ever Global Community Summit on AI Security, covering critical strategies to empower AI innovation without compromising security. Register for DevSecCon 2025 (It’s Free!) Ever opened a massive “.log” file and realized it’s just one long,...

Wait… cURL can do WHAT?! Brought to you in collaboration with 1Password and Browserbase: 🔐 Your AI Agents Can Finally Log In! 1Password and Browserbase just partnered to solve AI’s biggest security nightmare: authentication without exposing credentials. Introducing 1Password’s Secure Agentic Autofill, allowing you to connect your 1Password Enterprise Password Manager to your browser automation agent powered by Browserbase. Build AI agents that can actually work without compromising security....

Postgres is not a database. For years, we’ve been taught to see Postgres as the reliable, open source workhorse for storing our data. Everyone called it "The Toyota of databases", you know... it just works. But to leave it at that is to miss the whole story.Postgres isn’t just a place to put your data, it’s a powerful development platform that can become the core of your entire backend, an operating system (yea, bold) for your application’s stack. Diving deep into its capabilities I learned...