FFmpeg Compress Video: Step-by-Step Guide & Easier Alternative (2026)

How to Compress Videos Using FFmpeg (and an Easier Alternative)

1 January, 2025

Compressing videos is a handy skill, whether you’re looking to save storage space or share files quickly. FFmpeg, a powerful open-source tool, allows you to compress videos with precision—but it’s designed for command-line use, which can be intimidating for first-timers.

This guide breaks down FFmpeg’s video compression process step-by-step, with clear instructions for beginners. If you’re looking for a simpler approach afterward, we’ll introduce an alternative that takes the hassle out of compression.

Step-by-Step: How to Compress Videos with FFmpeg

Step 1: Download and install FFmpeg

  1. Visit the FFmpeg website and download the appropriate version for your operating system:
  • Windows: Download the pre-built binaries, extract the files, and add FFmpeg to your system’s PATH environment variable.

  • macOS/Linux: Use a package manager.

For macOS, run:

brew install ffmpeg For Linux (Ubuntu/Debian):

sudo apt update sudo apt install ffmpeg 2. Verify the installation by typing:

ffmpeg -version If you see the version details, you’re ready to proceed!

Step 2: Locate your video file

Navigate to the folder containing your video file:

  1. Use the cd command to move to the folder where your file is stored. For example:
  • On** Windows**:

cd C:\Videos On** macOS/Linux**: cd ~/Videos 2. Use the ls command (macOS/Linux) or dir command (Windows) to confirm that your video file is in the folder:

  • On** macOS/Linux**:

ls # For macOS/Linux dir # For Windows Step 3: Compress your video

Once you’re in the correct folder, run the following command to compress your video:

ffmpeg -i input.mp4 -vcodec libx264 -crf 28 output.mp4 Here’s what each part of the command means:

  • -i input.mp4: Refers to your original video file. Replace input.mp4 with your file’s name.

  • -vcodec libx264: Specifies the H.264 codec, a standard for efficient video compression.

  • crf 28: Controls compression quality. Lower numbers yield higher quality; values of 18-23 are ideal for high-quality output.

  • output.mp4: Specifies the name of your compressed file.

Step 4: Verify you compressed video

  • Look for the newly created output .mp4 file in the same folder

  • Play the file to ensure the quality meets your expectations

  • If the file size is too large or too low quality, adjust the -crf value and re-run the command:

  • Use a lower value like -crf 23 for better quality.

  • Use a higher value like -crf 30 for smaller file sizes.

Challenges You Might Encounter

While FFmpeg is a powerful tool, it does come with a learning curve:

  • You’ll need to familiarize yourself with command-line syntax.

  • Trial and error might be necessary to get the balance of quality and size just right.

  • Compressing multiple files can become time-consuming without advanced scripting.

If you’re not comfortable with these challenges, don’t worry—there’s an alternative that makes compression effortless.

Looking for a Simpler Solution? Try Compresto

If manually typing commands isn’t your thing—or if you’re compressing videos regularly—Compresto offers a simpler, more accessible solution.

Why Consider Compresto?

  • No Commands, Just Clicks: Drag, drop, and let Compresto handle the rest.

  • Batch Compression: Compress multiple files in one go without manual effort.

  • Optimized for Quality: Advanced algorithms ensure your videos look great, even with reduced file sizes.

  • Broad Compatibility: Works for videos, images, and other file types, so you can streamline all your compression needs.

With Compresto, there’s no setup, no troubleshooting, and no guesswork—just fast, high-quality compression for everyone.

Final Thoughts

FFmpeg is an excellent tool for video compression if you’re comfortable with command-line utilities and need precise control. However, if you’re looking for a faster and easier way to compress videos, Compresto provides a hassle-free experience for anyone, regardless of technical expertise.

Ready to simplify your workflow? Download Compresto today and start compressing your videos with ease!

FFmpeg Compress Video: CRF Quality Presets

CRF (Constant Rate Factor) is FFmpeg's smartest compression mode — it allocates more bits to complex scenes and fewer to simple ones. Here's a practical reference:

CRF ValueQuality LevelTypical Size ReductionBest For
18Visually lossless40–60%Archiving, professional work
22High quality60–75%General use, YouTube uploads
26Good quality75–85%Web sharing, email
30Acceptable85–92%Previews, low-bandwidth streaming

Recommended command for most users:

ffmpeg -i input.mp4 -c:v libx265 -crf 22 -preset medium -c:a aac -b:a 128k output.mp4

Pair CRF with the right preset for your needs: ultrafast for quick previews, medium for daily use, slow or veryslow for final delivery where every MB matters.

FFmpeg Video Compression: Batch Processing

Compressing an entire folder of videos is where FFmpeg truly shines over GUI tools:

Compress all MP4 files in a directory:

for f in *.mp4; do
  ffmpeg -i "$f" -c:v libx265 -crf 22 -preset medium -c:a aac -b:a 128k "compressed_$f"
done

Compress with parallel processing (using GNU parallel):

ls *.mp4 | parallel -j4 'ffmpeg -i {} -c:v libx265 -crf 22 -preset medium -c:a aac -b:a 128k compressed_{}'

Compress and resize for web:

ffmpeg -i input.mp4 -c:v libx265 -crf 24 -vf scale=1280:-1 -preset medium -c:a aac -b:a 96k web_output.mp4

If command-line scripting isn't your thing, Compresto offers the same powerful compression with a simple drag-and-drop interface on macOS — just drop a folder and let it handle the rest.

Ready to compress your files? Join thousands of creators using Compresto ⚡