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.mp4
Prefer no terminal?
Use the Video Compressor in your browser
Open Video Compressor

What each flag does

-iInput file. Can be a video, audio, or image. Repeat for multiple inputs.
-c:vVideo codec for output. e.g. libx264, libx265, libvpx-vp9.
-crfConstant Rate Factor — quality target (lower = better, larger file). 23 is visually lossless for libx264.
-c:aAudio codec for output. e.g. aac, libmp3lame, copy.
-preset mediumHEVC presets are slower than H.264 — medium is a good default.
-tag:v hvc1Apple-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