Skip to content

JM

currentMigrated from docs/encoders/JM.mdx at 37c3317fd058; modified for Encode Wiki · CC BY-SA 4.0

jvet/JM

vcgit.hhi.fraunhofer.de

H.264/AVC JM reference software

Latest release
JM-19.1
Last commit

JM (Joint Model) is the reference encoder and decoder for H.264 / AVC. It exists for conformance testing and standards work, not for making video people will watch. 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 and VTM.

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

Terminal window
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.

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:

Terminal window
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.