3/16/2026
Compress 4K video with FFmpeg using H.264, H.265, CRF, presets, and optional downscaling. Includes practical commands for smaller uploads and web delivery.
How to Compress 4K Video with FFmpeg
4K video files can become huge very quickly. The best FFmpeg approach is usually quality-based compression with CRF, then optional downscaling if 4K resolution is not required.
For an interactive command builder, use the Compress Video tool.
Recommended 4K Compression Command
ffmpeg -i 4k-input.mp4 -c:v libx264 -crf 23 -preset medium -c:a aac -b:a 128k -pix_fmt yuv420p -movflags +faststart 4k-compressed.mp4
This creates a compatible H.264 MP4 with a practical balance of quality and file size.
Use this when:
- You want to keep the video at 4K.
- You need the result to play on common devices and browsers.
- You want quality-based compression instead of guessing a bitrate.
Choosing CRF for 4K
| CRF | Result | Use when |
|---|---|---|
18-20 |
High quality, larger file | Archiving, client delivery, premium output |
22-24 |
Balanced | General uploads and web video |
26-28 |
Smaller file, visible loss possible | Sharing, previews, storage savings |
Start with 23. If the output is still too large, try 25 or 28. If details look soft, try 20.
Use H.265 for Smaller 4K Files
H.265 can reduce 4K file size more efficiently than H.264, but compatibility is less universal:
ffmpeg -i 4k-input.mp4 -c:v libx265 -crf 28 -preset medium -c:a aac -b:a 128k 4k-hevc.mp4
Use H.265 when the audience uses modern devices, or when the file is for storage rather than broad web playback.
Downscale 4K to 1080p
If viewers do not need 4K, downscaling gives the biggest file-size reduction:
ffmpeg -i 4k-input.mp4 -vf "scale=-2:1080" -c:v libx264 -crf 22 -preset medium -c:a aac -b:a 128k 1080p-output.mp4
The -2 keeps the width proportional and valid for H.264/H.265 encoders.
What the Options Mean
| Option | Meaning |
|---|---|
-c:v libx264 |
Encodes with H.264 for broad compatibility. |
-c:v libx265 |
Encodes with H.265 for better compression on modern devices. |
-crf |
Controls quality and size. Lower means higher quality. |
-preset medium |
Balances encoding speed and compression efficiency. |
-pix_fmt yuv420p |
Improves playback compatibility. |
-movflags +faststart |
Helps web playback start sooner. |
Common Problems
The compressed 4K file is still too large.
Try a higher CRF, use H.265, or downscale to 1080p.
The video takes too long to encode.
Use -preset fast or -preset veryfast. The file may be slightly larger.
The output does not play on older devices.
Use H.264 instead of H.265, keep .mp4, and include -pix_fmt yuv420p.
Related FFmpeg Pages
- Build a custom command with the Compress Video tool.
- See the recipe: Compress MP4 with FFmpeg.
- Learn the general guide: Compress video with FFmpeg.
Related tool
Compress Video with FFmpeg
Generate FFmpeg commands to reduce video file size with CRF, codec, preset, and resolution controls.
Open the command generator