VideoRenderer icon indicating copy to clipboard operation
VideoRenderer copied to clipboard

add RTX video enhancement HDR to MPC video renderer.

Open finasfinas opened this issue 2 years ago • 47 comments

RTX video enhancement HDR was added to driver version 551.23. It's an AI powered feature just like super resolution. It can be enabled on the nvidia control panel and it needs requesting the feature from the renderer.

https://blogs.nvidia.com/blog/rtx-video-hdr-remix-studio-driver/ https://www.tomshardware.com/pc-components/gpu-drivers/nvidia-adds-ai-powered-sdr-to-hdr-video-enhancement-to-its-latest-drivers-rtx-video-hdr-now-available-for-all-rtx-owners

finasfinas avatar Jan 24 '24 19:01 finasfinas

I'm looking forward to integrating this feature as well.

hsy5571615 avatar Jan 25 '24 15:01 hsy5571615

The build at https://github.com/Aleksoid1978/VideoRenderer/issues/116#issuecomment-1911214362 appears to support it, not sure if it's working as well as in chrome/edge though.

emoose avatar Jan 26 '24 04:01 emoose

I knew you would come to the rescue! many many thanks for putting in the time and work. Will try it!

Cheers

PedroM4 avatar Jan 26 '24 13:01 PedroM4

The build at Aleksoid1978#116 (comment) appears to support it, not sure if it's working as well as in chrome/edge though.

I tried this test build and works just as well as in chrome.

However it washes out the colors if the video is already in HDR format. Screenshot when playing an HDR video using the test build : https://i.imgur.com/7ihMFgk.jpeg Screenshot when playing the same video using the latest released build 0.7.1.2172 : https://i.imgur.com/0zJHW1U.jpeg

Naboum avatar Jan 26 '24 14:01 Naboum

@Naboum could you see if this build works any better? Added a check so RTX HDR is only enabled if source video isn't HDR:

MpcVideoRenderer64-rtxhdr1.1.zip

emoose avatar Jan 26 '24 15:01 emoose

@Naboum could you see if this build works any better? Added a check so RTX HDR is only enabled if source video isn't HDR:

MpcVideoRenderer64-rtxhdr1.1.zip

I've tested this version and it correctly distinugishes between native-hdr video files and sdr-ones. Well done!

Btw. thank you SO much for making this happen! <3

geahad avatar Jan 26 '24 16:01 geahad

@Naboum could you see if this build works any better? Added a check so RTX HDR is only enabled if source video isn't HDR:

MpcVideoRenderer64-rtxhdr1.1.zip

It now works correctly, thank you.

Naboum avatar Jan 26 '24 16:01 Naboum

Glad to hear, pushed 1.1 release at https://github.com/emoose/VideoRenderer/releases/tag/rtx-hdr-1.1 which includes the change along with a fix to let VSR work up to 1440p

emoose avatar Jan 26 '24 16:01 emoose

There seems to be one little caveat though (but that one's on nvidia): If the file is native HDR and is lower res than display native res (ex. 1080 on a 2160p screen), VSR is used, and then the hdr image stays washed-out, because for some reason VSR can be done before upgrading to an HDR tonemap, but it can't be done if VSR tries to manipulate a native HDR image. If I remember correctly, this was the case with VSR since the beginning.

Also, if I may ask for a little something more: the latest versions of the renderer have options to select above which resolution VSR should kick-in. The highest available from the drop down is "eqal to or lower than 1080p". I'm on a 2160p display and actually liked using VSR to upscale from 1440p also (is offciially supported, worked in previous versions). Could that ("equal to or lower than 1440p) option be added to the drop down?

geahad avatar Jan 26 '24 16:01 geahad

Ahaha, sorry... Haven't seen you've already integrated tha 1440p thing already...

You work very quickly :-D

geahad avatar Jan 26 '24 16:01 geahad

Glad to hear, pushed 1.1 release at https://github.com/emoose/VideoRenderer/releases/tag/rtx-hdr-1.1 which includes the change along with a fix to let VSR work up to 1440p

I played a 4K native-hdr video in fullscreen and the colors are again washed out. However in windowed mode it works great. It only happens when Super Resolution is enabled in the settings.

EDIT : same thing happens when playing a 720p native-hdr video while in fullscreen and Super Resolution setting set to <= HD or higher, and when playing a 1080p native-hdr video while in fullscreen and Super Resolution setting set to <= Full HD or lower.

Naboum avatar Jan 26 '24 16:01 Naboum

There seems to be one little caveat though (but that one's on nvidia): If the file is native HDR and is lower res than display native res (ex. 1080 on a 2160p screen), VSR is used, and then the hdr image stays washed-out, because for some reason VSR can be done before upgrading to an HDR tonemap, but it can't be done if VSR tries to manipulate a native HDR image. If I remember correctly, this was the case with VSR since the beginning.

If you try playing a native hdr 1080p video on youtube with a 4K monitor, with both VSR and HDR enabled in Nvidia control panel, the colors aren't washed out. Does that mean VSR is automatically disabled by chrome during this scenario ?

EDIT : It does seem that Chrome doesn't enable VSR when playing a native-hdr video even if the setting is checked in NVCP. Maybe MPCVR should have the same behavior ? Otherwise we have to manually disable VSR in MPCVR settings when we want to play a native hdr video and enable it again after.

Naboum avatar Jan 26 '24 17:01 Naboum

Also observe issues with colors, but in my case they are bleak in the "HDR Off" mode.

iG8R avatar Jan 26 '24 18:01 iG8R

The RTX HDR seems to be breaking when watching SDR 10-bit content

10-bit video 20240126_152734

After converting the file to 8-bit the HDR works as expected 20240126_152711

EDIT: tried loading the file in a browser video player extension and the HDR doesn't seem to kick in when loading 10 bit content (it works for the 8-bit version in the extension as well, so I guess 10 bit is not supported)

Raxcoms avatar Jan 26 '24 18:01 Raxcoms

Hmm, guess maybe we should only try enabling superres for non-native-HDR content seeing as NV mention that VSR doesn't support HDR, and should also only enable RTX HDR when it's a HDR display.

tried loading the file in a browser video player extension and the HDR doesn't seem to kick in when loading 10 bit content (it works for the 8-bit version in the extension as well, so I guess 10 bit is not supported)

Ah nice was just going to ask if you could try that, yeah would guess it probably doesn't like 10-bit, I'll see if I can add a check to only enable for 8-bit formats (if you change your internal filters > video decoder settings in MPC then it should be able to convert 10-bit to 8-bit automatically)

E: here's a build with those changes: rtx-hdr-1.2-test.zip

emoose avatar Jan 26 '24 18:01 emoose

Hmm, guess maybe we should only try enabling superres for non-native-HDR content seeing as NV mention that VSR doesn't support HDR, and should also only enable RTX HDR when it's a HDR display.

tried loading the file in a browser video player extension and the HDR doesn't seem to kick in when loading 10 bit content (it works for the 8-bit version in the extension as well, so I guess 10 bit is not supported)

Ah nice was just going to ask if you could try that, yeah would guess it probably doesn't like 10-bit, I'll see if I can add a check to only enable for 8-bit formats (if you change your internal filters > video decoder settings in MPC then it should be able to convert 10-bit to 8-bit automatically)

E: here's a build with those changes: rtx-hdr-1.2-test.zip

Weird. NCP reports that HDR Video Enhancement is off when playing 10-bit video in MPC, but it still looks like the first image in my last post

Rolled back to version 1.1 and the same happens there, NCP reports HDR Video Enhancement off, but the player still outputs a broken HDR image

Also tried opening the file with the stock Video Renderer from Aleksoid1978 to check if there was something broken with the player always showing 10bit video as HDR, but the video plays fine there

Raxcoms avatar Jan 26 '24 19:01 Raxcoms

Oh might have an idea what it is, for RTX HDR to work this removed a check for it being HDR source so it'd use right color space, with SDR it works fine since RTX HDR will convert it, but since RTX doesn't handle 10-bit I guess that makes it use the wrong colors.

Maybe this build can fix it, should only use that color space if it's HDR or 8-bit: rtx-hdr-1.2-test2.zip

emoose avatar Jan 26 '24 19:01 emoose

Oh might have an idea what it is, for RTX HDR to work this removed a check for it being HDR source so it'd use right color space, with SDR it works fine since RTX HDR will convert it, but since RTX doesn't handle 10-bit I guess that makes it use the wrong colors.

Maybe this build can fix it, should only use that color space if it's HDR or 8-bit: rtx-hdr-1.2-test2.zip

Seems to be working fine now!

Raxcoms avatar Jan 26 '24 20:01 Raxcoms

Hi, I have a weir problem in MPC-BE x64 1.6.11, HDR and Super Resolution work when windowed, but when going fullscreen it works when the OSD is visible, once it disappear both get disabled. It also work when the UI is visible when going to the bottom of the player in fullscreen, it disabled when only the video is visible.

I tried disabling the OSD, it's worse, going fullscreen when the video is playing just gives a black screen and I have to reload the video to get it to work again. If I pause the video before going fullscreen, there's no black screen but no HDR nor VSR.

I tried the 1.1 and 1.2-test2 and got the same issue.

EDIT : looks like an NVidia issue, it does the same in the browser now, on Youtube it works until the UI disappears, something broke I don't know how.

XcellMiguel avatar Jan 26 '24 23:01 XcellMiguel

@Raxcoms I tried playing an sdr 10bit video in chrome and the rtx hdr does its job correctly, it's weird that it doesn't work for you. MediaInfo of my sample test : https://i.imgur.com/7BUgez2.png

Naboum avatar Jan 26 '24 23:01 Naboum

@Naboum weird. I have two 10-bit files and neither work for me Both can't be played with chrome's default video player And when played with the media player video extension HDR doesn't kick in in neither as well (but does with other files)

Media info 1: link Media info 2: link

Also both give me the broken hdr output

Raxcoms avatar Jan 27 '24 00:01 Raxcoms

still getting overblown out colors playing 10 bit hevc videos with test 2 myself

SESNut avatar Jan 27 '24 00:01 SESNut

@Raxcoms What do you mean by "they cant be played" ? You can't drag and drop the file to a new tab ? Are they mkv ? Unfortunately without playing your file on my monitor, I don't know how to replicate your issue. Your mediainfo data seems fine.

Naboum avatar Jan 27 '24 01:01 Naboum

Yes, they are .mkv files Chrome just prompts me to download the file rather than playing it

Raxcoms avatar Jan 27 '24 02:01 Raxcoms

still getting overblown out colors playing 10 bit hevc videos with test 2 myself

Seems one of the color depth checks I added wasn't working right since the depth value wasn't setup yet, hopefully this build fixes that: ~~rtx-hdr-1.2-test3.zip~~

~~Still won't enable RTXHDR for 10-bit SDR though, in Vivaldi it looks like RTXHDR does support it, but haven't been able to get it working in MPC without colors being washed out :/~~

E: oh might have figured out RTXHDR for 10-bit SDR now, just had to loosen some of the checks I'd added. Here's a build if anyone wants to test, let me know if you see any wrong colors: ~~rtx-hdr-1.2-test4.zip~~

E2: removed some redundant code I'd added: ~~rtx-hdr-1.2-test4a.zip~~

E3: one more test build, this should be able to disable all the autoHDR stuff if it failed to be enabled (eg. old driver ver, or not NV card), should now reinit with correct colors instead of still using HDR colorspace:

~~rtx-hdr-1.2-test5.zip~~

Posted release at https://github.com/emoose/VideoRenderer/releases/tag/rtx-hdr-1.2

emoose avatar Jan 27 '24 03:01 emoose

works now 👍

SESNut avatar Jan 27 '24 04:01 SESNut

if i select 8 bit texture format on an 8 bit video the colors are still screwed up and it reports rtx hdr as inactive. It activates fine if i choose 10 or 16 though

SESNut avatar Jan 27 '24 04:01 SESNut

Yes, they are .mkv files Chrome just prompts me to download the file rather than playing it

Chrome doesn't like mkv, you have to convert it to mp4

Naboum avatar Jan 27 '24 09:01 Naboum

Posted release at https://github.com/emoose/VideoRenderer/releases/tag/rtx-hdr-1.2

My .mkv 10-bit files are playing with auto HDR properly now!

Raxcoms avatar Jan 27 '24 12:01 Raxcoms

Would be kinda cool if it worked for image inputs as well.

Kacarek avatar Jan 27 '24 22:01 Kacarek