mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.4k stars 2.91k forks source link

Use vo=gpu-next for Dolby Vision P5 video in my own macOS App #11308

Closed shishaozheng closed 1 year ago

shishaozheng commented 1 year ago

Important Information

Reproduction steps

  1. Build the mpv library with the --enable-libplacebo flag to enable playback of Dolby Vision P5 video.
  2. Add the mpv library to the Xcode project and create a new NSWindow with a CAOpenGLLayer for rendering.
  3. When using vo=libmpv to play normal video, the video image is rendered on the NSWindow with the CAOpenGLLayer correctly. However, when playing Dolby Vision P5 video, the video color is incorrect.
  4. When trying vo=gpu-next for Dolby Vision P5 video, the video color is correct but the video image is not rendered on the NSWindow with the CAOpenGLLayer. Instead, a new window of mpv itself pops up and starts playing.

Expected behavior

When using vo=gpu-next for Dolby Vision P5 video, the video image should be rendered on my own NSWindow with the CAOpenGLLayer with the correct color. This is because vo=gpu-next is based on libplacebo, which supports OpenGL.

Actual behavior

When using vo=gpu-next for Dolby Vision P5 video, a new window of mpv itself pops up and starts playing.

For vo=gpu-next, should I use MoltenVK for rendering? Is it supports OpenGL? How to prevent the window of mpv itself from popping up and use my own window?

Akemi commented 1 year ago

gpu-next uses the old deprecated cocoa backend and is not supported atm.

george-emerald commented 1 year ago

Does this mean it's not supported for newer Mac OS versions? 'Cause I've tried the builds in mpv.io and homebrew ARM and AMD builds and none of them have gpu-next at all. I don't use mpv for Dolby Vision as it tonemaps it and my TV supports it, but I'd like to try it for the faster performance. Is it impossible?