Skip to content
Awawa edited this page Jan 25, 2025 · 35 revisions

HyperHDR v21 introduced a much simplified color calibration procedure and from now on, all you need to do is play the calibration MP4 file in your favorite video player and HyperHDR will take care of the rest. You no longer need a PC and use a browser to calibrate HDR, which was very inconvenient and in addition it did not calibrate the video player itself, although this option is still there if you want.

HyperHDR v21 was also the first to introduce the NV12 format to flatbuffers. And it is not just an empty convenience because thanks to LUT tables, the resource-consuming and CPU-intensive conversion of NV12 to RGB is eliminated and we can also detect which YUV coef was used by the source. Without LUT and calibration NV12 in flatbuffers, it is just a dummy so called "feature" that even worsens the previous RGB solution. Anyway you can test flatbuffers with and without NV12 enabled and then see in the top command a positive effect in CPU load and memory usage of capturing backend + HyperHDR processes. Remember that piccap may ignore NV12 format for GUI capturing.

Preparation

Remember the following assumptions:

  • calibration only supports YUV/NV12/MJPEG/P010 formats
  • recommended resolution (it does not affect the load during calibration) is 1920x1080. So if you have the "Quarter of frame mode" option enabled in the grabber, you must disable it for the calibration time.

Download the HDR calibration file calibration_HDR_yuv420_limited_range.mp4. If for some reason you want to calibrate SDR (e.g. for webOS) then use: calibration_SDR_yuv420_limited_range.mp4.

Later after the calibration process is complete you can test & play this HDR file for_testing_after_calibration_HDR_yuv420_limited_range.mp4 and check the result in the HyperHDR live preview window.

If you want to calibrate LUT for webOS, it is recommended to either not enable LCH color correction or redirect a piccap stream to your computer and use it as a calibration instance, and then upload the finished LUT to webOS. Unlike the previous version, the current calibration process heavily loads all CPU cores.

HyperHDR procedure

Open the calibration page

1

You can enable LCH color correction, which can significantly improve results, but also causes a significant load on the processor. On the other hand, calibration is only done once, but make sure the processor has adequate cooling. Do not enable LCH correction for P010 video format, as it does not need it at all.

Open the video preview and start playing the test file on your player. You should see dots like in the picture. Then start the calibration. You have to do it rather quickly, because the calibration file is 90 seconds long and the calibration needs about 20 continuous seconds from anywhere in the video. Make sure there is no player interface in the live preview, e.g. progress bar or "Now playing" texts etc. You can close the video preview window to save resources.

For HDR test video pay attention to whether the video has triggered HDR mode on your TV. Otherwise something is wrong with the video player.

2

After a few seconds, you should see confirmation that calibration is working correctly and HyperHDR has recognized the first calibration frames.

3

And after a few minutes it's ready. That's it. You can see detailed calibrated colors in the logs right after calibration.

4

Combining calibrated SDR and HDR LUT tables into one

If you want to combine calibrated SDR LUT table and HDR LUT table and you are using USB grabber with YUV/NV12/P010 format then you can use this command:
dd bs=1 skip=50331648 count=50331648 seek=100663296 if=sdr_input_lut of=hdr_input_and_output_lut

The input/output hdr_input_and_output_lut will contain calibrated data both for SDR and HDR video source.

Support for ZSTD compressed LUT

Required tool: an application that can compress files using ZSTD. For example ZSTD Fork of 7-zip with a support of ZSTD compression https://github.com/mcmilk/7-Zip-zstd

Use 7-zip ZS. Right click on the uncompressed LUT file: 7-zip ZSAdd to archive... You should see the 7-zip compression settings.

  1. Select zstd compression.
  2. Recommended compression level is 17 - maximum.
  3. Do not change the proposed filename.
  4. After creating the compressed LUT, delete the uncompressed LUT file.

HyperHDR should automatically recognize that the uncompressed file does not exist and will try to find a compressed file with the additional .zst extension.

LUT trimming before ZSTD compression

If you are using only calibrated LUTs for NV12/YUV (so tone mapping is also always enabled) you can trim these LUTs for better compression ratio and decompression speed:

fsutil file setzerodata offset=0 length=50331648 <lut_filename>
fsutil file setzerodata offset=100663296 length=50331648 <lut_filename>