emoose / VideoRenderer

RTX HDR modded into MPC-VideoRenderer.
GNU General Public License v3.0
1.29k stars 67 forks source link

Weird issue with HDR10 tone and Windows HDR (aka automatic color management). #35

Closed DimkaTsv closed 3 months ago

DimkaTsv commented 9 months ago

Description: I don't own HDR compatible monitor, and tried to avoid HDR movies like plague. (Conversion to SDR with passthrough makes color duller and lighting cramped, while disabling HDR turns picture into bleak nonsense).

But i do have HDR10 sample, and with that latest addition of Windows "automatic application color management" aka Windows HDR support, i finally was able too see what is that HDR huss about. It did actually work, giving HDR feel for SDR monitor in terms of brightness level allocation. And It looks more or less nice.. (question about looking for HDR sources is still open, but at least i wasn't disappointed by result, as it did change how MPC-VR interprets HDR for SDR monitor on feel. At least it did feel as if i am not actively penalized for trying to play HDR content on SDR monitor.)

But then i noticed issue. When i play said HDR10 sample, it looks to be too yellow. Brightness is right, but color is not. I questioned it at first, but when i paused sample, it all made sense. After half a second it corrects red color to proper level. And such behaviour is specific to windowed mode. In fullscreen mode, it won't correct color at all. If i disable Windows HDR and then continue playing, light becomes duller, but colors are correct all the time.

Now to the weird part. I can neither screenshot, nor screen record issue, because on screenshots color is correct, and when doing screen capture issue does not appear at all! Maybe i can do recording on my phone, if situation really will require it. But despite it being proper on screenshots, i see no changes in actual video when i press PrintScreen

Another, but smaller weird part is that with OBS capture issue still appears, but i unable to record it, while during ReLive capture capture issue completely disappears. Even at fullscreen!!! But, on other hand, i still cannot record this interaction due to other bug. That automatic color management causes ReLive captures of desktop and windowed applications to become darkened to great extend, as if brightness got nuked down. Probably some HDR related incompatability?

Setup: Windows 11, 23H2, build 22631.3155 GPU: AMD RX 7800XT 16GB Driver: AMD Adrenalin 24.2.1

------------------------
MPC-HC (Nightly, 64-bit)
------------------------

Build information:
    Version:            2.1.5.31 (0cbfa6b97)
    Compiler:           MSVC v19.29.30154
    Build date:         Feb 27 2024

LAV Filters:
    LAV Splitter:       0.78.0.3
    LAV Video:          0.78.0.3
    LAV Audio:          0.78.0.3
    FFmpeg compiler:    MinGW-w64 GCC 13.2.0

Operating system:
    Name:               Windows 11 (Build 23H2)
    Version:            10.0.22631 (64-bit)

Hardware:
    CPU:                AMD Ryzen 7 5800X3D 8-Core Processor
    GPU:                AMD Radeon RX 7800 XT (driver version: 31.0.24019.1006)

Sample MediaInfo data:

General
Unique ID                      : 114375377639820209918900717666083560922 (0x560BE57F0A02589172EA14A3FF0C5DDA)
Complete name                  : C:\Users\DimkaTsv\Videos\test sample\Test_softer.mkv
Format                         : Matroska
Format version                 : Version 4
File size                      : 1.47 GiB
Duration                       : 2 min 41 s
Overall bit rate               : 78.3 Mb/s
Frame rate                     : 23.976 FPS
Encoded date                   : 2023-06-04 19:46:28 UTC
Writing application            : mkvmerge v77.0 ('Elemental') 64-bit
Writing library                : libebml v1.4.4 + libmatroska v1.7.1

Video
ID                             : 1
Format                         : HEVC
Format/Info                    : High Efficiency Video Coding
Format profile                 : Main 10@L5.1@High
HDR format                     : SMPTE ST 2086, HDR10 compatible
Codec ID                       : V_MPEGH/ISO/HEVC
Duration                       : 2 min 41 s
Bit rate                       : 78.3 Mb/s
Width                          : 3 840 pixels
Height                         : 2 160 pixels
Display aspect ratio           : 16:9
Frame rate mode                : Constant
Frame rate                     : 23.976 (24000/1001) FPS
Color space                    : YUV
Chroma subsampling             : 4:2:0 (Type 2)
Bit depth                      : 10 bits
Bits/(Pixel*Frame)             : 0.394
Stream size                    : 1.47 GiB (100%)
Writing library                : ATEME Titan File 3.9.0 (4.9.0.0)        
Default                        : Yes
Forced                         : No
Color range                    : Limited
Color primaries                : BT.2020
Transfer characteristics       : PQ
Matrix coefficients            : BT.2020 non-constant
Mastering display color primar : Display P3
Mastering display luminance    : min: 0.0050 cd/m2, max: 1000 cd/m2
Maximum Content Light Level    : 845 cd/m2
Maximum Frame-Average Light Le : 196 cd/m2

=============================

Did additional testing. If i slow down playback to 0.5x, or slower, MPC-VR will present proper colors in windowed mode all the time. But still won't do it in fullscreen mode. Unless i enable ReLive (and specifically ReLive) screen capture. Then color is correct even in fullscreen mode.

DimkaTsv commented 3 months ago

Looks like

  1. I sent this issue to wrong place.
  2. MPCVR detecting SDR monitors as HDR when W11 automatic color management was enabled was an issue. Now it doesn't do so.