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
347 replies to this topic

#301 mrfaulk OFFLINE  

mrfaulk

    Advanced Member

  • Members
  • 230 posts
  • Local time: 04:44 AM

Posted 22 October 2019 - 11:48 PM

If you use it exactly as I have it, yes. But if you run Windows in HDR10, you should be able to use that icc for everything. 

 

Do you guys want to see how I have my entire config?

 

 

yes please.

 

5dafcd6385afe_03.jpg



#302 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 13395 posts
  • Local time: 08:44 PM

Posted 22 October 2019 - 11:59 PM

Here ya go

gpu-api=d3d11
hwdec=d3d11va
opengl-pbo
scale=ewa_lanczossharp
dither-depth=auto
icc-profile=C:\Windows\System32\spool\drivers\color\My profile 7.icm
icc-contrast=30000
deband
deband-iterations=1
deband-grain=0
vf=d3d11vpp=deint=no

hwdec-codecs=all

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"]
vf=d3d11vpp=deint=yes:interlaced-only=yes:mode=adaptive

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

[HDR]
profile-desc=cond:p["video-params/primaries"]=="bt.2020"
hdr-compute-peak=no
tone-mapping=mobius
tone-mapping-param=0.2
tone-mapping-desaturate=4
icc-profile=C:\Windows\System32\spool\drivers\color\My profile 7.icm
icc-contrast=inf
target-peak=300
scale=bilinear
vf=d3d11vpp=deint=no





#303 mrfaulk OFFLINE  

mrfaulk

    Advanced Member

  • Members
  • 230 posts
  • Local time: 04:44 AM

Posted 23 October 2019 - 12:19 AM

If you use it exactly as I have it, yes. But if you run Windows in HDR10, you should be able to use that icc for everything.

 

not sure i fully understand this? so if hdr is enabled then there's no need to include include a path ti the icc file, instead just use it as the default profile in color management settings?



#304 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 13395 posts
  • Local time: 08:44 PM

Posted 23 October 2019 - 12:32 AM

not sure i fully understand this? so if hdr is enabled then there's no need to include include a path ti the icc file, instead just use it as the default profile in color management settings?

 

No, using an icc is always the best choice. What I was referring to is using an appropriate icc. If you only use an icc for SDR, then using the Windows sRGB icc will be ok, because only a small color gamut is required. But HDR has a much wider color gamut. So being able to map to the correct shade of color that is outside of sRGB, you'll need an icc that has a color gamut map that includes those shades. The icc that I attached, does. But if you use that icc with Windows in SDR, the color mapping won't match, and won't look right. 

 

So if you run Windows in SDR, use the sRGB icc.

 

If you run Windows in HDR, try the icc that I made.


Edited by Doofus, 23 October 2019 - 12:44 AM.


#305 mrfaulk OFFLINE  

mrfaulk

    Advanced Member

  • Members
  • 230 posts
  • Local time: 04:44 AM

Posted 23 October 2019 - 01:48 AM

No, using an icc is always the best choice. What I was referring to is using an appropriate icc. If you only use an icc for SDR, then using the Windows sRGB icc will be ok, because only a small color gamut is required. But HDR has a much wider color gamut. So being able to map to the correct shade of color that is outside of sRGB, you'll need an icc that has a color gamut map that includes those shades. The icc that I attached, does. But if you use that icc with Windows in SDR, the color mapping won't match, and won't look right. 

 

So if you run Windows in SDR, use the sRGB icc.

 

If you run Windows in HDR, try the icc that I made.

 

yes, understood, but what i'm asking is if you plan to have hdr enabled all of the time (which i plan to do), then would it be better to just use your icc as the default color profile in color management as opposed to adding a path line to it in the config file?

 

btw, stumbled across a couple of anime sites when i googled mpv hdr and it seems that those communities are chasing the same thing, in fact it seems that someone created an mpv fork called mpv.net and the community has posted a bunch of config edits, have you seen that?

 

for example:

 

http://boards.4chann...st-media-player

https://github.com/stax76/mpv.net

 

also, i noticed that you've posted some of your work at github, looks like hdr passthrough might be coming soon? btw, in one of your posts you mentioned:

 

"All versions with @haasn's redeveloped tone mapping, Windows 10"

 

are you referring to a newer version of mpv?

 

thanks!



#306 mrfaulk OFFLINE  

mrfaulk

    Advanced Member

  • Members
  • 230 posts
  • Local time: 04:44 AM

Posted 23 October 2019 - 02:28 AM

 

Here ya go

gpu-api=d3d11
hwdec=d3d11va
opengl-pbo
scale=ewa_lanczossharp
dither-depth=auto
icc-profile=C:\Windows\System32\spool\drivers\color\My profile 7.icm
icc-contrast=30000
deband
deband-iterations=1
deband-grain=0
vf=d3d11vpp=deint=no

hwdec-codecs=all

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"]
vf=d3d11vpp=deint=yes:interlaced-only=yes:mode=adaptive

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

[HDR]
profile-desc=cond:p["video-params/primaries"]=="bt.2020"
hdr-compute-peak=no
tone-mapping=mobius
tone-mapping-param=0.2
tone-mapping-desaturate=4
icc-profile=C:\Windows\System32\spool\drivers\color\My profile 7.icm
icc-contrast=inf
target-peak=300
scale=bilinear
vf=d3d11vpp=deint=no



 

bam! thanks very much!

 

EDIT - btw, do you always have hdr enabled in windows?

 

EDIT 2 - i noticed that the hdr section in your full config file is different than the "latest" hdr config edit you posted earlier, which do you recommend?

 

 

latest hdr:

 

[HDR]
profile-desc=cond:p["video-params/primaries"]=="bt.2020"
hdr-compute-peak=no
tone-mapping=mobius
tone
-mapping-param=0.2
tone-mapping-desaturate=4
icc-profile=C:\Windows\System32\spool\drivers\color\My profile 7.icm
icc-contrast=inf
target
-peak=300
opengl-pbo
dither
-depth=auto

 

full config file hdr:

 

[HDR]
profile-desc=cond:p["video-params/primaries"]=="bt.2020"
hdr-compute-peak=no
tone-mapping=mobius
tone
-mapping-param=0.2
tone-mapping-desaturate=4
icc-profile=C:\Windows\System32\spool\drivers\color\My profile 7.icm
icc-contrast=inf
target
-peak=300
scale=bilinear
vf
=d3d11vpp=deint=no

 

 

 

 

 


Edited by mrfaulk, 23 October 2019 - 02:38 AM.


#307 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 13395 posts
  • Local time: 08:44 PM

Posted 23 October 2019 - 09:52 AM

I see your confusion. Applying the icc to Windows color management, won't help mpv. For mpv to use the icc, it needs to be applied directly in mpv.

That last line in the HDR profile is to make sure that the interlaced profile is disabled for that content.

Yes, HDR is enabled all the time.

As for haasn's redeveloped tone mapping, that is all the builds since he first made them. So since January.

Edited by Doofus, 23 October 2019 - 02:51 PM.


#308 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 13395 posts
  • Local time: 08:44 PM

Posted 23 October 2019 - 09:52 AM

Double post

Edited by Doofus, 23 October 2019 - 09:53 AM.


#309 mrfaulk OFFLINE  

mrfaulk

    Advanced Member

  • Members
  • 230 posts
  • Local time: 04:44 AM

Posted 23 October 2019 - 03:33 PM

1. I see your confusion. Applying the icc to Windows color management, won't help mpv. For mpv to use the icc, it needs to be applied directly in mpv.

2. That last line in the HDR profile is to make sure that the interlaced profile is disabled for that content.

3. Yes, HDR is enabled all the time.

4. As for haasn's redeveloped tone mapping, that is all the builds since he first made them. So since January.

 

1. interesting.

2. the difference between the two is more than the last line, guess i just need to play with both.

3. thanks.

4. go it.

 

notes - unfortunately your icc and mpv.conf (hdr code) didn't work out in my setup.. hdr content has a strong yellow push and the brightness doesn't look right, not nearly enough contrast, the entire image just looks overly bright in an odd way... also, if i add the rest of the code (non hdr section) movies won't play, so there's something in there that's probably specific to your setup that i need to edit or remove (i'm guessing audio), but really didn't have much time to spend on it, hopefully will get some time tonight... all of that said, i'm trying this out with plex, which is known to handle the mpv.conf file differently than standalone mpv installs or emby/mpv, not all of the mpv.conf commands play well with plex, plex either overrides some of the mpv.conf commands or they cause conflicts with plex's media player conf file commands.... unfortunately it doesn't seem that many plex users are experimenting with the mpv.conf file, very little info about at their forum as far as i can tell, albeit one of their developers noted that there's no documentation that shows which mpv.conf file commands conflict with or don't work with plex, that it's a line by line trial error proposition.



#310 PrincessClevage OFFLINE  

PrincessClevage

    Advanced Member

  • Members
  • 1072 posts
  • Local time: 02:44 PM

Posted 23 October 2019 - 03:38 PM

Bring on the HDR passthrough builds then the real testing will start
  • Doofus likes this

#311 lorac OFFLINE  

lorac

    Advanced Member

  • Members
  • 458 posts
  • Local time: 08:44 PM
  • LocationVancouver, Canada

Posted 23 October 2019 - 03:56 PM

For audio you need to run MPV with the switch --audio-device=help to find out what yours is or disable the reference to the audio device in the conf file.

Sent from my ONEPLUS A6003 using Tapatalk

#312 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 13395 posts
  • Local time: 08:44 PM

Posted 23 October 2019 - 04:13 PM

1. interesting.
2. the difference between the two is more than the last line, guess i just need to play with both.
3. thanks.
4. go it.

notes - unfortunately your icc and mpv.conf (hdr code) didn't work out in my setup.. hdr content has a strong yellow push and the brightness doesn't look right, not nearly enough contrast, the entire image just looks overly bright in an odd way... also, if i add the rest of the code (non hdr section) movies won't play, so there's something in there that's probably specific to your setup that i need to edit or remove (i'm guessing audio), but really didn't have much time to spend on it, hopefully will get some time tonight... all of that said, i'm trying this out with plex, which is known to handle the mpv.conf file differently than standalone mpv installs or emby/mpv, not all of the mpv.conf commands play well with plex, plex either overrides some of the mpv.conf commands or they cause conflicts with plex's media player conf file commands.... unfortunately it doesn't seem that many plex users are experimenting with the mpv.conf file, very little info about at their forum as far as i can tell, albeit one of their developers noted that there's no documentation that shows which mpv.conf file commands conflict with or don't work with plex, that it's a line by line trial error proposition.


You're talking about the scale line. That's to counteract the scale option at the top.

If using that icc gives you that bad of a picture, that means your display either isn't in wide gamut or isn't calibrated correctly. The brightness will depend on the calibration, but can be adjusted for in the conf.

You weren't meant to copy my exact config. It was meant to be a guide. If you want me to re-write your conf, post it for me.

#313 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 13395 posts
  • Local time: 08:44 PM

Posted 23 October 2019 - 05:14 PM

Bring on the HDR passthrough builds then the real testing will start


Rossy's PR is already merged, so it should be partly testable in the next git build. Hopefully jeeb's will be merged before that happens.
  • rikiwi likes this

#314 mrfaulk OFFLINE  

mrfaulk

    Advanced Member

  • Members
  • 230 posts
  • Local time: 04:44 AM

Posted 23 October 2019 - 10:06 PM

1. You're talking about the scale line. That's to counteract the scale option at the top.

2. If using that icc gives you that bad of a picture, that means your display either isn't in wide gamut or isn't calibrated correctly. The brightness will depend on the calibration, but can be adjusted for in the conf.

3. You weren't meant to copy my exact config. It was meant to be a guide. If you want me to re-write your conf, post it for me.

 

1. actually two lines:

 

opengl-pbo
dither
-depth=auto

 

vs

 

scale=bilinear
vf
=d3d11vpp=deint=no

 

2. i have my pc connected to 3 displays (pc 4k hdr monitor, 4k hdr tv and 4k hdr projector) and the icc file shows the yellow push and brightness on all 3, when not using the icc file colors and brightness are accurate... as i mentioned earlier, a plex developer said that plex doesn't play well with all of the mpv.conf commands, maybe this is one of them? whatever the case, will play with it some more, and try other color profiles.

 

3. yes, i gathered, intend to play with the other settings tonight, at the moment my mpv.conf just contains the hdr code your provided as follows:

 

[HDR]
profile-desc=cond:p["video-params/primaries"]=="bt.2020"
hdr-compute-peak=no
tone-mapping=mobius
tone-mapping-param=0.2
tone-mapping-desaturate=4
icc-profile=C:\Windows\System32\spool\drivers\color\mpv_profile.icm
icc-contrast=inf
target-peak=300
opengl-pbo
dither-depth=auto

 

speaking of which, should i keep this code in the file:

 

input-ipc-server=mpvpipe
hwdec-codecs=all
hr-seek-framedrop=no

 

btw, thanks a ton for your work on this stuff, mpv / hdr support is a huge deal imo!



#315 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 13395 posts
  • Local time: 08:44 PM

Posted 23 October 2019 - 11:19 PM

mrfaulk what GPU are you using, and how do you have the chroma sub-sampling and bit depth configured?


Edited by Doofus, 23 October 2019 - 11:20 PM.


#316 kalg OFFLINE  

kalg

    Member

  • Members
  • 19 posts
  • Local time: 05:44 AM

Posted 24 October 2019 - 03:15 AM

regarding plex use of mpvconf file iv'e found that only these dont work becuase seems plex use the first ever version that mpv used with hdr tone mapping

 

1.target-peak dont work always at 100 hence over bright (i used reinhard=0.10 with contrast=-25) to sort this (but still not good)

 

2.hwdec not available in plex build of mpv

 

3.icc-profile either not working

 

4.profile scripts not available 

 

5.hdr-compute-peak not working

 

the only way to get rid of over brightness with plex and mpv in general for me, is i have to have contrast=-25 in plex but buggers sdr content (as mentioned above BUT it makes dark scenes, example hacksaw ridge chapter 11 in the dug hole  look black cant see nothing in a blacked out bat cave my tv it pro setup thats then only thing gives me grrr only happend with mpv any version (two movies scenes that mpv fail is aquaman chapter 6 and  hacksaw. they work brill with passthrough and madvr tone mapping.

 

can get away with it more so with emby using the march build of mpv but im slowly thinking that mpv needs lot more work to make the hdr picture have more depth somthing that a good hdr tone mapping does on a really decent tv or madvr

 

kev


Edited by kalg, 24 October 2019 - 04:06 AM.


#317 mrfaulk OFFLINE  

mrfaulk

    Advanced Member

  • Members
  • 230 posts
  • Local time: 04:44 AM

Posted 24 October 2019 - 09:37 AM



mrfaulk what GPU are you using, and how do you have the chroma sub-sampling and bit depth configured?

 

as it turns out i was seeing a known prob with plex/hdr/mpv, a green/yellow hue with all hdr files, someone discovered that by enabling native opengl in settings eliminated the issue, example of what i was experiencing, thought it was your icc but it was the same with or without your icc:

 

01.jpg

 

regarding your icc, i think @kalg is right about icc references in the mpv.conf not working with plex, it didn't seem to make a bit of difference for me, haven't really tried the other mpv.conf setting you're using but i'm not holding  out much hope...

 

altho not the best scene, here's a cap with your icc:

 

plex-icc.jpg

 

here it is without your icc:

 

plex-no-icc.jpg

 

and here it is using the windows movie and tv player - altho you probably can't tell from the cap, the image quality using the windows player is far and above superior to the plex/mpv image, it's really not even close:

 

wmp.jpg

 

 

 

with icc / mpv:

 

z-plex-icc.jpg

 

 

without icc:

 

z-plex-no-icc.jpg

 

using windows player:

 

z-wmp.jpg



#318 mrfaulk OFFLINE  

mrfaulk

    Advanced Member

  • Members
  • 230 posts
  • Local time: 04:44 AM

Posted 24 October 2019 - 09:48 AM

regarding plex use of mpvconf file iv'e found that only these dont work becuase seems plex use the first ever version that mpv used with hdr tone mapping

 

1.target-peak dont work always at 100 hence over bright (i used reinhard=0.10 with contrast=-25) to sort this (but still not good)

 

2.hwdec not available in plex build of mpv

 

3.icc-profile either not working

 

4.profile scripts not available 

 

5.hdr-compute-peak not working

 

the only way to get rid of over brightness with plex and mpv in general for me, is i have to have contrast=-25 in plex but buggers sdr content (as mentioned above BUT it makes dark scenes, example hacksaw ridge chapter 11 in the dug hole  look black cant see nothing in a blacked out bat cave my tv it pro setup thats then only thing gives me grrr only happend with mpv any version (two movies scenes that mpv fail is aquaman chapter 6 and  hacksaw. they work brill with passthrough and madvr tone mapping.

 

can get away with it more so with emby using the march build of mpv but im slowly thinking that mpv needs lot more work to make the hdr picture have more depth somthing that a good hdr tone mapping does on a really decent tv or madvr

 

kev

 

 

good stuff kev, thanks for the post! unfortunately i'm finding the same thing, no difference with the few mpv.conf commands i've tried, including @Doofus's hdr code and icc reference / file.... i asked at plex and they flatly said there is no reference info that shows what works and what doesn't, that it would be all trial and error for anyone interested in experimenting with the mpv.conf file...



#319 mrfaulk OFFLINE  

mrfaulk

    Advanced Member

  • Members
  • 230 posts
  • Local time: 04:44 AM

Posted 24 October 2019 - 09:52 AM

@Doofus, what are your windows display settings with hdr enabled? i can only get 8-bit dither rgb when i set my display to 3840x2160 60hz altho my radiance pro shows the input signal as 3840x2160 60 hz, 444-hdr2020... thanks!



#320 Doofus OFFLINE  

Doofus

    Advanced Member

  • Members
  • 13395 posts
  • Local time: 08:44 PM

Posted 24 October 2019 - 10:30 AM

I'm not even going to respond to anything Plex related.

Use a current version of mpv to test with.
  • PrincessClevage likes this




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users