INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Beginners' Guide to madVR HDR  (Read 47000 times)

tij

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1563
Beginners' Guide to madVR HDR
« on: July 17, 2020, 12:53:16 pm »

Could not apparently fit HDR portion into my original MadVR beginner guide ... so created separate one here

I am long overdue with this HDR stuff. I will try to explain this in simple terms ... skipping most technical details which I myself dont fully understand. Basics are looong ... so bear with me :)

First, color space. It basically defines what and how colors/brightness are encoded into video. Basically setting limits on how bright and saturated image can be.

DVD use rec601 ... BluRay rec709 ... and digital cinema DCI-P3. Each of these expanded saturation compared to previous one ... while leaving brightness limits virtually untouched (~100nits). So grass can be specified greener in rec709 compared to rec601.

It is important to note that for cinema, videos are mastered for expected cinema brightness ... which is about 50nits. While for DVD and Bluray same films are mastered for commercial TV which is about 100nits at the time.

With UHD ... bt2020 was introduced ... aka HDR ... that vastly expanded not only saturation limits but brightness too. Specifically for brightness ... the limit now is 10,000nits.

It is important to note that allowed values for brightness and saturation in bt2020 is not even. Significantly more values are allocated in 0-300nits range with only small portion allocated to higher nits range (higher nits you go - less values you can specify). That's because all important stuff happens in 0-300nits range. So having more values here allows pictures to have more details in this range (hence UHD can have significantly more details in dark scenes than HD ... but it does not make black blacker as some claim).

Above 300 nits is for highlights. Usually only small potion of picture goes to very high brightness. This allows for details in bright areas like sky, sun, explosion that previously was not possible with other colorspaces.

All sounds good ... except ... no commercial display can fully cover bt2020. Not just brightness but saturation too (so your TV might not be able to render grass as green as UHD disc wants it too ... even if that grass is not very bright).

Thats where tone mapping comes. Its basically a logic that maps bt2020 to what dispay can actually display. In nutshell - it compresses (your TV can display 0-600nits ... so it compresses 0-10000 range to 0-600). This type of compression obviously degrade quality.

To reduce amount of compression ... HDR have metadata that among other things specify peak brightness of whole video. So if peak brightness of movie is 2000nits ... that hypothetical TV i mention above will only need to compress 0-2000 to 0-600 ... less compression - better quality. Thats HDR10 fo you.

Dolby Vision and HDR10+ go further and specify peak brightness for each scene ... so you have less compression on darker scenes.

Now to the biggest problem. With exception of Dolby Vision - there is no strict standard on how tone mapping should be done. Each manufacturer do their own thing based on their skills and processing power available in TV (so yes ... TV with better processor can potentially have better tone mapping algorithm)

You are not, however, limited to tone mapping on TV/projector. You can do tone mapping in dedicated processors (like Lumagen and MadVR Envy) or on PC.

When TV/projector is doing tone mapping, it will often pops up HDR logo to indicate it is doing so (it does so when it receive HDR metadata in video stream). In most cases, TV will boost its brightness while doing so too. That HDR logo does not mean that TV enters into some sort of magical HDR state that make image magically better (though most people will assume that ... and hence perceive that ... aka placebo effect). All it means is TV is doing tone  mapping (that actually degrade original quality video into something that TV can actually display).

When you use dedicated processors or PC to do tone mapping ... TV will not pop up HDR logo as it is not doing tone mapping ... most ppl automatically assume and perceive it as bad.

Now that we cover basics ... lets get back to PC. Some media players on PC have tone mapping (MC RO Standard, VLC, Kodi, Plex). As they usually have no setting to change for HDR ... I suspect they assume that your display has no HDR and hence tone map to standard 100nits of SD (this is understandable as it makes using this much easier for average Joe).

MadVR allows you to specify your target nits ... while this requires some knowledge ... it reduces compression and hence improve quality.

Furthermore ... MadVD strives to preserve hue/color while compressing (so your red explosion does not turn into orange one durung tone mapping). In harry potter deatly hallow 2 ... train station scene ... my LG E6 tone mapping adds slight greenish hue to red lamps ... no such thing in MadVR.

Now to MadVR settings. HDR options are located in [devices]->["name of your device"]->[hdr]

1) let MadVR decide - no explanation is needed for this one lol

2) passthrough HDR to display - madVR does not do any tone mapping and just sends video to TV. If this choice is chosen, check box will be available [send HDR metadata to the diplay] ... ticking it will make TV/projector do tone mapping (HDR logo will pop up when movie start playing ... unticking it - TV/projector will do nothing and video will appear washed out

if you tick [send HDR metadata to the display] and let your TV/projector do tone mapping - be aware that using mouse to bring MC play controls will bring your TV/projector out of HDR mode and the video will be washed out ... TV/projector will enter HDR mode as soon as MC play controls disappear ... if that annoys you, use keyboard to control playback

3) tone map HDR using external 3DLUT - if you know what that means, you are likely expert and will not be reading this guide lol ... if you don't know what that means - just skip this option

4) tone map HDR using pixel shaders - this is where the magic is and tells MadVR to do tone mapping. Selecting this brings more options:

[target nits] - from what I understand this is not absolute value of your display peak brightness. Though you should start with that value. Lowering this will make picture brighter. Increasing this will increase "HDR effect". Read somewhere (but cannot recall where) that if this value is above 480, then madVR will not compress 0-300 range of video essentially preserving most important part of the video intact. Setting this below 480 will start affect 0-300 range but might be necessary if you have projector

[tone mapping curve] - just leave it at BT.2390

[color tweak for fire & explosions] - essentially when tone mapping very bright fire (or other very bright stuff), MadVR will try to achieve highest brightness without sacrificing color/hue. In most cases, brightness of specific color is very limited compared to TV spec brightness. So madVR will add other colors to boost the brightness of required color in proportion that does not change hue/color but will desaturate it (so very bright red will still be red but whitish red ... most TV tone mapping will sacrifice hue for this turning your red to orange). This option tells MadVR if it should instead focus on saturation instead of brightness (thus making you red redder but at expense of brightness ... aka clipping). You have to try each option here to see what you like (remember there is no standard for HDR tone mapping - so pick what you like ... and not what other ppl tell you to pick)

[highlight recovery strength] - essentially when tone mapping you compress ... resulting in loss of highlights ... this option tries to recover some of what is loss ... again - try each option here to see what you like (this one adds quite a bit to rendering time ... so if your GPU struggles ... might need to turn this off)

[measure each frame peak luminance] - this is for information only when you press CTRL+J

[output video in HDR format] - this one is interesting. If you enable it, it will send HDR metadata to display, causing it to tone map received video which is already tone mapped by MadVR (so TV will further compress your video). This one will cause HDR logo to pop up indicating that display is doing tone mapping.

Theoretically, if video levels tone mapped by MadVR are already within range of what TV can display - TV tone mapping algorithm should do nothing ... in practice its often not the case and TV will still try to "improve" picture

The only use scenario I can think for this option is ... you watch non-HDR stuff not at maximum TV brightness ... but want TV to:
a. not tone map by setting MadVR target peak nits within range of what TV can display (you assume here that TV will not touch video that it can display ... which is big assumption)
b. enter HDR mode anyway so it automatically set your TV brightness to max
Logged
HTPC: Win11 Pro, MC: latest 31(64b), NV Driver: v425.31, CPU: i9-12900K, 32GB RAM, GeForce: 2080ti
Screen: LG 2016 E6
NAS: FreeNAS 11.1, SuperMicro SSG-5048R-E1CR36L, E5-1620v4, 64GB ECC RAM, 18xUltrastar He12-SAS3 drives, 2x240GB SSD (OS)

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4226
Re: Beginners guide to MadVR HDR
« Reply #1 on: July 17, 2020, 02:53:56 pm »

Is it based on the version that ships with MC? If so seems a bit pointless given how far along the beta is. Unfortunately no clue when that will ever come out of beta but seems like the guide should be to work out how to use the beta as first step.
Logged

tij

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1563
Re: Beginners guide to MadVR HDR
« Reply #2 on: July 18, 2020, 12:14:39 am »

MadVR settings are based on latest stable that ships with MC.

I deliberately did not include latest beta builds for 3 reasons:
1. the settings options for those keep changing depending on what Madshi want ppl to try
2. JRiver strongly discourage use of beta builds and will not answer any question to troubleshoot it
3. Ppl who do use beta builds likely dont need this guide :)

The main reason i wrote this ... is to explain ppl what HDR is and tone mapping concept

Ppl see HDR logo popping up on TV ... and assume picture its better than what MadVR tone map do ... just wanted to explain its not always the case (personally havent seen any TV do better tone mapping than MadVR ... even non beta one)
Logged
HTPC: Win11 Pro, MC: latest 31(64b), NV Driver: v425.31, CPU: i9-12900K, 32GB RAM, GeForce: 2080ti
Screen: LG 2016 E6
NAS: FreeNAS 11.1, SuperMicro SSG-5048R-E1CR36L, E5-1620v4, 64GB ECC RAM, 18xUltrastar He12-SAS3 drives, 2x240GB SSD (OS)

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72438
  • Where did I put my teeth?
Re: Beginners guide to MadVR HDR
« Reply #3 on: July 18, 2020, 08:10:34 am »

I deliberately did not include latest beta builds for 3 reasons:
1. the settings options for those keep changing depending on what Madshi want ppl to try
2. JRiver strongly discourage use of beta builds and will not answer any question to troubleshoot it
3. Ppl who do use beta builds likely dont need this guide :)
Well said.  And thank you for your guide.
Logged

rec head

  • Citizen of the Universe
  • *****
  • Posts: 1009
Re: Beginners guide to MadVR HDR
« Reply #4 on: July 19, 2020, 11:05:23 am »

Thanks for this.
Logged

flaviowolff

  • Member
  • *
  • Posts: 1
Re: Beginners guide to MadVR HDR
« Reply #5 on: November 06, 2020, 11:33:29 am »


[measure each frame peak luminance] - this is for information only when you press CTRL+J


I believe this is incorrect. The option employs some kind of dynamic tonemapping (per-frame compression)

From Doom9 Forums @asmodian's guide: "measure each frame's peak luminance: [Disabled] Allows madVR to only compress highlights as much as necessary on a per frame basis resulting in more detail in highlights."

I toggled the option on and off (by pressing Apply) and could clearly see the difference on highlights. Also, it works fine with DXAV2, in contrary of that madvr states next to the tickbox.
Logged

Bombadilio

  • Member
  • *
  • Posts: 1
Re: Beginners' Guide to madVR HDR
« Reply #6 on: November 23, 2020, 02:12:18 am »

This solved a lot of my problems. Out of curiousity, I am also using SVP + AVISynth +MadVR -Reclock.

Oddly I can't tell if SVP is activated. Have you guys used SVP as well? Would be great to know if its working or not.
Logged

icstm

  • World Citizen
  • ***
  • Posts: 150
Re: Beginners' Guide to madVR HDR
« Reply #7 on: December 17, 2020, 11:55:39 pm »

Thanks for the guide.
What the minimum specs to get the dynamic tone mapping to work real-time?

If I understand correctly, tone mapping has to use (a lot) more CPU than a normal hardware accelerated video path (h264/5 with d3d11-cb or dxva2 or NVDEC).
Logged

tij

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1563
Re: Beginners' Guide to madVR HDR
« Reply #8 on: December 18, 2020, 09:39:53 pm »

Thanks for the guide.
What the minimum specs to get the dynamic tone mapping to work real-time?

If I understand correctly, tone mapping has to use (a lot) more CPU than a normal hardware accelerated video path (h264/5 with d3d11-cb or dxva2 or NVDEC).
My understanding is tone mapping is GPU shaders. I run 1070 and its doing fine. Higher spec will allow you to select more options.
Logged
HTPC: Win11 Pro, MC: latest 31(64b), NV Driver: v425.31, CPU: i9-12900K, 32GB RAM, GeForce: 2080ti
Screen: LG 2016 E6
NAS: FreeNAS 11.1, SuperMicro SSG-5048R-E1CR36L, E5-1620v4, 64GB ECC RAM, 18xUltrastar He12-SAS3 drives, 2x240GB SSD (OS)

heavydutyrudi

  • Member
  • *
  • Posts: 2
Re: Beginners' Guide to madVR HDR
« Reply #9 on: January 14, 2021, 02:24:42 am »

Thanks for this - I now have a better understanding of what's going on with HDR and have played around with the Nit settings and get good all round performance with everything from old Dr Who vids in 640 x 480 up to Black panther in 3840 x 2016.
Logged

ndgame

  • Recent member
  • *
  • Posts: 49
Re: Beginners' Guide to madVR HDR
« Reply #10 on: September 01, 2022, 01:03:11 pm »

Thanks for this Video. 

I do have 1 question surrounding this.  When Selecting  tone map HDR pixel shaders I notice that my JVC Projector does not switch the mode to HDR.  Is this normal and if so I keep it on the Natural setting should I change the bulb brightness to High?  Right now the picture is really dark.

Thanks,
Aaron
Logged

Denti

  • Citizen of the Universe
  • *****
  • Posts: 593
Re: Beginners' Guide to madVR HDR
« Reply #11 on: January 16, 2023, 05:54:00 pm »

This is a nice guide. I would love to find a more advanced guide for the next steps. Where do I go? The expert guide in the wiki is way out of date.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72438
  • Where did I put my teeth?
Re: Beginners' Guide to madVR HDR
« Reply #12 on: January 17, 2023, 01:05:36 am »

There's a very long thread on the doom9 forum, but you might consider using the JRVR video option.
Logged

Denti

  • Citizen of the Universe
  • *****
  • Posts: 593
Re: Beginners' Guide to madVR HDR
« Reply #13 on: January 17, 2023, 08:05:25 pm »

Is it on par with madVR?
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72438
  • Where did I put my teeth?
Re: Beginners' Guide to madVR HDR
« Reply #14 on: January 17, 2023, 10:52:35 pm »

Yes.  For most people, it's better.  It's easier to use and requires less power.
Logged
Pages: [1]   Go Up