CarterLi / iina

The modern video player for macOS with additional features and bug fixes.
https://iina.io
GNU General Public License v3.0
681 stars 29 forks source link

Dolby Vision support #28

Open ark-1 opened 2 years ago

ark-1 commented 2 years ago

Currently, if you open a Dolby Vision file, it is opened with wrong colors. mpv already has some support for Dolby Vision (https://github.com/mpv-player/mpv/issues/7326) with --vo=gpu-next flag. Upstream issue: https://github.com/iina/iina/issues/3313.

If it is indeed as simple as providing an option to mpv, can you please support it 🥺? Thanks!

CarterLi commented 2 years ago

No, it is supported in gpu-next (libplacebo) only but gpu-next core doesnt support macOS yet.

If it is indeed as simple as providing an option to mpv, can you please support it 🥺?

I'm afraid not even after gpu-next core is supported on macOS. Using gpu-next core with HDR support requires volkan (MoltenVK), which is implemented on Metal layer. However IINA uses OpenGL layer. Switching it requires huge effort and I dont think anyone is familier with it.

Adding a mpv flag is easy. Just add it in the advanced preference.

low-batt commented 2 years ago

Apple deprecated OpenGL in Mojave in favor of Metal. IINA will have to move off OpenGL at some point. No choice in my opinion. That will require a really major effort. Of course that can't happen until mpv supports MoltenVK.

I'm not clear on where mpv is at with that effort. Some of the issues I read were from quite a while ago. They were talking about Vulkan features MoltenVK had not gotten around to implementing. Carter, do you know where that mpv effort is at?

ViRo3 commented 2 years ago

https://github.com/mpv-player/mpv/pull/7482

ViRo3 commented 2 years ago

@low-batt Since this Iina is an unstable build doesn't it make sense to add a toggle for the above referenced backend as an Experimental option ?

low-batt commented 2 years ago

CarterLi is the expert on this. I defer to him on all things HDR. Here is what I think I know about the state of things. CarterLi may correct my understanding.

The proposed required changes to mpv in https://github.com/mpv-player/mpv/pull/7482 have not been merged. The last activity on that issue was in July last year. Those changes can no longer be merged without addressing merge conflicts. More recent work can be seen here: https://github.com/haasn/libplacebo/issues/111 I'm uncertain as to the outcome of that experiment. Seems like any attempt to use this support requires switching from a released version of mpv to their current development branch and then applying patches to that branch. I'm not clear on whether that results in something close to working, or very unstable. That is what I was asking Carter.

Once mpv is working then IINA has to be updated to use MoltenVK to be able to use the new mpv feature. That is definitely a lot of work. That might involve adding an OpenGL / MoltenVK toggle.

The point I was trying to make is that in my opinion IINA has to be planning on adding MoltenVK support once it is available in mpv. In officially deprecating OpenGL Apple has made it clear that applications must move away from OpenGL.

CarterLi commented 2 years ago

It's hard even for the preparation.

vulkan for mac is not a homebrew formula and doesn't play with homebrew well. Various hacks to homebrew are needed or libplacebo can't find vulkan when building with homebrew.

Another option is to use molten-vk directly, which requires hacks to libplacebo source code.

ViRo3 commented 2 years ago

ANGLE if capable, makes more sense 🤷‍♂️ (and Apple is actively contributing to it for WebKit) while backing renderer can be Metal (or OpenGL) (?)