File-size problems

Compress a video without changing its dimensions: ffmpeg CRF

Updated 4 fixes1 sources

Short answer

To compress a video and keep its dimensions, change the bitrate, not the size: re-encode with libx264 at a higher CRF and a slower preset, and do not add a scale filter. On the FFmpeg wiki's scale, 23 is the default, 17 to 28 is the subjectively sane range, and +6 roughly halves the file size.

Key takeaways

  • Dimensions only change if you add a scale filter, so leave it out.
  • CRF 23 is the x264 default; 17 or 18 is visually near lossless; 28 is the top of the sane range.
  • A slower preset gives a smaller file at the same quality.
  • Lower the audio bitrate only after the video is tuned; audio is usually a small share.

Find your case

What you seeWhat it usually meansDo this
File must be under a platform limitBitrate too high for the limitRaise CRF in steps (step 2)
Output too softCRF too high or preset too fastLower CRF by 2 and use slow (step 3)
Output bigger than inputSource was already efficientSee the bigger-file guide
Dimensions changed unexpectedlyA scale filter or preset changed themRemove -vf scale (step 1)

Fix it step by step

  1. Keep the dimensions

    Do not use -vf scale, -s or a platform preset that resizes. ffprobe the result and compare width and height with the source.

  2. Pick a CRF

    ffmpeg -i in.mp4 -c:v libx264 -crf 24 -preset slow -c:a copy out.mp4. The FFmpeg wiki says to choose the highest CRF that still looks acceptable.

    Source: FFmpeg Wiki: Encode/H.264 (CRF, presets) · Compress video →

  3. Use a slower preset

    A slower preset improves compression at the same quality; use the slowest you can wait for.

    Source: FFmpeg Wiki: Encode/H.264 (CRF, presets)

  4. Compare before and after

    Play both at full screen and look at gradients, text and fast motion; those show compression first.

CRF and size at a glance

CRFExpectationUse
17 to 18Visually near losslessMasters and archives
20 to 23Good quality, moderate sizeUploads to platforms
24 to 28Smaller, softer in detailWhen a size limit is tight

Check your file

Extension and MIME type are labels, not proof of the container. Dimensions and duration come from this browser's media reader. This does not detect codecs, bitrate, corruption or platform upload compatibility. Files and measurements are not sent anywhere.

Frequently asked questions

How do I reduce file size without changing resolution?

Re-encode with a higher CRF and a slower preset without scaling.

What does CRF 23 mean?

It is the default x264 quality setting; 17 to 28 is the range the FFmpeg wiki calls subjectively sane.

How much does +6 CRF save?

Roughly half the bitrate and file size, according to the FFmpeg wiki.

Sources

Reviewed 2026-10-06. Steps not attributed to a source are general video practice or computed above.