Browser FFmpeg recipe

Compress Video Online with FFmpeg

Create a smaller MP4 while keeping broadly compatible video and audio codecs.

Command

Run this FFmpeg command

ffmpeg -i input.mp4 -c:v libx264 -crf 28 -preset fast -c:a aac -b:a 128k compressed.mp4

When to use it

  • email attachments
  • web uploads
  • faster sharing
  • storage cleanup

How it works

  1. Upload the source video.
  2. Use CRF compression to reduce file size.
  3. Run the command and download the compressed MP4.

Option reference

OptionWhat it does
-c:v libx264Encodes video with H.264.
-crf 28Controls quality and size. Higher values make smaller files.
-preset fastBalances encoding speed and compression.
-b:a 128kSets a compact audio bitrate.

Practical notes

  • Try CRF 23 for higher quality or CRF 30 for smaller files.
  • Large videos may take time because browser FFmpeg runs on your device.

FAQ

What CRF value should I use?

For H.264, 23 is a common quality baseline. 28 is smaller, and 30 or higher is more aggressive.

Will compression reduce quality?

Yes, lossy compression trades some quality for a smaller file size.