Very Good FFmpeg
How it worksPricingCompareFAQDocs
Guide #2

Compress video with FFmpeg

Compression is a tradeoff between size, quality, speed, and compatibility. CRF is usually the best first control for stored video.

Copy + paste this:

Create a smaller MP4 while keeping good playback support.

ffmpeg -i input -c:v libx264 -crf 24 -preset medium -c:a aac -b:a 128k -movflags +faststart compressed.mp4

When this is the right tool

Start by checking whether this operation matches the job you actually need.

Use this when

3 Good fit
  • Uploads are too large to store, send, or stream.

  • You need a smaller preview, social export, or web playback copy.

  • You want consistent quality without guessing a fixed bitrate.

Be careful when

2 Watch out
  • The file is already heavily compressed and visual quality matters.

  • You need exact broadcast bitrate rules. Use a bitrate ladder instead.

Examples

Use these as starting points, then tune quality, size, and timing on real input files.

General compression

Create a smaller MP4 while keeping good playback support.

ffmpeg -i input -c:v libx264 -crf 24 -preset medium -c:a aac -b:a 128k -movflags +faststart compressed.mp4

Command breakdown

input input
Reads this input file.
-c:v libx264
Sets the video codec.
-crf 24
Controls visual quality. Lower values make larger, higher-quality files.
-preset medium
Controls encode speed and compression efficiency.
-c:a aac
Sets the audio codec.
-b:a 128k
Sets the audio bitrate.
-movflags +faststart
Moves MP4 metadata to the front so web playback can start sooner.
output compressed.mp4
Writes this output file.

720p compressed copy

Downscale and compress for smaller web previews.

ffmpeg -i input -vf scale=-2:720 -c:v libx264 -crf 24 -preset medium -c:a aac -b:a 128k preview.mp4

Command breakdown

input input
Reads this input file.
-vf scale=-2:720
Applies a video filter chain.
-c:v libx264
Sets the video codec.
-crf 24
Controls visual quality. Lower values make larger, higher-quality files.
-preset medium
Controls encode speed and compression efficiency.
-c:a aac
Sets the audio codec.
-b:a 128k
Sets the audio bitrate.
output preview.mp4
Writes this output file.

Helpful tips

These details prevent most bad outputs and confusing FFmpeg results.

CRF controls quality

For x264, lower CRF means higher quality and larger files. A range of 18-28 is common.

Preset controls speed

Slower presets usually compress better, but take longer. `medium` is a sensible default.

Scale before encoding

A 720p copy can be much smaller than 4K, even at similar perceived quality on small screens.

Related guides

Useful next steps when this operation is part of a larger workflow.

Convert video format with FFmpeg

Learn how to convert MOV, MKV, WebM, and AVI files to MP4 with FFmpeg, when to copy streams, and when to re-encode.

Resize video with FFmpeg

Learn how to resize video with FFmpeg while keeping aspect ratio, avoiding odd dimensions, and padding when needed.

Need to run this at scale?

Run the same FFmpeg commands through a hosted API.

Keep the FFmpeg command surface. Very Good FFmpeg handles machines, logs, long jobs, outputs, and webhooks.

Try free →Read API docs
Very Good FFmpegChecking status...
Product
  • How it works
  • Pricing
  • Comparison
  • FAQ
Developers
  • Documentation
  • API Reference
  • MCP Server
  • TypeScript SDK
  • Python SDK
Company
  • Contact
  • Sign in
  • Sign up
Legal
  • Terms
  • Privacy
Compare
  • vs Rendi
  • vs RenderIO
  • vs ffmpeg-api.com
  • vs FFmpeg Micro
  • vs AWS MediaConvert
  • vs Google Transcoder API
  • vs Self-Hosted FFmpeg
  • vs Cloudinary
Integrations
  • Zapier
  • Make
  • n8n
Use Cases
  • Video SaaS Platforms
  • Content Creators & UGC Platforms
  • AI Video Startups
  • Agencies & Freelancers
  • Podcasts & Audio Pipelines
Guides
  • Convert video format with FFmpeg
  • Compress video with FFmpeg
  • Extract audio with FFmpeg
  • Trim video with FFmpeg
  • Create video thumbnails with FFmpeg
  • Resize video with FFmpeg
  • Add subtitles with FFmpeg
Best APIs
  • Best Video Transcoding API (2026)
  • Best Video Compression API (2026)
  • Best Audio Extraction API (2026)
  • Best API for Trimming Video (2026)
  • Best Video Thumbnail API (2026)
  • Best Video Resizing API (2026)
  • Best API for Adding Subtitles to Video (2026)
  • Best FFmpeg API (2026)
© 2026 Very Good FFmpeg