Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oversaturated dark areas playing HDR 10 bit #2233

Open
sfDuhNinja opened this issue Jan 18, 2019 · 28 comments
Open

oversaturated dark areas playing HDR 10 bit #2233

sfDuhNinja opened this issue Jan 18, 2019 · 28 comments

Comments

@sfDuhNinja
Copy link
Contributor

System and IINA version:

  • macOS 10.14.2 (18C54)
  • IINA 1.0.1 Build 103

Expected behavior:
The dark areas should have details.
Actual behavior:
The dark areas does not retain any details. In the latest vlc the picture is pleasant to look at. Also, the reds seems to be oversaturated as well. All this while watching it on a MBP 13 2018.

please look at the beard and hair

IINA
iina

VLC
vlc

MediaInfo

Video
ID : 1
Format : HEVC
Format/Info : High Efficiency Video Coding
Commercial name : HDR10
Format profile : Main 10@L5.1@High
Codec ID : V_MPEGH/ISO/HEVC
Duration : 1 h 9 min
Width : 3 840 pixels
Height : 2 160 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 23.976 (24000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0 (Type 2)
Bit depth : 10 bits
Writing library : x265 2.9+8-27d8424c799d:[Windows][MSVC 1900][64 bit] 10bit
Encoding settings : cpuid=1176575 / frame-threads=6 / numa-pools=36 / wpp / no-pmode / no-pme / no-psnr / no-ssim / log-level=2 / input-csp=1 / input-res=3840x2160 / interlace=0 / total-frames=100040 / level-idc=51 / high-tier=1 / uhd-bd=0 / ref=4 / no-allow-non-conformance / repeat-headers / annexb / aud / hrd / info / hash=0 / no-temporal-layers / no-open-gop / min-keyint=24 / keyint=240 / gop-lookahead=0 / bframes=4 / b-adapt=2 / b-pyramid / bframe-bias=0 / rc-lookahead=25 / lookahead-slices=4 / scenecut=40 / radl=0 / no-intra-refresh / ctu=64 / min-cu-size=8 / rect / no-amp / max-tu-size=32 / tu-inter-depth=1 / tu-intra-depth=1 / limit-tu=0 / rdoq-level=2 / dynamic-rd=0.00 / no-ssim-rd / signhide / no-tskip / nr-intra=0 / nr-inter=0 / no-constrained-intra / no-strong-intra-smoothing / max-merge=3 / limit-refs=3 / limit-modes / me=3 / subme=3 / merange=57 / temporal-mvp / weightp / no-weightb / no-analyze-src-pics / deblock=-3:-3 / no-sao / no-sao-non-deblock / rd=4 / no-early-skip / rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / no-b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=2.00 / psy-rdoq=1.00 / no-rd-refine / no-lossless / cbqpoffs=0 / crqpoffs=0 / rc=crf / crf=17.0 / qcomp=0.60 / qpstep=4 / stats-write=0 / stats-read=0 / vbv-maxrate=160000 / vbv-bufsize=160000 / vbv-init=0.9 / crf-max=0.0 / crf-min=0.0 / ipratio=1.40 / pbratio=1.30 / aq-mode=1 / aq-strength=1.00 / cutree / zone-count=0 / no-strict-cbr / qg-size=32 / no-rc-grain / qpmax=69 / qpmin=0 / no-const-vbv / sar=1 / overscan=0 / videoformat=5 / range=0 / colorprim=9 / transfer=16 / colormatrix=9 / chromaloc=1 / chromaloc-top=2 / chromaloc-bottom=2 / display-window=0 / master-display=G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(40000000,50) / max-cll=735,91 / min-luma=0 / max-luma=1023 / log2-max-poc-lsb=8 / vui-timing-info / vui-hrd-info / slices=1 / no-opt-qp-pps / no-opt-ref-list-length-pps / no-multi-pass-opt-rps / scenecut-bias=0.05 / no-opt-cu-delta-qp / no-aq-motion / hdr / hdr-opt / no-dhdr10-opt / no-idr-recovery-sei / analysis-reuse-level=5 / scale-factor=0 / refine-intra=0 / refine-inter=0 / refine-mv=0 / no-limit-sao / ctu-info=0 / no-lowpass-dct / refine-mv-type=0 / copy-pic=1 / max-ausize-factor=1.0 / no-dynamic-refine / no-single-sei
Default : Yes
Forced : No
Color range : Limited
Color primaries : BT.2020
Transfer characteristics : PQ
Matrix coefficients : BT.2020 non-constant
Mastering display color primaries : Display P3
Mastering display luminance : min: 0.0050 cd/m2, max: 4000 cd/m2
Maximum Content Light Level : 735 cd/m2
Maximum Frame-Average Light Level : 91 cd/m2
Statistics Tags Issue : no_variable_data 1970-01-01 00:00:00 / no_variable_data 2010-02-22 21:41:29
FromStats_BitRate : 24343148
FromStats_Duration : 01:09:32.502000000
FromStats_FrameCount : 100040
FromStats_StreamSize : 12696479367

How often does this happen?
With any HDR 10 bit blu ray video I tried.

@LeoNatan
Copy link
Contributor

LeoNatan commented Jan 20, 2019

I see this too, and it wasn't like this before. Seems like a regression in 1.0.1, or maybe some version before it.

@LeoNatan
Copy link
Contributor

LeoNatan commented Jan 20, 2019

0.0.15
screen shot 2019-01-20 at 05 04 37

Latest and 1.0
screen shot 2019-01-20 at 05 04 59

Clearly a regression.

@inflation
Copy link
Contributor

Since previous versions didn't do color conversion correctly I don't know the "correct" color. Which color space are you using on the monitor?

@LeoNatan
Copy link
Contributor

mpv is tonemaps the same video just fine.

@inflation
Copy link
Contributor

@LeoNatan Do you have icc-profile-auto in mpv's config? That would enable the correct color conversion.

@LeoNatan
Copy link
Contributor

I am using the default Apple color profile for the MBP.

Tone mapping is a separate issue from color space. Perhaps when you added support for that, you broke tone mapping?

@LeoNatan
Copy link
Contributor

Adding that brings this:

screen shot 2019-01-20 at 05 20 35

@LeoNatan
Copy link
Contributor

Seems like color management is thoroughly broken.

@inflation
Copy link
Contributor

Tone mapping is a separate issue from color space. Perhaps when you added support for that, you broke tone mapping?

Good point. There is an open issue in mpv about that mpv-player/mpv#6405.

@LeoNatan
Copy link
Contributor

It is still much better than default IINA result.

@LeoNatan
Copy link
Contributor

Is there any way to opt out of the color management changes? This pretty much makes IINA useless for HDR content.

@inflation
Copy link
Contributor

inflation commented Jan 20, 2019

I see identical results on my SRGB monitor between mpv and IINA.

You can set icc-profile in Advanced settings to an invalid file. That could potentially convert anything to rec709. But after your comment, I think maybe it's an issue with tone mapping.

@LeoNatan
Copy link
Contributor

Yes, but what broke tone mapping?

BTW, I am testing this on a 2018 MBP, which has a wider color gamut than sRGB. Still no reason to break tone mapping.

@LeoNatan
Copy link
Contributor

Setting icc-profile to "zzadasdad" doesn't help.

@LeoNatan
Copy link
Contributor

#1994

People have reported this in the past. Why was that issue closed?

@inflation
Copy link
Contributor

Yeah, it's an mpv change between the two version. You can try set hdr-compute-peak to no.

@LeoNatan
Copy link
Contributor

Ha, that seems to help! So mpv changed that default value to YES?

I will read through that "subpar tone mapping" issue tomorrow to see if there is anything interesting there.

Thanks for the quick help. Consider changing that to "NO" in IINA as default.

@inflation
Copy link
Contributor

Another thing you need to tweek if you set hdr-compute-peak to no is the algorithm, i.e., tone-mapping.

reinhard preserves overall brightness in trade of details and color correctness:
image

hable (default) gives better details in dark and light area but will darken/desaturate everything (so works fine if you compute the brightness):
image

@LeoNatan
Copy link
Contributor

Thanks

Still, pretty bad on IINA:
screen shot 2019-01-20 at 06 19 49

Notice the blockiness in the clouds.

Compare to VLC:
screen shot 2019-01-20 at 06 20 07

@inflation
Copy link
Contributor

Yeah, that what I mean by "trading off". So before mpv merges the PR, the best you can do is playing around with those parameters.

@LeoNatan
Copy link
Contributor

I'm not sure the two are related. This banding seems like an issue of color management.

@adamwinn
Copy link

adamwinn commented Jul 9, 2019

I'm seeing this too. Movist Pro looks way better

@IshanArya
Copy link

IshanArya commented Jul 22, 2019

Having same problem. Dark scenes have detail completely removed.

Screen Shot 2019-07-21 at 9 44 46 PM

(You may have to turn the brightness on your computer to full to see the picture).

@ajmalabu
Copy link

ajmalabu commented Nov 20, 2019

Hey guys! I recently downloaded an HDR sample test video (link: uhdsample.com)

I played it on both IINA and QuickTime, and the results are as follows (IINA on top and QT on bottom):

Screen Shot 2019-11-20 at 5 17 59 PM

Just curious, why exactly is this happening? Is it some form of restriction applied by Apple that prevents third party players from achieving the same level of HDR tone mapping?

P.S. My device is a MacBook Pro 15 2018 running macOS 10.15.1 (Catalina)

@qinyuhang
Copy link
Contributor

I have the same experience.
Here is a compare between Moviest Pro and IINA
Left is Moviest, the right image is from IINA
企业微信截图_a1b8370e-6471-490f-8986-1ea525dcc90b

@mtpython
Copy link

Still same issue/question as @ajmalabu had, the mpv seems to be slightly brighter, but miles away from QuickTime. VLC has the darkest picture overall.

@95tuanle
Copy link

I'm also having the same problem with latest version of IINA

@Sam0230
Copy link

Sam0230 commented Aug 26, 2021

I found a solution to these two problems (oversaturated dark areas & HDR videos too dark / washed out).

Oversaturated dark areas

This is caused by incorrect ICC profile set by IINA automatically.
See commit b236b00, a part of PR #2006 which didn't fix the issue #888 (Auto-detection of color profile).
Adding a return statement at the beginning of setICCProfile() to disable automatically setting ICC profile will solve the problem.
(At

func setICCProfile(_ displayId: UInt32) {
)

HDR videos too dark / washed out

Go to Preferences > Advanced and add the following options.

tone-mapping=clip
tone-mapping-param=2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants