What Is HEVC / H.265?
HEVC — High Efficiency Video Coding — is the video compression standard that succeeded H.264/AVC. Jointly developed by the ITU-T Video Coding Experts Group (VCEG) and the ISO/IEC Moving Picture Experts Group (MPEG) under the Joint Collaborative Team on Video Coding (JCT-VC), HEVC was finalized in 2013 and published as ISO/IEC 23008-2 and ITU-T H.265.
HEVC's defining achievement: equivalent visual quality to H.264 at approximately half the bit rate. This efficiency gain comes at the cost of dramatically higher computational complexity — HEVC encoding is 5–10× slower than H.264 at equivalent quality settings.
HEVC is the dominant codec for:
- 4K UHD streaming (Netflix, Disney+, Amazon Prime — all use HEVC for 4K)
- 4K Blu-ray discs (BDMV spec mandates HEVC for UHD Blu-ray)
- HEIF images (the still-image application of HEVC — default on Apple devices since iOS 11)
- Video surveillance (H.265 halves storage requirements)
- Broadcast TV (DVB-T2, ATSC 3.0, ISDB-T2 all support HEVC)
Key Improvements Over H.264
Larger Coding Unit (CTU vs. Macroblock)
H.264 uses 16×16 macroblocks. HEVC introduces the Coding Tree Unit (CTU) with a maximum size of 64×64 pixels. The CTU can be recursively split into smaller Coding Units (CU) down to 8×8, allowing the encoder to use large units for flat regions (one prediction for a 64×64 block) and small units for detail areas. This quadtree structure dramatically reduces overhead for high-resolution content.
Improved Intra Prediction
H.264 has 9 intra prediction directions. HEVC expands to 35 intra prediction directions (33 angular modes + planar + DC), allowing much better prediction of textured surfaces, diagonal edges, and complex patterns.
Advanced Motion Compensation
- Merge mode: inherit motion vectors from neighboring blocks without explicit signaling.
- Advanced TMVP: temporal motion vector predictor from previously encoded frames.
- Overlapped Block Motion Compensation (OBMC) (in some profiles).
- 1/4-pixel precision for luma, 1/8-pixel for chroma.
In-Loop Filters
HEVC adds two in-loop filters applied during encoding (which means reference frames are deblocked/denoised, improving prediction quality):
- Deblocking filter: removes blocking artifacts at CTU boundaries.
- Sample Adaptive Offset (SAO): reduces ringing artifacts by classifying samples and adding offsets — a novel addition not present in H.264.
HEVC Profiles
| Profile | Bit depth | Chroma format | Use case |
|---|---|---|---|
| Main | 8-bit | 4:2:0 | Consumer streaming, broadcasting |
| Main 10 | 8/10-bit | 4:2:0 | HDR video (most common profile) |
| Main Still Picture | 8-bit | 4:2:0 | HEIF images |
| Main 12 | 12-bit | 4:2:0 | Professional mastering |
| Main 4:2:2 10 | 10-bit | 4:2:2 | Professional production |
| Main 4:4:4 | 8-12 bit | 4:4:4 | High quality post-production |
| Scalable Main | — | — | Streaming with multiple quality layers |
| Multiview Main | — | — | 3D/VR video |
| Screen Content Coding | — | — | Screen recordings, text, graphics |
Main 10 is the dominant profile for consumer use — it is required for HDR10 content and supported by virtually all modern hardware decoders.
HEVC and HDR
HEVC is the first codec standardized alongside major HDR technologies:
- HDR10: HEVC Main 10, static metadata (MaxCLL, MaxFALL) via SEI messages.
- HDR10+: Dynamic metadata per scene (Samsung/Amazon).
- Dolby Vision: Dual-layer HEVC with BL (base layer) + EL (enhancement layer), or single-layer with RPU metadata.
- HLG (Hybrid Log-Gamma): BBC/NHK HDR system for broadcast.
HDR requires 10-bit encoding (Main 10 profile) to provide sufficient precision for the BT.2020 wide color gamut.
ffmpeg HEVC Encoding
# Software encode (libx265) — high quality, slow
ffmpeg -i input.mp4 -c:v libx265 -crf 28 -preset medium output.mp4
# Hardware encode — NVIDIA NVENC
ffmpeg -i input.mp4 -c:v hevc_nvenc -rc:v vbr -cq:v 28 output.mp4
# Hardware encode — Intel QSV
ffmpeg -i input.mp4 -c:v hevc_qsv -global_quality 25 output.mp4
# Hardware encode — Apple VideoToolbox (macOS)
ffmpeg -i input.mp4 -c:v hevc_videotoolbox -q:v 60 output.mp4
# 4K HDR10 encoding
ffmpeg -i input.mkv \
-c:v libx265 -crf 20 -preset slow \
-x265-params "hdr-opt=1:repeat-headers=1:colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc:master-display=G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,50):max-cll=1000,400" \
-c:a copy output_hdr10.mkv
# Convert H.264 to HEVC (quality-preserving transcode)
ffmpeg -i input_h264.mp4 -c:v libx265 -crf 24 -preset medium -c:a copy output_hevc.mp4
CRF Values for libx265
| CRF | Quality | File size vs. CRF 28 |
|---|---|---|
| 18 | Visually lossless | ~3× larger |
| 22 | Excellent | ~1.5× larger |
| 24 | Very good | ~1.2× larger |
| 28 | Good (default) | Reference |
| 32 | Acceptable | ~0.7× |
| 36 | Low | ~0.5× |
| 51 | Worst | Smallest |
HEVC Licensing: The Patent Minefield
HEVC's biggest practical problem is its patent licensing situation. Three patent pools and numerous individual licensors claim essential patents:
- HEVC Advance: ~USD 0.60 per device, or 0.2% of revenue
- Velos Media: additional license required
- Via LA: another pool with different terms
- Individual licensors: Qualcomm, Sisvel, others
This fragmentation led many companies to seek HEVC-free alternatives, driving adoption of AV1.
HEVC Container Formats
HEVC is typically stored in:
- HEVC Annex B (
.hevc,.265): raw bitstream, used in broadcasting - MP4/ISOBMFF (
.mp4,.m4v): standard web and consumer container - Matroska (
.mkv): preferred for archiving and PC playback - MPEG-TS (
.ts,.m2ts): broadcast and Blu-ray - MOV (
.mov): Apple's container
HEVC vs. H.264 vs. AV1
| Property | H.264 | HEVC | AV1 |
|---|---|---|---|
| Year | 2003 | 2013 | 2018 |
| Bit rate vs. H.264 | Reference | ~50% lower | ~30–50% lower |
| Encoding complexity | Reference | ~5× higher | ~20× higher |
| Decoding complexity | Reference | ~2× higher | ~3-5× higher |
| HW decode | Universal | Most modern | Growing (2021+) |
| License | Free (patents expired) | Expensive, fragmented | Royalty-free |
| 4K streaming | Common | Dominant | Growing |
| Browser support | Universal | Partial | Growing |
Best Practices
- For 4K/HDR content, HEVC (Main 10) is the current standard — all streaming platforms and UHD Blu-ray use it.
- Use CRF 24–28 with libx265 for a good quality/size balance.
- Use hardware encoders (NVENC, QSV, VideoToolbox) for real-time or near-real-time encoding.
- Use software encoder (libx265) for archiving — better quality at same file size.
- Use
.mkvcontainer for HEVC archives — MKV handles HEVC streams cleanly. - For HDR10, set correct metadata (MaxCLL, MaxFALL, mastering display) for proper tone mapping.
- For 1080p and below, consider AV1 or H.264 — HEVC licensing costs may not be justified.
- Preset
sloworslowergives ~10–15% better compression thanmediumat significant time cost. - Use
--poolsflag in x265 to control thread usage on multicore systems. - For broadcast, use HEVC Annex B in MPEG-TS containers with the appropriate profile level tier.
Related conversions
Common video conversions that pair well with this guide: