Jump to content


Photo

HDR tone-mapping with mpv


Best Answer Doofus , 19 March 2019 - 09:45 PM

Here's a starter pack for those who haven't done this, before. This assumes that your desktop coloring looks like a standard desktop. This is important!

1. Download the Adobe attachment, and unzip it to; C:\Windows\System32\spool\drivers\color

2. Download the mpv config attachment, and unzip it to; %AppData%\Roaming

 

3. Replace mpv with the March 10 2019 build 64 bit or 32 bit

 

    Just download it and unzip it to; %AppData%\Roaming\Emby-Theater\system\x64\mpv

 

4. Go play a movie :)

Any questions, ask them, here :)

 

(more information and an updated configuration, can be found here)

Go to the full post


  • Please log in to reply
324 replies to this topic

#221 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 12655 posts
  • Local time: 02:41 AM

Posted 11 August 2019 - 08:44 AM

Hi doofus,

It’s good that things are still moving for MPV...

I’m guessing we still can’t use these newer versions with ET until Luke fixes that?


The configuration should work just fine. The test build is not new, it's two years old. It's not usable as a general player. It's only meant to test d3d11 with swapchain 1.6 for HDR. Some major components don't work. Luke is working on window management, it doesn't really have anything to do with mpv, other allowing mpv to use full screen exclusivity.

Luke, to that point, I would strongly suggest you start working in that direction. Several elements are going to require that in the future. I know I've posted about that before, I just think it would be wise start development in that direction. It might also be the ultimate solution to all the UI problems that we are presently having.

#222 kalg OFFLINE  

kalg

    Member

  • Members
  • 19 posts
  • Local time: 11:41 AM

Posted 11 August 2019 - 12:32 PM

Ok you guys, if you really want to experiment, Rossy has a test build for 10 bit with the DXGI swapchain. Oh boy! What a difference. You can get it here

 

https://github.com/m...mment-353968959

 

And I used this config (run this as a portable. It is likely going to be buggy, and it's old)

d3d11-colorspace=hdr
d3d11-format=rgb10_a2
target-trc=pq
target-prim=bt.2020
hwdec=d3d11va
gpu-api=d3d11

THIS IS HDR PASSTHROUGH!

 

 

hi, many thanks for this info, But have question that is the hdr passthrough is not work on my lg oled tv still does hdr to sdr. madvr passthroughs hdr data, any clues why im not geting it to do the same. im using that rossy build you posted

 

many thanks


Edited by kalg, 11 August 2019 - 12:34 PM.


#223 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 12655 posts
  • Local time: 02:41 AM

Posted 11 August 2019 - 12:38 PM

hi, many thanks for this info, But have question that is the hdr passthrough is not work on my lg oled tv still does hdr to sdr. madvr passthroughs hdr data, any clues why im not geting it to do the same. im using that rossy build you posted

many thanks


Windows needs to be in HDR10, it won't switch the display between SDR and HDR like madVR does.

#224 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 12655 posts
  • Local time: 02:41 AM

Posted 11 August 2019 - 12:39 PM

I think jeeb has a later test build. I'm going to grab it and test it in a little while.

#225 kalg OFFLINE  

kalg

    Member

  • Members
  • 19 posts
  • Local time: 11:41 AM

Posted 11 August 2019 - 12:59 PM

many thanks for letting me know , ive been having a right bad time with mpv with there hdr to sdr tried all config my own the ones you have posted  same issues always show , that its too dark or too bright not a one fits all . theres two movies i have aquaman and hacksaw ridge say i watch hacksaw i get up too chapter 11 where they sit in a hole at night cant see nothink all black ish so i increase either reinhard to 5 this is with peak compute yes/no dosnt matter it fixes that issue yay so i watch aquaman get to chapter 6 and the whites are blooming so adjust to stop blooming, then back to dark scenes like in hacksaw become  very dark again grrr so when you mention passthrough was deep joyed .... 

 

edit just tested with windows hdr on and its same so its still doing its own tone mapping and not passing meta data to tv grrr

 

any how many tthanks for the time you have invested 

 

pleasent movie viewing


Edited by kalg, 11 August 2019 - 01:02 PM.


#226 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 12655 posts
  • Local time: 02:41 AM

Posted 11 August 2019 - 01:20 PM

many thanks for letting me know , ive been having a right bad time with mpv with there hdr to sdr tried all config my own the ones you have posted  same issues always show , that its too dark or too bright not a one fits all . theres two movies i have aquaman and hacksaw ridge say i watch hacksaw i get up too chapter 11 where they sit in a hole at night cant see nothink all black ish so i increase either reinhard to 5 this is with peak compute yes/no dosnt matter it fixes that issue yay so i watch aquaman get to chapter 6 and the whites are blooming so adjust to stop blooming, then back to dark scenes like in hacksaw become  very dark again grrr so when you mention passthrough was deep joyed .... 

 

edit just tested with windows hdr on and its same so its still doing its own tone mapping and not passing meta data to tv grrr

 

any how many tthanks for the time you have invested 

 

pleasent movie viewing

 

Are you using zip file I posted? It needs to have the correct config to make it work. I just got jeeb's and I have that one working, too. I'm still running a few tests....

 

And I suspect that you have region dimming enabled on your display. I have disabled it on mine. That is your display dynamically adjusting the contrast. Turn that off.


Edited by Doofus, 11 August 2019 - 01:22 PM.


#227 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 12655 posts
  • Local time: 02:41 AM

Posted 11 August 2019 - 01:53 PM

I have jeeb's test build and that will switch between SDR and HDR. I'm trying to attach it but it keeps erroring out.



#228 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 12655 posts
  • Local time: 02:41 AM

Posted 11 August 2019 - 02:04 PM

Ok, try this. You can run windows in SDR or HDR and it will still work when you make mpv fullscreen. Double clcik of press f

 

https://drive.google...iew?usp=sharing



#229 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 12655 posts
  • Local time: 02:41 AM

Posted 11 August 2019 - 08:19 PM

Comparing my tone mapping config to passthrough, there is very little difference. In some scenes (depending on the source), you notice a difference in peak luminance, but in general, unless I scrutinize the picture, I can't distinguish one from the other. But that build does work, if some of you want to try using it. I might use it and still keep Windows in HDR10, then I can still have HDR passthrough in a window.



#230 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 12655 posts
  • Local time: 02:41 AM

Posted 11 August 2019 - 08:42 PM

And of course you can't use it in Theater as it doesn't provide full screen exclusivity. I forgot about that wrinkle  :wacko:

 

Other than that, it appears to work well.


Edited by Doofus, 11 August 2019 - 08:43 PM.


#231 mrfaulk OFFLINE  

mrfaulk

    Advanced Member

  • Members
  • 219 posts
  • Local time: 11:41 AM

Posted 14 August 2019 - 03:46 PM

great thread and great work! so i've read every page but i'm still a bit fuzzy on what some have settled on (rossy, jeeb, doofus, a combo of all of the above?), so i'm hoping i can get pointed in the right direction...

 

- windows 10/64, integrated graphics

- leaning towards having hdr turned on all of the time

- primary hdr viewing will be 4k hdr rips from my discs

- epson 6050ub 4k hdr projector

- lumagen pro

- vertex

 

i'd like to try to passthrough hdr to the lumagen for tone mapping, or even try setting the lumagen's tone mapping to off and let the pj tone map.... the vertex can force windows to display different bit depths, refresh rates, color format, color space, etc. if needed.

 

so should i start by adding the following profiles?

 

Adobe RGB (1998) D65 WP 2.2 Gamma.icc
sRGB Color Space Profile.icm

 

and from there should i start with @Doofus config file found in post #131

gpu-api=auto
hwdec=d3d11va
opengl-pbo
scale=ewa_lanczossharp
dither-depth=10
icc-profile=C:\Windows\System32\spool\drivers\color\sRGB Color Space Profile.icm
icc-contrast=50000
deband
saturation=0
brightness=0
contrast=0
deinterlace=no

video-sync=display-vdrop
interpolation

hwdec-codecs=all

demuxer-lavf-analyzeduration=3

force-seekable=yes

sub-create-cc-track=yes
sub-pos=90
sub-ass-override=no

audio-stream-silence=yes
audio-device=wasapi/marantz (NVIDIA High Definition Audio)
audio-exclusive=yes
af=lavcac3enc=yes:640:2

log-file="D:\mpv logs\Theater mpv log.txt"

[Interlaced]
profile-desc=cond:p["video-frame-info/interlaced"]
deinterlace=yes

[720p]
profile-desc=cond:p["video-params/w"]==1280
deinterlace=no

[HDR]
profile-desc=cond:p["video-params/primaries"]=="bt.2020"
hdr-compute-peak=no
tone-mapping=reinhard
tone-mapping-param=0.5
tone-mapping-desaturate=3
icc-profile=C:\Windows\System32\spool\drivers\color\Adobe RGB (1998) D65 WP 2.2 Gamma.icc
icc-contrast=1000000
target-peak=300
hwdec=d3d11va
scale=auto
deinterlace=no
deband=no
video-sync=audio
contrast=0
saturation=0
brightness=0

and replace the hdr section with this found in post #300?

[HDR]
profile-desc=cond:p["video-params/primaries"]=="bt.2020"
hdr-compute-peak=no
tone-mapping=reinhard
tone-mapping-param=0.5
tone-mapping-desaturate=3
icc-profile=C:\Windows\System32\spool\drivers\color\Adobe RGB (1998) D65 WP 2.2 Gamma.icc
target-peak=300

thanks!

 

 

 



#232 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 12655 posts
  • Local time: 02:41 AM

Posted 14 August 2019 - 04:59 PM

You aren't going to be able to use Rossy and jeeb's test builds in Theater. The window management doesn't support full screen exclusivity to allow them to pass the metadata to the display. So for now, you'll have to use tone mapping.

Don't use my whole config. It's tailored to my hardware, so you'll have some problems. And there are few things you'll need set in theater to allow some of my config. You'll also need the autoprofiles script. I have that posted in other threads. That's why I said in the first post that you need to have all that already in place. Let me know if you have that already.

#233 mrfaulk OFFLINE  

mrfaulk

    Advanced Member

  • Members
  • 219 posts
  • Local time: 11:41 AM

Posted 15 August 2019 - 01:04 PM

first, thanks very much for your reply! a couple of things:

 

 

You aren't going to be able to use Rossy and jeeb's test builds in Theater. The window management doesn't support full screen exclusivity to allow them to pass the metadata to the display.

 

if they don't work with emby theater, what emby apps do they work with? and i assume they work with standalone mpv or plex/mpv?

 

So for now, you'll have to use tone mapping.

 

i'm fine with giving tone mapping a try.

 

Don't use my whole config. It's tailored to my hardware, so you'll have some problems.

 

gotchya.

 

And there are few things you'll need set in theater to allow some of my config.

 

can you be a bit more specific?

 

You'll also need the autoprofiles script. I have that posted in other threads.

 

ok, i'll find them.

 

That's why I said in the first post that you need to have all that already in place. Let me know if you have that already.

 

assuming you're talking about post #1 in this thread, i've read it several times and i'm still not sure what "already in place" items you're referring to.



#234 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 12655 posts
  • Local time: 02:41 AM

Posted 15 August 2019 - 01:23 PM

In the first post was referring to knowing how to set up and configure all the back end stuff to use auto-profiles and what settings to use in Theater. I didn't want clutter this thread with them. There's already too much info in here.

As for using the test builds, first you'd want to use jeeb's. It's stable. Second, you can still use it as an external player. That may get a little confusing, though. The mpv.conf would be applied to both internal and external players. As live TV will always use the internal player, and depending on how you configure the external player, that will play the rest of the videos. I've asked for an option to allow using an external player only for HDR media, but that hasn't happened. So as long as you know what you're doing, you can make it work, that way.

For the settings in the Theater UI, it really depends on what your goal is. I choose to use the mpv.conf for everything. So I have configured it for that purpose. But if your usage is basic, then you could configure it in accordance with that. But this is now getting away from HDR tone-mapping.

If you want, PM me and I'll get into more detail and get you started.

#235 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 12655 posts
  • Local time: 02:41 AM

Posted 15 August 2019 - 01:46 PM

I suppose the easiest way would be to run Windows in SDR, use jeeb's build as an external player, just use the mpv.conf options specifically and only for HDR with that. That way it will switch in and out HDR when needed, and all other videos will play correctly without any adjustments needed. If there were any HDR only option for external players, this would be so easy and much better to do.

Edited by Doofus, 15 August 2019 - 02:32 PM.


#236 mrfaulk OFFLINE  

mrfaulk

    Advanced Member

  • Members
  • 219 posts
  • Local time: 11:41 AM

Posted 15 August 2019 - 03:13 PM

In the first post was referring to knowing how to set up and configure all the back end stuff to use auto-profiles and what settings to use in Theater. I didn't want clutter this thread with them. There's already too much info in here.

again, i've read the first post and didn't see anything about making sure x was in place, instead i seemed to mostly find info about different conf hdr settings / tests? are you referring to what appears in the green box and not post #1?
 

 

As for using the test builds, first you'd want to use jeeb's. It's stable. Second, you can still use it as an external player.

can i use it with plex (not referring to kodi for plex) or is this not the place to discuss this?

 

 

 

That may get a little confusing, though. The mpv.conf would be applied to both internal and external players. As live TV will always use the internal player, and depending on how you configure the external player, that will play the rest of the videos. I've asked for an option to allow using an external player only for HDR media, but that hasn't happened. So as long as you know what you're doing, you can make it work, that way.

not sure i understand the difference between an internal and external player? i just want to stream my ripped dvd collection using a windows player and front end, i assumed that player (whichever one i decide on) was an internal player? if so, what's an example of an external player? a player used outside of the emby (or other frontend) environment?

 

 

 

For the settings in the Theater UI, it really depends on what your goal is. I choose to use the mpv.conf for everything. So I have configured it for that purpose. But if your usage is basic, then you could configure it in accordance with that. But this is now getting away from HDR tone-mapping.

again, i simply want to use emby/mpv to stream my ripped dvd library, much of which contains 4k hdr titles... i also have no preference in terms of keeping windows in hdr mode all of the time, or setting it to sdr and having mpv or the like handle hdr, whichever works best.


Edited by mrfaulk, 15 August 2019 - 03:14 PM.


#237 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 12655 posts
  • Local time: 02:41 AM

Posted 15 August 2019 - 03:21 PM

Then I would suggest just using jeeb's build externally, with the basic config to allow it to pass the metadata. Download it, unzip it anywhere and point the external player config in Theater, at it. You'll need to make sure that fs is in the mpv.conf. I don't remember if I added that. Once you do that, just use Theater as you would normally do. All videos will be played in that, and when HDR metadata is found, it will switch your display between SDR and HDR. Be sure NOT to configure upscaling. Some of those will interfere with the HDR, and the picture will be distorted.

#238 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 12655 posts
  • Local time: 02:41 AM

Posted 15 August 2019 - 03:57 PM

If you need me to post a complete mpv.conf for jeeb's build as an external player, let me know, and I'll post it later, when I'm at home.

#239 mrfaulk OFFLINE  

mrfaulk

    Advanced Member

  • Members
  • 219 posts
  • Local time: 11:41 AM

Posted 15 August 2019 - 05:58 PM

Then I would suggest just using jeeb's build externally, with the basic config to allow it to pass the metadata. Download it, unzip it anywhere and point the external player config in Theater, at it. You'll need to make sure that fs is in the mpv.conf. I don't remember if I added that. Once you do that, just use Theater as you would normally do. All videos will be played in that, and when HDR metadata is found, it will switch your display between SDR and HDR. Be sure NOT to configure upscaling. Some of those will interfere with the HDR, and the picture will be distorted.

 

first, thanks very much for time and help!

 

as i mentioned, i'm open to either having hdr in windows turned on all of the time or jeeb switch back and forth, altho i seem to remember things tend to run more seamlessly when hdr is always on? if that's the case, can i set windows hdr to on and still have jeeb pass the hdr metadata?

 

i did download the jeeb zip and looked at the conf file, doesn't seem like it would work with my setup:

d3d11-use-pq-swap-chain
target-trc=pq
target-prim=bt.2020
log-file="D:\mpv logs\Rossy mpv log.txt"
hwdec=d3d11va
gpu-api=d3d11

audio-device=wasapi/marantz (NVIDIA High Definition Audio)
audio-spdif=ac3,eac3,dts,dts-hd,truehd
audio-channels=7.1
audio-exclusive=yes
af=lavcac3enc=yes:640:2

also, if i do go the jeeb route, does that eliminate the need to load color profiles? and, also, if i did go with jeeb would i need to use the mpv-1.dll that came in its package?

 

 

thanks again.



#240 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 12655 posts
  • Local time: 02:41 AM

Posted 15 August 2019 - 06:03 PM

When I get home, I'll straighten all of that out and better answer your questions :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users