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.
| CRF | File size | Video bit rate | VMAF | Encode time |
|---|---|---|---|---|
| 18 | 5.11 MB | 2036.0 kbit/s | 97.34 | 11.0 s |
| 23 | 2.53 MB | 1007.9 kbit/s | 94.71 | 8.4 s |
| 28 | 1.24 MB | 495.8 kbit/s | 89.96 | 5.3 s |
| 33 | 676.7 kB | 269.6 kbit/s | 81.41 | 4.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.
ffmpeg -i ref.mp4 -c:v libx264 -preset medium -crf 18 -an crf18.mp4ffmpeg -i ref.mp4 -c:v libx264 -preset medium -crf 23 -an crf23.mp4ffmpeg -i ref.mp4 -c:v libx264 -preset medium -crf 28 -an crf28.mp4ffmpeg -i ref.mp4 -c:v libx264 -preset medium -crf 33 -an crf33.mp4Leaving out -crf gave 2.53 MB, and CRF 23 gave 2.53 MB, so the two files are the same size.
ffmpeg -i ref.mp4 -c:v libx264 -preset medium -an nocrf.mp4Preset 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.
| Preset | File size | Video bit rate | VMAF | Encode time |
|---|---|---|---|---|
| ultrafast | 8.45 MB | 3365.5 kbit/s | 95.27 | 0.9 s |
| veryfast | 1.87 MB | 745.2 kbit/s | 90.89 | 2.7 s |
| medium | 2.53 MB | 1007.9 kbit/s | 94.71 | 8.4 s |
| slow | 2.43 MB | 969.7 kbit/s | 94.78 | 15.2 s |
| veryslow | 2.27 MB | 903.8 kbit/s | 94.82 | 47.0 s |
ffmpeg -i ref.mp4 -c:v libx264 -preset slow -crf 23 -an pre_slow.mp4Encode 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.
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.
ffmpeg -t 20 -i tos.mp4 -c copy ref.mp4Limits: 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.