Closed sclsj closed 2 years ago
We don't enable HDR mode with SDR content. How can I reproduce it?
Just open a SDR video in IINA plus, I guess? I'm uploading a demo to OneDrive now.
Just open a SDR video in IINA plus, I guess? I'm uploading a demo to OneDrive now.
I did that a lot of times, and got no issues.
Hopefully you can see the fluctuation in brightness. Still uploading now.
I also tried setting max SDR brightness to 1000 nits with Lunar and have similar issues when transitioning, so I don't think it's an IINA bug. Here's a demo. The brightness fluctuation is more apparent with this.
Which MBP model are you using and what macOS version are you on? I felt like this might be due to different system configurations but I'm not sure. Maybe if I do a system restore with Apple Configurator like some people have done this problem will disappear? Unfortunately I don't really have the time to migrate all the data I already have.
My network is not very good and I dont want to download 708MB to test a small issue. Please cut your video into smaller one ( several seconds are enough ). Also please test it with the official IINA version to see if this issue only happens on IINA-plus.
It does not happen with the official IINA version, as I've stated in the bug description. Please tell me an acceptable size for you and I will work to meet the limit.
Please cut it ( but do NOT convert it ) into about 10 seconds
Sorry, I missed you comment. I cut using quicklook and compressed using handbrake (CQ 25). I hope the quality is still fine for you. At least I can't tell any differences.
Maybe video source specific. Please cut the Stress.mp4
and upload it.
打开你上传的这个IINA.Plus+Original.IINA.mp4文件屏幕会闪吗?
打开你上传的这个IINA.Plus+Original.IINA.mp4文件屏幕会闪吗?
用IINA-Plus会,其他,如VLC,quicklook, QuickTIme, IINA不会
Maybe video source specific. Please cut the
Stress.mp4
and upload it.
I actually tested with an audio later on in the recording but forgets about it and cut it out. Let me upload that part again.
打开你上传的这个IINA.Plus+Original.IINA.mp4文件屏幕会闪吗?
用IINA-Plus会,其他,如VLC,quicklook, QuickTIme, IINA不会
That's strange. Since this repo has existed for several months, if it was a common issue, someone else should have encountered it.
This is testing with opening audio. It is less obvious but I think you can still see some brightness fluctuation.
Completely no. I'm sorry.
That's strange. Since this repo has existed for several months, if it was a common issue, someone else should have encountered it.
It is quite strange. There are other weird graphic glitches like non-existent window (i.e. should be in another location) being rendered on screen. I'm not sure whether it's because something wrong with the software or the hardware. I've heard online that some people have some issues with their m1 macs until they erased and reinstalled macOS. Maybe that's what's happening.
Until anyone else can confirm the behavior on their laptop I guess this is just an isolated case.
Completely no. I'm sorry.
I understand. The fluctuation is quite subtle on camera and is easily interpreted as other unrelated phenomenons such as auto exposure change. Can you see the brightness fluctuation on the first video though?
Completely no. I'm sorry.
I understand. The fluctuation is quite subtle on camera and is easily interpreted as other unrelated phenomenons such as auto exposure change. Can you see the brightness fluctuation on the first video though?
Yes, I can. However it didn't happen for me. So I requested you uploading the cuttedStress.mp4
file
Here are some console logs: IINA-plus
默认 21:37:37.917474+0800 WindowServer Display 1 commitBrightness sdr: 151.201, headroom: 1.02529, ambient: 5.47863, filtered ambient: 17.2116, limit: 400
默认 21:37:37.985379+0800 WindowServer Display 1 commitBrightness sdr: 151.201, headroom: 1.07381, ambient: 5.47863, filtered ambient: 17.2116, limit: 400
默认 21:37:38.082391+0800 WindowServer Display 1 commitBrightness sdr: 151.201, headroom: 1.26232, ambient: 5.47863, filtered ambient: 17.2116, limit: 400
默认 21:37:38.122862+0800 WindowServer Display 1 commitBrightness sdr: 151.201, headroom: 1.33734, ambient: 5.47863, filtered ambient: 17.2116, limit: 400
默认 21:37:39.244524+0800 WindowServer Display 1 commitBrightness sdr: 151.201, headroom: 5.86721, ambient: 5.47863, filtered ambient: 17.2116, limit: 1153.26
默认 21:37:39.528525+0800 WindowServer Display 1 commitBrightness sdr: 151.201, headroom: 8.01516, ambient: 5.47863, filtered ambient: 17.2116, limit: 1575.47
默认 21:37:39.689451+0800 WindowServer Display 1 commitBrightness sdr: 151.201, headroom: 8.13997, ambient: 5.47863, filtered ambient: 17.2116, limit: 1600
默认 21:37:40.005932+0800 WindowServer Display 1 commitBrightness sdr: 151.201, headroom: 8.13997, ambient: 5.47863, filtered ambient: 17.2116, limit: 1600
默认 21:37:48.081635+0800 WindowServer Display 1 commitBrightness sdr: 151.201, headroom: 8.05474, ambient: 5.31468, filtered ambient: 16.6966, limit: 1583.25
默认 21:37:48.220196+0800 WindowServer Display 1 commitBrightness sdr: 151.201, headroom: 6.94304, ambient: 5.31468, filtered ambient: 16.6966, limit: 1364.73
默认 21:37:48.402401+0800 WindowServer Display 1 commitBrightness sdr: 151.201, headroom: 5.72897, ambient: 5.31468, filtered ambient: 16.6966, limit: 1126.09
默认 21:37:48.481518+0800 WindowServer Display 1 commitBrightness sdr: 151.201, headroom: 5.20403, ambient: 5.31468, filtered ambient: 16.6966, limit: 1022.91
默认 21:37:48.927524+0800 WindowServer Display 1 commitBrightness sdr: 151.201, headroom: 3.83303, ambient: 5.31468, filtered ambient: 16.6966, limit: 753.424
默认 21:37:49.015824+0800 WindowServer Display 1 commitBrightness sdr: 151.201, headroom: 2.97516, ambient: 5.31468, filtered ambient: 16.6966, limit: 584.8
默认 21:37:49.081327+0800 WindowServer Display 1 commitBrightness sdr: 151.201, headroom: 2.79866, ambient: 5.31468, filtered ambient: 16.6966, limit: 550.107
默认 21:37:49.238864+0800 WindowServer Display 1 commitBrightness sdr: 151.201, headroom: 2.56453, ambient: 5.31468, filtered ambient: 16.6966, limit: 504.087
默认 21:37:49.498092+0800 WindowServer Display 1 commitBrightness sdr: 151.201, headroom: 1.79244, ambient: 5.31468, filtered ambient: 16.6966, limit: 400
默认 21:37:49.770308+0800 WindowServer Display 1 commitBrightness sdr: 151.201, headroom: 1.55861, ambient: 5.31468, filtered ambient: 16.6966, limit: 400
默认 21:37:49.983711+0800 WindowServer Display 1 commitBrightness sdr: 151.201, headroom: 1.08937, ambient: 5.31468, filtered ambient: 16.6966, limit: 400
默认 21:37:58.964790+0800 WindowServer Display 1 commitBrightness sdr: 151.201, headroom: -1, ambient: 5.38952, filtered ambient: 16.9317, limit: -1
IINA
nothing when searching "sdr"
This is when opening the "stress.mp4" file.
I will upload a sample soon.
Completely no. I'm sorry.
I understand. The fluctuation is quite subtle on camera and is easily interpreted as other unrelated phenomenons such as auto exposure change. Can you see the brightness fluctuation on the first video though?
Yes, I can. However it didn't happen for me. So I requested you uploading the cutted
Stress.mp4
file
As I've said, this happens with literally every video and audio, so here is a demo with the IINA-Plus.Audio.mp4 I just sent you.
Actually, I forget to say this: this brightness fluctuation is not present in the screen recording. So I choose to film it with my iPhone instead of recording the screen. This is the reason why I think it has something to do with how Apple scales brightness with SDR/HDR videos.
And did you try to search for "sdr" in Console? Did you get the same behavior as the one I posted?
Regardless of whether the brightness fluctuation is present, if there is relevant logs in Console then IINA-plus is using HDR somehow.
SDR is bt.709
$ mediainfo /Users/carter/Desktop/stress.mp4
...
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
Codec configuration box : avcC
...
All HDR related logics will be bypassed when we detect bt.709
https://github.com/iina-plus/iina/blob/develop/iina/VideoView.swift#L348
We don't print logs with SDR content, as it's the general path.
We don't print logs with SDR content, as it's the general path.
Could you please explain what do you mean by that? The logs are from WindowServer which scales brightness for SDR/HDR content. See https://alinpanaitiu.com/blog/over-500nits-failed/
for where I get the keyword.
Sorry, I don't know any programming language☹️. Here are my observations:
Based on these three observations, there seems to be a correlation between HDR mode, screen brightness range / limit messages in Console, and screen brightness fluctuations. Therefore, my educated guess is that IINA (plus) is using HDR mode when playing SDR videos.
Please tell me if I'm wrong in any of these reasoning steps.
I think I find something, please wait a minute
New binaries generated. Please have a test.
The new binaries no longer triggered this bug.
Thanks for reporting
System and IINA version:
Expected behavior: For non-HDR videos, no HDR-related things/functions (don't really know how to call them) is used. Therefore, you can avoid Apple's buggy implementation of HDR.
Actual behavior: All video and audio opened, no matter the HDR status, makes IINA call HDR things/functions which trigger Apple's bug.
Details For whatever reason, using HDR-related things/functions on macOS (XDR displays) result in fluctuation in brightness and 100% (really 100 x CPU cores %) windowserver CPU usage. This is not a bug in IINA. However, you can avoid this bug by not using HDR, like the system player and the original IINA player, when playing non-HDR content. If a video demonstrating this would be helpful, let me know where I can upload it.
How often does this happen? Everyone a file is opened by IINA when no un-hidden (foreground or background) windows are present.