Prompt
How do I compress videos for smaller file sizes without killing quality?
Latest observation
To shrink video files without obvious quality loss, the best approach is to reduce bits intelligently, not just “compress harder.”
What matters most
1) Use a modern codec
If your source is in an older format, re-encode with:
- H.265 / HEVC: better compression than H.264, but slower and less universally compatible
- AV1: even better compression, but slower and still not supported everywhere
- H.264: most compatible, decent compression
If compatibility matters, choose H.264. If file size matters most and playback support is fine, choose HEVC or AV1.
2) Lower resolution only if you can afford it
Resolution has a huge impact on file size:
- 4K → 1080p can cut size dramatically
- 1080p → 720p may still look good for mobile or casual viewing
If the video is already sharp enough for your use, don’t keep more pixels than needed.
3) Reduce bitrate using quality-based encoding
Instead of picking a fixed bitrate, use constant quality / CRF mode:
- Lower CRF = better quality, larger file
- Higher CRF = smaller file, lower quality
Typical CRF starting points:
- H.264: CRF 18–23
- H.265: CRF 20–28
- AV1: CRF 20–30 depending on encoder
Good starting values:
- H.264: CRF 20 or 21
- H.265: CRF 24 or 26
4) Lower the frame rate if it’s unnecessary
If the source is 60 fps and the content doesn’t need it, converting to 30 fps can reduce size a lot. Don’t do this for fast motion, sports, or gameplay unless you’re okay with the change.
5) Use sane audio settings
Audio is usually a small part of the file, but it still helps:
- AAC at 128–160 kbps is usually fine for stereo
- If you don’t need it, downmix multi-channel audio to stereo
- Remove extra audio tracks/subtitles you don’t need
6) Avoid re-encoding unnecessarily
If the video is already in a good format and you only need to trim or remux it:
- Remux instead of re-encoding to avoid quality loss
- Only re-encode when you need smaller size or format conversion
Easy practical settings
For general use
Use:
- Codec: H.264
- Quality: CRF 20–22
- Preset: slow or medium
- Audio: AAC 128–160 kbps
For smaller files with good quality
Use:
- Codec: H.265
- Quality: CRF 24–26
- Preset: slow
- Audio: AAC 128 kbps
If using HandBrake
A good simple setup:
- Format: MP4
- Video codec: H.264 or H.265
- Constant Quality: RF 20–22 for H.264, 24–26 for H.265
- Preset: Fast/Medium/Slow depending on time vs size
- Audio: AAC, 128 kbps stereo
If using FFmpeg
Example with H.264:
ffmpeg -i input.mp4 -c:v libx264 -crf 20 -preset slow -c:a aac -b:a 128k output.mp4
Example with H.265:
ffmpeg -i input.mp4 -c:v libx265 -crf 24 -preset slow -c:a aac -b:a 128k output.mp4
Important tradeoff
There’s no magic setting that gives:
- tiny file size
- perfect quality
- instant encoding
You usually balance:
- smaller size
- encoding time
- playback compatibility
- visible quality
If you want, I can give you:
- best settings for HandBrake,
- best FFmpeg command, or
- a recommendation based on your specific video (1080p, 4K, phone, YouTube, archive, etc.).