-
Notifications
You must be signed in to change notification settings - Fork 29
HDR color mapping is way off compared to QuickTime #8
Comments
This is a dark scene but I chose it intentionally because it shows the color difference as well as missing a lot of subtleties in the black part. |
I can't test it without the video source. Please try this older version to see if it works better: https://github.com/iina-plus/iina/releases/tag/v1.2.0-13 also |
@CarterLi is there a way I can contact you in private? I can send you the video source that way I tried this with several versions of IINA already |
No. Cut it into 3 secs and upload it somewhere |
Possibly related: Trying to play the HDR test pattern from https://www.youtube.com/watch?v=NlAsAuBtmps Attaching it here reencoded as HEVC so it can also be played in Quicktime: https://user-images.githubusercontent.com/662304/146276378-e7a3777a-4edd-4261-b8b8-04717c202c43.mov The video shows rectangles of different sizes and cycles though multiple brightness levels. Both Youtube and Quicktime correctly display all the brightness level changes. IINA however displays most brightness levels at 100% brightness. The description text is also brighter in IINA. ffmpeg log with video details
|
This video source uses Display-P3 primaries. Display-P3 was disabled in change 2d48204, and is restored now. Please test my latest binary. |
Tested with v1.2.0-17. The inspector now has the correct colorspace (DisplayP3_PQ, vs TUR_2100_PQ on the previous -15 build) but the behavior did not change: it still goes to full brightness after a single level change. I found the video from OP and tested on both builds. It displays incorrectly on both the -17 and -15 builds, but works fine on QuickTime. I cut a 1sec portion corresponding to the screenshot without reencoding: https://user-images.githubusercontent.com/662304/147021128-47b16b6b-01f3-43c8-a621-f91c6502c099.mov |
This video uses max luminance of 4000 nits, which is much higher than the luminance that Apple XDR Display supports ( 1600 nits ). In this case, tone mapping algorithm must be enabled. The best option is the native edrMetadata. However it is supported by Metal layer only while IINA still uses OGL layer so we can't use it. The second option is using MPV for software conversion. --tone-mapping and --target-peak must be set in IINA advance config. We can't enable them automatically at runtime before we can detect the max luminance supported by user's display dynamically somehow. They will break SDR sources, use it at your own risk. |
It seems that disabling advanced settings with the toggle don't have any effect. If apply target-peak=1600 display will be way dim in SDR content. Only removing mpv option will revert to default. |
Seems a bug of IINA. I will have a look of it |
I still feel the colors mapping are off for some reason as well, with this sample the colors are clearly off compared to any other HDR player (Infuse, Quicktime, iOS video players, HDR TV). I know I've brought this up before but still not sure if the color spaces are being interpreted correctly or if there's some other issue. IINA displays the green as much less saturated than it should be compared to Quicktime/Infuse. (This issue might be isolated to certain displays though? I see no difference on an external display yet on my Macbook [14in M1 Pro miniLED] display it looks incorrect). |
yeah fwiw I also have a 14" M1 Pro and I still see the same issue Last time I checked, Infuse was also inferior to QuickTime but they may have fixed that |
You may contribute IINA without touching IINA's code. Since IINA uses MPV, IINA passes HDR related flags directly to MPV. You may compile MPV yourself with the EDR/HDR patch applied. Then use whatever flags / switches / options to make MPV work as you expect. Comment these flags / switches / options here. The flags that IINA is using currently and you may start with ( for |
It matches if I set the target and output as BT2020 for iina (haven’t tested with mpv, but should be the same. Not sure if that’s correct behavior as we’ve discussed earlier for mastering display primaries). Though all the other players I’ve tested seem to ignore the mastering display primaries it seems? They’re all displaying it in BT2020 since the colors seem to match. Will test it on my 14” miniLED internal monitor as well later tonight. Only have access to an older MacBook atm. |
Quick update, tested it and behavior matches (looks incorrect in IINA). Also tested the file with madVR on windows, and it matches the behavior of displaying it in BT2020 and not P3 (which matches the behavior of Quicktime as well). |
HDR is being discussed in the IINA Telegram group. I've been suggesting people provide feedback here. The latest HDR comment from "Tim" is:
|
I'm aware of it. However MPV doesn't support libplacebo core on mac currently: haasn/libplacebo#111 (comment) |
Now we will always use bt.2020 as suggested by @ValZapod |
Samples here are still shown in quite a bad manner. (Sorry to bring this sample up again) |
I don't know how to fix that. Sorry. |
|
Apologies for the delay in getting these samples to you (photos taken with external camera). Here is an example of how QT X renders a particular scene in question: The sample encoded file is here: For the most part, scenes are generally rendered roughly within 1-2% subjectively of each other when comparing on a MBP 16" M1 Max in HDR or XDR Display modes. IMHO, that is more than acceptable given all of the other benefits offered by IINA. But this particular scene is far apart and quite distracting. |
https://andytather.net/Panda/Files/Video/HDR/Dolby%20Vision/LG_2_DEMO_4K_L_H_03_Daylight.mkv does not trigger as EDR anymore and playback completely breaks if you just go back to a point while its playing. |
Got 403 forbidden |
It's not bt.2020 so no. I tested libplacebo and HDR wasn't enabled too. |
IINA does uses bt.2020 for this content |
I mean IINA passes |
IINA will set it to bt.2020/pq ( actually itur_2100_PQ ) https://github.com/iina-plus/iina/blob/develop/iina/VideoView.swift#L336 |
HDR brightness and color are way off |
I really, badly want this to work but the HDR mapping is just... not great. Video is way too over-contrasty to the point of unwatchable. Attached is an example, the first is IINA, the second is QuickTime:
The text was updated successfully, but these errors were encountered: