# HM

Canonical URL: https://encode.wiki/tools/software-encoders/hm/
Content version: ca42e61ede0a24f789d7287a0001244ad22f4abf
Status: current
License: CC BY-SA 4.0
Checksum (SHA-256): 0ec2b04b84b1d74b57629935c13eb9db2de90429dfd49de0ab098da282dc05f9

> **Repository:** [jvet/HM](https://vcgit.hhi.fraunhofer.de/jvet/HM). HEVC HM reference software. Latest release: [HM-18.0](https://vcgit.hhi.fraunhofer.de/jvet/HM/-/releases/HM-18.0), Apr 20, 2023. Last commit: Jul 27, 2026. License: BSD-3-Clause.

HM (HEVC Test Model) is the reference encoder and decoder for [H.265 / HEVC](/codecs/video/hevc/). It exists for conformance testing and HEVC coding-tool research.

As an encoder it is a curiosity. HM has no threading and is slower than [x265](/tools/software-encoders/x265/)'s slowest presets, it places keyframes on a fixed `IntraPeriod` rather than detecting scene changes, and it takes only raw YUV. Use x265 for real work. The VVC and AVC counterparts are [VTM](/tools/software-encoders/vtm/) and [JM](/tools/software-encoders/jm/).

## Build

The latest release is `HM-18.0` (April 2023).

```sh
git clone --branch HM-18.0 https://vcgit.hhi.fraunhofer.de/jvet/HM.git
cd HM
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel
```

Current GCC (16) stops on new warnings because the project builds with `-Werror`; add `-DCMAKE_CXX_FLAGS=-w` to the first `cmake` command to get past them.

This produces `TAppEncoderStatic` and `TAppDecoderStatic` in `bin/`. The manual is in `doc/software-manual.pdf`.

## Encode a raw file

HM needs raw planar YUV plus the size, frame rate and frame count. Settings come from a config file in `cfg/` (`encoder_randomaccess_main10.cfg`, `encoder_lowdelay_main10.cfg`, `encoder_intra_main10.cfg` and so on):

```sh
./bin/TAppEncoderStatic -c cfg/encoder_randomaccess_main10.cfg -i input.yuv -b stream.265 -o recon.yuv \
  -wdt 1280 -hgt 720 -fr 24 -f 48 --InputBitDepth=10 -q 32
./bin/TAppDecoderStatic -b stream.265 -o decoded.yuv
```

`-q` is a fixed QP, not a CRF equivalent. The decoder output should match `recon.yuv` bit for bit. The result is a bare HEVC elementary stream; mux it with [MP4Box](/tools/utilities/mp4box/) or [FFmpeg](/tools/utilities/ffmpeg/).
