Aleksoid1978 / VideoRenderer

Внешний видео-рендерер
GNU General Public License v3.0
1.1k stars 122 forks source link

Saving images when Windows HDR is enabled results in wrong colors #170

Closed RieGo closed 4 months ago

RieGo commented 4 months ago

When you work with windows HDR mode enabled and try to save a (SDR) image from a video, its colors are washed out. when you disable HDR mode they look fine. the result should always be the same IMHO. I'm using MPC-HC and MPC Video Renderer with RTX HDR disabled.

HDR: HDR SDR: SDR

rampageX commented 4 months ago

Use Windows logo key + Shift + R for a HDR video capture.

hdr_screenshot

RieGo commented 4 months ago

I think you misunderstood. I don't need an HDR capture. I need to save a frame of an SDR video file. The result differs, wether windows HDR is enabled or not.

Aleksoid1978 commented 4 months ago

This behavior is normal when watch with HDR passthrough - no HDR -> SDR conversion occurs when saving the image.

clsid2 commented 4 months ago

He said he is playing a SDR video.

But screenshot with Ctrl+J osd would be good to confirm.

Aleksoid1978 commented 4 months ago

No - he's play HDR + passthrough and want save as SDR.

RieGo commented 4 months ago

no, sorry for the confusion. I'm playing an SDR video file and just wanna save an image/screenshot of the video (in my case in mpc-hc) But the image file looks different, based whether i save it with windows HDR enabled or disabled.

Screenshot 2024-07-15 194057

actually I think I just noticed something: I had Nvidia RTX HDR conversion enabled in the video renderer settings but DISABLED in the nvidia driver, so it didn't do anything. Looks like it affects how the images are saved, though. When i disable "RTX Video HDR" in the renderer settings, it works just as expected.

Is this how it is intended? At least for me this kinda solves my issue. Thanks

clsid2 commented 4 months ago

When RTX Video HDR is enabled in the renderer it will assume that is also enabled and working in the graphics driver.

@Aleksoid1978 It should check for feature availability first, like in VLC? https://code.videolan.org/videolan/vlc/-/blob/master/modules/video_output/win32/d3d11_tonemap.cpp#L113 And same for SuperRes: https://code.videolan.org/videolan/vlc/-/blob/master/modules/video_output/win32/d3d11_scaler.cpp#L111

@RieGo Test build that performs capability check: MpcVideoRenderer64.zip

Aleksoid1978 commented 4 months ago

When RTX Video HDR is enabled in the renderer it will assume that is also enabled and working in the graphics driver.

@Aleksoid1978 It should check for feature availability first, like in VLC? https://code.videolan.org/videolan/vlc/-/blob/master/modules/video_output/win32/d3d11_tonemap.cpp#L113 And same for SuperRes: https://code.videolan.org/videolan/vlc/-/blob/master/modules/video_output/win32/d3d11_scaler.cpp#L111

@RieGo Test build that performs capability check: MpcVideoRenderer64.zip

Have you checked? We are checking by vendor, and these checks via VideoProcessorGetStreamExtension always return available, even if I disable it in the Nvidia driver, at least it used to be so.

Aleksoid1978 commented 4 months ago

I double-checked and it is true. Therefore, checking through the VideoProcessorGetStreamExtension call does not make any sense.

Aleksoid1978 commented 4 months ago

Just "RTX Video HDR" in the renderer settings.

clsid2 commented 4 months ago

It may help prevent using it on older unsupported GPU. There are plenty of dumb people who randomly enable checkboxes. Plus performing the check doesn't hurt in any way, and may give Nvidia opportunity to let it return unavailable when disabled in a future driver update. Doing check first seems proper use of the API in my opinion.

I can't test as I am on Win7 right now.

Aleksoid1978 commented 4 months ago

I see no point, at least for now, in adding completely pointless checks. Maybe over time, when they implement this in drivers and these checks will work.

RieGo commented 4 months ago

It's unfortunate that it can't be checked. Let me explain why I enabled the setting: I've become accustomed to switching the setting in the NVIDIA driver because it was always enabled on YouTube. So I figured this was the only way to turn it off globally.

Anyways, thanks for your help.