FFmpeg recipe
FFmpeg: Compress an MP4 with HEVC (H.265)
HEVC is roughly half the size of H.264 at the same visual quality. Trade-off: not playable in Chrome / Firefox without H.264 fallback.
Command
ffmpeg -i input.mp4 -c:v libx265 -crf 28 -preset medium -tag:v hvc1 -c:a copy -y output.mp4Prefer no terminal?
Use the Video Compressor in your browser
What each flag does
| -i | Input file. Can be a video, audio, or image. Repeat for multiple inputs. |
|---|---|
| -c:v | Video codec for output. e.g. libx264, libx265, libvpx-vp9. |
| -crf | Constant Rate Factor — quality target (lower = better, larger file). 23 is visually lossless for libx264. |
| -c:a | Audio codec for output. e.g. aac, libmp3lame, copy. |
| -preset medium | HEVC presets are slower than H.264 — medium is a good default. |
| -tag:v hvc1 | Apple-friendly HEVC tag. Without this, Final Cut and QuickTime may not recognize the codec. |
Notes & gotchas
- HEVC CRF 28 ≈ H.264 CRF 23 in visual quality.
- Output will not play in Chrome / Firefox. Use H.264 if you need browser-wide compatibility.
Related recipes
Compress (H.264) · MP4
Compress an MP4 with FFmpeg using H.264 + CRF. Quality-first, content-aware compression with copy-paste command.
Compress to target size · MP4
Compress an MP4 to a specific target file size with FFmpeg two-pass encoding. Useful for upload limits.
Trim · MP4
Trim an MP4 with FFmpeg using stream-copy for lossless, instant output. Copy-paste command with explanations.
Trim (frame-accurate) · MP4
Frame-accurate MP4 trim with FFmpeg. Re-encodes for exact-frame precision — use when -c copy keyframe snapping is not OK.