Prompt
How do I compress videos for smaller file sizes without wrecking quality?
Latest observation
To shrink video files without making them look terrible, the key is to control bitrate, codec, resolution, and frame rate rather than just “compressing harder.”
Best practices
1) Use a modern codec
Prefer:
- H.265 / HEVC — smaller files than H.264 at similar quality
- AV1 — even smaller, but slower to encode and not as universally supported yet
- H.264 — best compatibility, but larger files
If you want a safe default for sharing, use H.264.
If you want better compression and device support is okay, use H.265.
2) Reduce bitrate carefully
Bitrate is the main factor in file size.
Rough starting points:
- 1080p, 30 fps:
- H.264: 5–8 Mbps
- H.265: 3–5 Mbps
- 1080p, 60 fps:
- H.264: 8–12 Mbps
- H.265: 5–8 Mbps
- 720p, 30 fps:
- H.264: 2.5–5 Mbps
- H.265: 1.5–3 Mbps
For more control, use CRF/CQ modes instead of fixed bitrate.
3) Use CRF instead of constant bitrate
If you’re using FFmpeg:
- Lower CRF = higher quality + bigger file
- Higher CRF = smaller file + lower quality
Good starting values:
- H.264: CRF 18–23 (try 20–22)
- H.265: CRF 20–28 (try 24–26)
Example:
ffmpeg -i input.mp4 -c:v libx264 -crf 21 -preset medium -c:a aac -b:a 128k output.mp4
For H.265:
ffmpeg -i input.mp4 -c:v libx265 -crf 25 -preset medium -c:a aac -b:a 128k output.mp4
4) Lower resolution only if needed
If the source is 4K but you only need web viewing, downscaling to 1080p or 720p can drastically cut size with minimal perceived loss.
Example:
ffmpeg -i input.mp4 -vf scale=1280:-2 -c:v libx264 -crf 21 -preset medium -c:a aac -b:a 128k output.mp4
5) Don’t keep a high frame rate unless necessary
If the original is 60 fps but the content doesn’t need it, converting to 30 fps can reduce size a lot.
Use this only if motion still looks acceptable.
6) Compress audio too
Audio can be smaller:
- AAC 128 kbps is usually fine for most videos
- 96 kbps for speech-only content
- Mono audio can save space if stereo isn’t needed
Example:
-c:a aac -b:a 128k
7) Use two-pass encoding for bitrate targets
If you need a specific file size, use two-pass encoding. This helps distribute bits more efficiently than one-pass bitrate encoding.
Example:
ffmpeg -i input.mp4 -c:v libx264 -b:v 4M -pass 1 -an -f null /dev/null
ffmpeg -i input.mp4 -c:v libx264 -b:v 4M -pass 2 -c:a aac -b:a 128k output.mp4
Simple recommended presets
For general sharing
ffmpeg -i input.mp4 -c:v libx264 -crf 21 -preset medium -c:a aac -b:a 128k output.mp4
Smaller file, still good quality
ffmpeg -i input.mp4 -c:v libx265 -crf 25 -preset medium -c:a aac -b:a 96k output.mp4
If the source is huge and you don’t need full resolution
ffmpeg -i input.mp4 -vf scale=1280:-2 -c:v libx264 -crf 21 -preset medium -c:a aac -b:a 128k output.mp4
What to avoid
- Re-encoding multiple times
- Using very low bitrates
- Lowering resolution too aggressively
- Using “ultrafast” presets unless speed matters more than size/quality
If you want the easiest answer
For most videos, start with:
- H.264
- CRF 20–22
- AAC 128k
- Optional downscale to 1080p or 720p
If you tell me:
- the video resolution/fps,
- whether it’s for web, phone, archive, or sharing,
- and what software you’re using,
I can suggest the best exact settings.