AI Video Editing Flows

FFmpeg compress video: CRF and presets, measured with VMAF

CRF sets quality for libx264: lower is better and larger. On a 20 s excerpt of our Tears of Steel clip, CRF 18 gave 5.11 MB and CRF 33 gave 676.7 kB. VMAF against the source was 97.34 and 81.41. Presets also change size and quality at the same CRF, not only time.

What to choose

Start with -crf 23 and -preset medium. Raise the CRF for a smaller file, lower it for a cleaner one. Slower presets than medium gave a slightly smaller file here, at a much longer encode time.

Quality numbers on this page are VMAF scores of each encode against the source excerpt, using FFmpeg's libvmaf filter with default settings. A higher VMAF is closer to the source.

CRFFile sizeVideo bit rateVMAFEncode time
185.11 MB2036.0 kbit/s97.3411.0 s
232.53 MB1007.9 kbit/s94.718.4 s
281.24 MB495.8 kbit/s89.965.3 s
33676.7 kB269.6 kbit/s81.414.1 s

CRF sweep

The source excerpt ref.mp4 is the first 20 s of the clip, copied without re-encoding: 482 frames, 6.13 MB with audio. Its video stream alone was 5.63 MB. All encodes below are video only (-an) with libx264 and preset medium.

CRF 18: 5.11 MB, VMAF 97.34
ffmpeg -i ref.mp4 -c:v libx264 -preset medium -crf 18 -an crf18.mp4
CRF 23: 2.53 MB, VMAF 94.71
ffmpeg -i ref.mp4 -c:v libx264 -preset medium -crf 23 -an crf23.mp4
CRF 28: 1.24 MB, VMAF 89.96
ffmpeg -i ref.mp4 -c:v libx264 -preset medium -crf 28 -an crf28.mp4
CRF 33: 676.7 kB, VMAF 81.41
ffmpeg -i ref.mp4 -c:v libx264 -preset medium -crf 33 -an crf33.mp4

Leaving out -crf gave 2.53 MB, and CRF 23 gave 2.53 MB, so the two files are the same size.

No -crf given
ffmpeg -i ref.mp4 -c:v libx264 -preset medium -an nocrf.mp4

Preset comparison

These rows all use CRF 23. The medium row is the CRF 23 encode from the sweep. ultrafast made a much larger file and veryfast a smaller, lower scoring one than medium. slow and veryslow made smaller files with slightly higher VMAF.

PresetFile sizeVideo bit rateVMAFEncode time
ultrafast8.45 MB3365.5 kbit/s95.270.9 s
veryfast1.87 MB745.2 kbit/s90.892.7 s
medium2.53 MB1007.9 kbit/s94.718.4 s
slow2.43 MB969.7 kbit/s94.7815.2 s
veryslow2.27 MB903.8 kbit/s94.8247.0 s
Preset slow at CRF 23: 2.43 MB
ffmpeg -i ref.mp4 -c:v libx264 -preset slow -crf 23 -an pre_slow.mp4

Encode times came from a laptop doing other work and are single runs, so use them only to see the order.

Check the quality

Always compare against the source and look at the result. The command below prints the VMAF score on its last lines. Both inputs must have the same size and frame rate.

VMAF of the CRF 28 file against the source: 89.96
ffmpeg -i crf28.mp4 -i ref.mp4 -lavfi "[0:v]setpts=PTS-STARTPTS[d];[1:v]setpts=PTS-STARTPTS[r];[d][r]libvmaf=n_threads=4" -f null -

A score is an average over the whole clip. Check a busy scene by eye as well, and watch for banding in dark gradients and blocking in fast motion. We measured the scores only and did not review the files by eye.

Method and limits

All commands ran on FFmpeg 8.1.2 (a full Windows build) on a Windows 11 laptop, Ryzen 7 7735U, CPU only, on 2026-11-06. We added -y and -threads 4 to every run; they are left out of the commands shown. In quoted FFmpeg messages the hex address after @ changes on every run, so we replaced it with ...

tos.mp4 is a copy of Tears of Steel clip tos_a_0020_60s.mp4 (60 s, 1280x534, 24 fps), (c) Blender Foundation, licensed CC-BY 3.0. We credit it here as the licence asks. The excerpt ref.mp4 is the first 20 s, made with the command below.

Make ref.mp4
ffmpeg -t 20 -i tos.mp4 -c copy ref.mp4

Limits: one run of each command, so the sizes and times are single measurements and not averages. Times were taken on a laptop that was doing other work. Results depend on the input file and the FFmpeg version, so check yours. One source clip and one codec: VMAF and file size differ for other footage, and we did not test x265 or AV1.

Related: FFmpeg for video editors, FFmpeg convert video format: MOV, MKV, MP4 and WebM, FFmpeg resize and crop video: scale, pad and 9:16, FFmpeg trim video: accurate cuts by time and FFmpeg command builder.

Page checked on Nov 4, 2026.