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

Basic HDR support #3539

Closed
wants to merge 0 commits into from
Closed

Basic HDR support #3539

wants to merge 0 commits into from

Conversation

CarterLi
Copy link
Contributor

@CarterLi CarterLi commented Nov 16, 2021


Description:

This was based on the work of @anastasiuspernat. Although his implementation was not correct, it was a very good start.

Changes:

  1. Currected HDR format detection
  2. Removed lots of uncecessory code
  3. Fixed some memory leaks
  4. Fixed some coding style

The original code of @anastasiuspernat can be found at: https://github.com/anastasiuspernat/iina

Since this repo seems dead already, If anyone want to test this feature, I have released a binary here: https://github.com/CarterLi/iina/releases ( arm64 only )

@CarterLi
Copy link
Contributor Author

Comparation, upper IINA with HDR support, lower mpv

WechatIMG8

while screenshot won't show any difference (only IINA is much lighter)
截屏2021-11-16 19 09 32

Video source (downloaded with youtube-dl): https://www.youtube.com/watch?v=WO2b03Zdu4Q

@spittix
Copy link

spittix commented Nov 16, 2021

So I tried a first test and I'm not sure, if it's working. Upper is IINA 1.2.0, lower is your build, which seems display the sun a small step brighter... Is there any other check possible?
Bildschirmfoto 2021-11-16 um 14 42 09

@spittix
Copy link

spittix commented Nov 16, 2021

Same IINA player versions on the left, Infuse in the right. It's not just brighter for the whole scene, it's only the sun which glows, as I expect it and it is displayed on OLED HDR TV sets
Bildschirmfoto 2021-11-16 um 14 51 21
.

@CarterLi
Copy link
Contributor Author

Can you please provide the video source? You may cut the video if it's too big: https://stackoverflow.com/questions/18444194/cutting-the-videos-based-on-start-and-end-time-using-ffmpeg

Can you please test this video? And compare to Safari or Chrome ( but not Firefox which doesn't support HDR playback )

test.zip

@spittix
Copy link

spittix commented Nov 16, 2021

Your video seems working well in Chrome, I'm not able to open it in Safari.

Here's the video cut

cut.mp4

:

@CarterLi
Copy link
Contributor Author

What about playing in IINA?

@spittix
Copy link

spittix commented Nov 16, 2021

In IINA it works. Your version looks much brighter.

@CarterLi
Copy link
Contributor Author

In IINA it works. Your version looks much brighter.

Not only brighter, but also the texture should look more clear

@CarterLi
Copy link
Contributor Author

CarterLi commented Nov 16, 2021

Your video provides no mastering display side data, which is used to determine the color space should be used by IINA video layer.

image
( Left is your video, which has no Mastering display color primaries field. Right is the video I downloaded from Youtube, which suggests the player should use Display P3 colorspace )

I'll test it tomorrow as I have only a Windows machine which has no HDR support now

@CarterLi
Copy link
Contributor Author

Try my latest build @spittix

image

@spittix
Copy link

spittix commented Nov 17, 2021

That looks good :) Brightness is at the expected level

(left upper is test version, left lower is IINA 1.2.0, right upper is Infuse)

If you compare the yellow between test version an Infuse, there's a small difference, which leads to tiny less contrast I guess.

Another point is, that this activated HDR mode is nowhere shown. So can you do me a favour and add a status for that?

Bildschirmfoto 2021-11-17 um 12 14 34

@CarterLi
Copy link
Contributor Author

CarterLi commented Nov 17, 2021

Sounds that Infuse was using different colorspace ( bt.2020 I suppose ). Since the video source didnt suggest which colorspace should be used, any colorspace other than bt.709 was not wrong. I chose Display P3 simply because bt.2020 was deprecated in macOS 11+

@spittix
Copy link

spittix commented Nov 17, 2021

Understood and agree :).
I tested with a few other videos and all looked good.
Thank you for fast response and implementation!

@CarterLi
Copy link
Contributor Author

Another point is, that this activated HDR mode is nowhere shown.

In console log ;)

So can you do me a favour and add a status for that?

TBO I have very little knowledge with cocoa programming. Any contributions are welcome.

There are other things to do:

  1. Test if the screen supports HDR display. Disable HDR support if not
  2. Add an option to disable HDR mode in case anything goes wrong
  3. Add an icon when HDR is enabled as you said

@ViRo3
Copy link

ViRo3 commented Nov 17, 2021

Will it display HDR content on non-HDR displays as on MacBooks, courtesy of EDR?

Relevant link and this

@CarterLi
Copy link
Contributor Author

Will it display HDR content on non-HDR displays as on MacBooks, courtesy of EDR?

Relevant link and this

Yes. Basically IINA and mpv do the same thing on HDR mode. The only difference is that mpv provides some colorspace switches for users to choose, but IINA tries to detect it from the video source.

@akash329d
Copy link

akash329d commented Nov 18, 2021

If possible, could someone test on this clip?

https://drive.google.com/file/d/1FXmRj-wN_GP65AQHzRShNSKojPopZJcF/view?usp=drivesdk

infuse displays this incorrectly and over brightens, so wanted to make sure it works here.

Additionally playing it through iOS apps on macOS like nPlayer or Plex from the App Store it doesn’t look correct either (not sure why, the colors are less saturated).

Have been trying to find a player that plays it correctly, like QuickTime.

Update: Nevermind, tried second test build and it looks good 👍

Second Update: Doesn't seem to be working correctly, might be color profile, will try to find a sample file I'm able to share.

Great example here: https://4kmedia.org/sony-swordsmith-hdr-uhd-4k-demo/

Via Quicktime, you can see the entire background of the flame at the two second marker, via IINA all you can see is the flame.

@CarterLi
Copy link
Contributor Author

Second Update: Doesn't seem to be working correctly, might be color profile, will try to find a sample file I'm able to share.

Great example here: https://4kmedia.org/sony-swordsmith-hdr-uhd-4k-demo/

Via Quicktime, you can see the entire background of the flame at the two second marker, via IINA all you can see is the flame.

The file was too big to download due to the network issue in my country. Can you cut the file into smaller one as said in

https://stackoverflow.com/questions/18444194/cutting-the-videos-based-on-start-and-end-time-using-ffmpeg

@akash329d
Copy link

akash329d commented Nov 19, 2021

Second Update: Doesn't seem to be working correctly, might be color profile, will try to find a sample file I'm able to share.
Great example here: https://4kmedia.org/sony-swordsmith-hdr-uhd-4k-demo/
Via Quicktime, you can see the entire background of the flame at the two second marker, via IINA all you can see is the flame.

The file was too big to download due to the network issue in my country. Can you cut the file into smaller one as said in

https://stackoverflow.com/questions/18444194/cutting-the-videos-based-on-start-and-end-time-using-ffmpeg

It's not as noticeable as I initially thought, but the hue of the flame looks different comparing quicktime and IINA in fullscreen, and additionally the background seems darker in the IINA version. Quicktime looks far more orangeish.

https://drive.google.com/file/d/1CS4MtuCQZEhJ42_wWdVX4Dkp33rfRIH9/view?usp=sharing

(Hopefully this is small enough)

@CarterLi
Copy link
Contributor Author

$ mediainfo -f /Users/carter/Downloads/out.mp4
General
Count                                    : 331
Count of stream of this kind             : 1
Kind of stream                           : General
Kind of stream                           : General
Stream identifier                        : 0
Count of video streams                   : 1
Video_Format_List                        : HEVC
Video_Format_WithHint_List               : HEVC
Codecs Video                             : HEVC
Complete name                            : /Users/carter/Downloads/out.mp4
Folder name                              : /Users/carter/Downloads
File name extension                      : out.mp4
File name                                : out
File extension                           : mp4
Format                                   : MPEG-4
Format                                   : MPEG-4
Format/Extensions usually used           : braw mov mp4 m4v m4a m4b m4p m4r 3ga 3gpa 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma ismt f4a f4b f4v
Commercial name                          : MPEG-4
Format profile                           : Base Media
Internet media type                      : video/mp4
Codec ID                                 : isom
Codec ID                                 : isom (isom/iso2/mp41)
Codec ID/Url                             : http://www.apple.com/quicktime/download/standalone.html
CodecID_Compatible                       : isom/iso2/mp41
File size                                : 71533884
File size                                : 68.2 MiB
File size                                : 68 MiB
File size                                : 68 MiB
File size                                : 68.2 MiB
File size                                : 68.22 MiB
Duration                                 : 8025
Duration                                 : 8 s 25 ms
Duration                                 : 8 s 25 ms
Duration                                 : 8 s 25 ms
Duration                                 : 00:00:08.025
Duration                                 : 00:00:08;01
Duration                                 : 00:00:08.025 (00:00:08;01)
Overall bit rate                         : 71311037
Overall bit rate                         : 71.3 Mb/s
Frame rate                               : 59.940
Frame rate                               : 59.940 FPS
Frame count                              : 481
Stream size                              : 6313
Stream size                              : 6.17 KiB (0%)
Stream size                              : 6 KiB
Stream size                              : 6.2 KiB
Stream size                              : 6.17 KiB
Stream size                              : 6.165 KiB
Stream size                              : 6.17 KiB (0%)
Proportion of this stream                : 0.00009
HeaderSize                               : 36
DataSize                                 : 71527579
FooterSize                               : 6269
IsStreamable                             : No
File last modification date              : UTC 2021-11-19 03:18:06
File last modification date (local)      : 2021-11-19 11:18:06
Writing application                      : Lavf58.76.100
Writing application                      : Lavf58.76.100

Video
Count                                    : 380
Count of stream of this kind             : 1
Kind of stream                           : Video
Kind of stream                           : Video
Stream identifier                        : 0
StreamOrder                              : 0
ID                                       : 1
ID                                       : 1
Format                                   : HEVC
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format/Url                               : http://www.itu.int
Commercial name                          : HEVC
Format profile                           : Main [email protected]@High
HDR format                               : SMPTE ST 2086
HDR format                               : SMPTE ST 2086, HDR10 compatible
HDR_Format_Commercial                    : HDR10
HDR_Format_Compatibility                 : HDR10
Internet media type                      : video/H265
Codec ID                                 : hvc1
Codec ID/Info                            : High Efficiency Video Coding
Codec ID/Url                             : http://www.itu.int/
Duration                                 : 8025
Duration                                 : 8 s 25 ms
Duration                                 : 8 s 25 ms
Duration                                 : 8 s 25 ms
Duration                                 : 00:00:08.025
Duration                                 : 00:00:08;01
Duration                                 : 00:00:08.025 (00:00:08;01)
Bit rate                                 : 71382367
Bit rate                                 : 71.4 Mb/s
Width                                    : 3840
Width                                    : 3 840 pixels
Height                                   : 2160
Height                                   : 2 160 pixels
Sampled_Width                            : 3840
Sampled_Height                           : 2160
Pixel aspect ratio                       : 1.000
Display aspect ratio                     : 1.778
Display aspect ratio                     : 16:9
Rotation                                 : 0.000
Frame rate mode                          : CFR
Frame rate mode                          : Constant
Frame rate                               : 59.940
Frame rate                               : 59.940 (60000/1001) FPS
FrameRate_Num                            : 60000
FrameRate_Den                            : 1001
Frame count                              : 481
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Chroma subsampling                       : 4:2:0 (Type 2)
ChromaSubsampling_Position               : Type 2
Bit depth                                : 10
Bit depth                                : 10 bits
Bits/(Pixel*Frame)                       : 0.144
Stream size                              : 71527571
Stream size                              : 68.2 MiB (100%)
Stream size                              : 68 MiB
Stream size                              : 68 MiB
Stream size                              : 68.2 MiB
Stream size                              : 68.21 MiB
Stream size                              : 68.2 MiB (100%)
Proportion of this stream                : 0.99991
colour_description_present               : Yes
colour_description_present_Source        : Container / Stream
Color range                              : Limited
colour_range_Source                      : Container / Stream
Color primaries                          : BT.2020
colour_primaries_Source                  : Container / Stream
Transfer characteristics                 : PQ
transfer_characteristics_Source          : Container / Stream
Matrix coefficients                      : BT.2020 non-constant
matrix_coefficients_Source               : Container / Stream
Mastering display color primaries        : R: x=1.000000 y=1.000000, G: x=1.000000 y=1.000000, B: x=1.000000 y=1.000000, White point: x=1.000000 y=1.000000
MasteringDisplay_ColorPrimaries_Source   : Stream
Mastering display luminance              : min: 0.1000 cd/m2, max: 0.5000 cd/m2
MasteringDisplay_Luminance_Source        : Stream
Codec configuration box                  : hvcC

This file doesn't seem to be well encoded.

  1. Mastering display metadata is provided at stream level not container level. IINA currently don't support this situation and fallback to Display P3.
  2. Mastering display color primaries values are strange. They're not any known color primaries ( BT.709, BT.2020, DCI P3, Display P3 ), I wonder if these values are really valid.
  3. Mastering display luminance is also strange. Max luminance is only 0.5 nit which seems too dark.

Did Quicktime really do the correct thing?

@akash329d
Copy link

akash329d commented Nov 19, 2021

This file doesn't seem to be well encoded.

  1. Mastering display metadata is provided at stream level not container level. IINA currently don't support this situation and fallback to Display P3.

  2. Mastering display color primaries values are strange. They're not any known color primaries ( BT.709, BT.2020, DCI P3, Display P3 ), I wonder if these values are really valid.

  3. Mastering display luminance is also strange. Max luminance is only 0.5 nit which seems too dark.

Did Quicktime really do the correct thing?

I’m not sure if it did the “correct” thing, it just did it differently than this implementation. To my eyes I prefer what QuickTime does, the difference is quite noticeable in a lot of HDR content I’ve tested with. You can test QuickTime on your end too I believe? Should be preinstalled on all MacBooks.

From what I’ve noticed most files include metadata at the stream level, not the container level, is this not possible to support? (Have any of the example files sent in this PR included it at container level? I don't think I've ever seen that).

As a second note - another test file with correct luminance/metadata, however still includes the metadata at the stream level doesn't play correctly due to incorrect color space (at least I believe). The color hues look off slightly, however the luminance appears the same.

https://drive.google.com/file/d/1W5Drhe0Jstvp4a4Ae-oJkSxyPr3CjQ7w/view?usp=sharing

Source: https://ff.de/hdr10plus-metadata-test/

I think most (if not all) HDR content is sent out in BT.2020, so that may be a better default rather than P3.

@CarterLi
Copy link
Contributor Author

CarterLi commented Nov 19, 2021

From what I’ve noticed most files include metadata at the stream level, not the container level

Why? It's a suggestion for the whole movie, isn't it?

is this not possible to support?

Please try my latest binary: https://github.com/CarterLi/iina/releases/tag/v1.2.0-5

(Have any of the example files sent in this PR included it at container level? I don't think I've ever seen that).

#3539 (comment)

Source: https://ff.de/hdr10plus-metadata-test/

It suggests Display P3 too

I think most (if not all) HDR content is sent out in BT.2020, so that may be a better default rather than P3.

But it was deprecated by Apple. It would be better if we provide an option for user to choose.

I'm no expert at cocoa. Can you contribute?

@CarterLi
Copy link
Contributor Author

There are enough reason to use IINA.

  1. Compare to Movist, it's free and open source
  2. Compare to VLC, it supports HDR playback ( although not perfect )
  3. Compare to QuickTime, it support much more formats
  4. Compare to mpv, it's much easier to use and the HDR code has not merged into MPV mainline yet

@akash329d
Copy link

akash329d commented Nov 19, 2021

Please try my latest binary: https://github.com/CarterLi/iina/releases/tag/v1.2.0-5

Unfortunately I'm still seeing the same issue with the flame file compared to quicktime, the hue is off (I assume this is due to assuming P3 instead of Rec2020, not sure why as you're looking at the individual frames). Will make sure this is the case tomorrow when I can run it via XCode and view the logs (I believe this is the only way to view NSLogs). Sorry I have no experience at all with MacOS development, but hopefully can figure some of this stuff out.

Why? It's an suggestion for the whole movie, isn't it?

It is, but mp4/mkv support multiple video streams, so I'm guessing the metadata is per stream for that reason?

Source: https://ff.de/hdr10plus-metadata-test/

It suggests Display P3 too

I don't think it does? From mediainfo (Color Primaries are labeled as BT2020).

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.0001 cd/m2, max: 1000 cd/m2
Maximum Content Light Level              : 1000 cd/m2
Maximum Frame-Average Light Level        : 400 cd/m2
mdhd_Duration                            : 6083
Codec configuration box                  : hvcC

But it was deprecated by Apple. It would be better if we provide an option for user to choose.

Agreed.

I'm no expert at cocoa. Can you contribute?

Unfortunately I've never worked with Cocoa or Swift (which is why I haven't contributed anything or tried to tackle this myself), but I can try and sit down and figure it out tomorrow.

@CarterLi
Copy link
Contributor Author

CarterLi commented Nov 19, 2021

I don't think it does? From mediainfo (Color Primaries are labeled as BT2020).

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.0001 cd/m2, max: 1000 cd/m2
Maximum Content Light Level              : 1000 cd/m2
Maximum Frame-Average Light Level        : 400 cd/m2
mdhd_Duration                            : 6083
Codec configuration box                  : hvcC

It's about Mastering display color primaries. Color primaries should always be BT.2020 for HDR content ( or BT.709 for SDR )

  • Mastering display color primaries maps to the colorspace of you screen
  • Color primaries maps to mpv's --target-prim option
  • Transfer characteristics maps to mpv's --target-trc option

Mastering display luminance maps to edrMetadata, but it's only supported by Metal layer, while IINA still uses the deprecated OGL layer. That's a point that QuickTime may do better than IINA

@akash329d
Copy link

akash329d commented Nov 19, 2021

I don't think it does? From mediainfo (Color Primaries are labeled as BT2020).

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.0001 cd/m2, max: 1000 cd/m2
Maximum Content Light Level              : 1000 cd/m2
Maximum Frame-Average Light Level        : 400 cd/m2
mdhd_Duration                            : 6083
Codec configuration box                  : hvcC

It's about Mastering display color primaries. Color primaries should always be BT.2020 for HDR content ( or BT.709 for SDR )

  • Mastering display color primaries maps to the colorspace of you screen
  • Color primaries maps to mpv's --target-prim option
  • Transfer characteristics maps to mpv's --target-trc option

Mastering display luminance maps to edrMetadata, but it's only supported by Metal layer, while IINA still uses the deprecated OGL layer. That's a point that QuickTime may do better than IINA

This makes sense, I was misinterpreting those values.

I'm unsure on why the QuickTime hue's don't match IINA's then (I don't think it's purely luminance level like you mentioned as the orange hue is pretty noticeably different). Potentially Quicktime is interpreting the color space incorrectly then?

Do you notice the same hue difference that I do when comparing Quicktime and IINA on the flame file?

@spittix
Copy link

spittix commented Nov 19, 2021

Please try my latest binary: https://github.com/CarterLi/iina/releases/tag/v1.2.0-5

Did you change anything? I see the same build number as 2 days ago.
My HDR tests where successful.

I think most (if not all) HDR content is sent out in BT.2020, so that may be a better default rather than P3.

But it was deprecated by Apple. It would be better if we provide an option for user to choose.

A good idea in my opinion.

I'm no expert at cocoa. Can you contribute?

Unfortunately I've no experience with cocoa.

@CarterLi
Copy link
Contributor Author

Did you change anything? I see the same build number as 2 days ago. My HDR tests where successful.

Changelog can be find here: https://github.com/CarterLi/iina/commits/develop

I think most (if not all) HDR content is sent out in BT.2020, so that may be a better default rather than P3.

But it was deprecated by Apple. It would be better if we provide an option for user to choose.

A good idea in my opinion.

I'm no expert at cocoa. Can you contribute?

Unfortunately I've no experience with cocoa.

We can't do anything if no one is familiar with cocoa.

COME BACK our saviors @lhc70000 @Alejx

@anastasiuspernat
Copy link

@CarterLi oh great to see my code lives on! Thanks for augmenting it.

Have you guys tried the HDR binary that I made a year ago from my original HDR commit? https://github.com/anastasiuspernat/iina/releases/tag/1.1.2.HDR

Btw I implemented same fix for mpv back then. I hardly remember the details, doesn't it work on M1?

@CarterLi
Copy link
Contributor Author

@CarterLi oh great to see my code lives on! Thanks for augmenting it.

Have you guys tried the HDR binary that I made a year ago from my original HDR commit? https://github.com/anastasiuspernat/iina/releases/tag/1.1.2.HDR

Btw I implemented same fix for mpv back then. I hardly remember the details, doesn't it work on M1?

First

https://github.com/anastasiuspernat/iina/blob/develop/iina/FFmpegController.m#L489

This logic was wrong. Should be metadata3->display_primaries[1][0].num/metadata3->display_primaries[1][0].dun/0.000002 as said in https://github.com/rigaya/NVEnc/issues/51#issuecomment-392572746 as in your comment.

Since the logic was wrong, you would never find the correct primaries code and default to dcip3.

And with your special case, primaries will be set as Display P3, always.

Second

You didn't specify --target-prim option. Therefore HDR mode won't be activated in MPV side. I don't know how did you test it...

And to be honest. The code in FFmpegController was full of mess. Lots of unnecessary code, unused variables, memory / resource leaks...

But still, your code was really a good start. This PR won't exist without your code. Thanks for your work.

@akash329d
Copy link

akash329d commented Nov 20, 2021

I'm unsure on why the QuickTime hue's don't match IINA's then (I don't think it's purely luminance level like you mentioned as the orange hue is pretty noticeably different). Potentially Quicktime is interpreting the color space incorrectly then?

Update on this - flame file matches Quicktime hue exactly when setting the video layer to the itur_2020_PQ color space.

Are you sure it's correct behavior to set the video layer to the mastering display color primaries? Seems odd that Quicktime does this differently.

Second update - noticed a bug in grabbing mastering display color primaries from video frame, will submit pull request shortly.

I think matching Quicktime's behaviour would make sense - using the color primaries metadata tag for both --target-prim and the display layer (which I would think should always be matching anyways)?

As an example, iPhone videos captured in HLG using HDR that have no Mastering Display metadata are displayed with an itur_2020_pq colorspace in quicktime as well, with the current implementation using P3 the video looks off in IINA.

EDIT: All of this is fixed in latest updates - using mastering display color space for --target-prim and the display layer :).

@CarterLi
Copy link
Contributor Author

CarterLi commented Nov 20, 2021

EDIT: All of this is fixed in latest updates - using mastering display color space for --target-prim and the display layer :).

https://github.com/CarterLi/iina-hdr/releases/tag/v1.2.0-7

Changelog:

  1. Colorspace will fallback to use Color primaries ( usually bt.2020 ) instead of hard coded Display P3 when Mastering display metadata is not provided
  2. We now correctly set --target-prim to display-p3 when Display P3 primaries is used
  3. Add a section which shows primaries info of the playing video

image

One major issue I found:

Currently HDR mode was mapped to display instead of video source. So if you open an SDR video, close it, then open an HDR video, HDR mode won't be enabled.

What we should do:

  1. Enable HDR mode & set colorspace on video starting
  2. ICC profile should always be set. It's still useful if user open another SDR video
  3. Dynamically enable & disable HDR mode & set colorspace, when displayId is changed ( for example user drag the player window to another display that doesn't support HDR )

Don't have a good way to resolve it yet.

@ViRo3
Copy link

ViRo3 commented Nov 20, 2021

image

Top : IINA (latest from your repo/releases)
Bottom : QT

Files from here.
Device : M1/on AC/12.0.1

@CarterLi
Copy link
Contributor Author

CarterLi commented Nov 20, 2021

Top : IINA (latest from your repo/releases) Bottom : QT

Files from here. Device : M1/on AC/12.0.1

That's awful. Thanks for reporting.

Edit: Seems that the screen was warming up. If you pause for some time, the image gets normal.

I don't know how to fix it. As long as I enable HDR mode, the screen gets over bright, regardless what primaries is used. Let's pause the player a while for now

@ViRo3
Copy link

ViRo3 commented Nov 20, 2021

I have paused it for a while but EDR fails to be kicking in. To be noted is that Low Power Mode is enabled and dimmed display. Does that impact EDR ?

Update: It seems EDR kicks in instantly no matter the settings/power options but color is messed up as show above.

@spittix
Copy link

spittix commented Nov 21, 2021

I tested the latest release on a MBP 16" 2021. The output for colorspace seems to be corrected:

HDR
Bildschirmfoto 2021-11-21 um 10 59 40
:
SDR
Bildschirmfoto 2021-11-21 um 11 01 39
:

the HLG samples from ViRo3 work fine for me with this version
Bildschirmfoto 2021-11-21 um 11 21 14

IINA ist still brighter than Quicktime, but for me it looked not that worse like on the screenshot and IINA looks equal to Infuse Pro (upper left IINA, right Infuse, lower left Quicktime. For me it looks good in IINA ;)
Bildschirmfoto 2021-11-21 um 11 29 29

@akash329d
Copy link

akash329d commented Nov 21, 2021

Suspect that the lighting differences are due to not being able to set edrMetadata for the layer, which can't really be fixed without switching to Metal?

@CarterLi
Copy link
Contributor Author

Added a switch for fast HDR mode toggling

image

It will be disabled when HDR can't be enabled, eg SDR source, your monitor doesn't support HDR, etc.

@CarterLi
Copy link
Contributor Author

CarterLi commented Nov 24, 2021

I closed this PR because I was bored resolving conflicts between my working branch and this PR branch, but I'll keep releasing new binaries in my fork repo when any changes are made ( for example cherry-picking @low-batt's fixes ).

HDR for IINA is considered feature complete though. Any issues, feature requests should be filed in my fork repo

@richtong
Copy link

richtong commented Jan 8, 2022

So just to be clear, when does your very cool HDR improvements go into the main release. HDR on the MacBook Pro M1 is literally brighter than the sun. Nice work! It does not look that different on my SDR display but it is very noticeable. The one on the right looks blown out on an SDR display but is incredible on the mini-LEd.

Thanks again. I presume I just have to keep copying DMGs from iina-plus then?

image

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

Successfully merging this pull request may close these issues.

None yet

6 participants