# JM

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

> **Repository:** [jvet/JM](https://vcgit.hhi.fraunhofer.de/jvet/JM). H.264/AVC JM reference software. Latest release: [JM-19.1](https://vcgit.hhi.fraunhofer.de/jvet/JM/-/releases/JM-19.1), Apr 20, 2023. Last commit: Apr 13, 2026.

JM (Joint Model) is the reference encoder and decoder for [H.264 / AVC](/codecs/video/avc/). It exists for conformance testing and standards work, not for making video people will watch. [x264](/tools/software-encoders/x264/) is far faster and looks better at a given bitrate, thanks to its psychovisual optimizations, adaptive quantization and MB-tree. The HEVC and VVC counterparts are [HM](/tools/software-encoders/hm/) and [VTM](/tools/software-encoders/vtm/).

## Build

The latest release is `JM-19.1` (April 2023).

```sh
git clone --branch JM-19.1 https://vcgit.hhi.fraunhofer.de/jvet/JM.git
cd JM
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_C_FLAGS=-w -DCMAKE_CXX_FLAGS=-w` to the first `cmake` command to get past them. The encoder and decoder are copied to `bin/lencod_static` and `bin/ldecod_static`.

## Encode with a config file

JM is driven entirely by config files, and it reads raw YUV. The `cfg/` directory ships a tiny QCIF clip and a matching baseline-profile config, which is the easiest way to see it work:

```sh
cd cfg
../bin/lencod_static -d encoder_baseline.cfg
../bin/ldecod_static -d decoder.cfg
```

The decoder's `decoder.cfg` reads `test.264`, the encoder's default output name.

For your own input, copy a config and change `InputFile`, `OutputFile`, `ReconFile`, `SourceWidth`, `SourceHeight`, `FramesToBeEncoded` and `FrameRate` together. `ProfileIDC` picks the profile (66 baseline, 77 main, 88 extended, 100 high, 110 high 10, 122 high 4:2:2, 244 high 4:4:4), and `QPISlice`, `QPPSlice` and `QPBSlice` set the quantizer for I, P and B slices (0–51). They are fixed QPs, not a CRF. JM also has rate control (`RateControlEnable`, `Bitrate` in bits/s). Start from `encoder_main.cfg` (Main profile with B-frames) rather than the baseline one if you want anything beyond baseline tools. To decode another stream, change `InputFile` in `decoder.cfg`.
