Hacker News new | past | comments | ask | show | jobs | submit login

Hm, I've had (significant) issues with color representation playing back "HDR" media in mpv.



Then you must have not used "mpv --vo=gpu-next".

Playing HDR and Dolby Vision encoded movies has been solved a long time ago in mpv, but they usually need the option shown above, which may not be the default on your system.

There are plenty of additional options in mpv that provide a finer control of how HDR colors are handled.

While playing a movie with mpv, press "I", so that mpv will display the information it has about the color space supported by your display and the color space used in the movie, which will allow you to verify if they are correct.


I have used vo=gpu-next, actually. Still green/purple.

"I" shows: Primaries: bt.2020. Colormatrix: bt.2020-ncl. Levels: full. If that means anything.


"I" must show two sets of "Format: Levels: Colormatrix: Primaries: Transfer:", one set for "Display:" and one set for "Video:".

"mpv" or any other player must make a conversion from the color space used for encoding the video file to the color space supported by the monitor. A monitor that has not been reconfigured after the initial installation is likely to use the sRGB color space. Any good monitor should have a configuration menu that allows the selection of a better color space, but mpv can convert BT.2020 to sRGB, if necessary (which will reduce the saturation of many colors).

Did mpv print after being launched a line starting with "VO: [gpu-next]"?

Where "gpu-next" is not available, mpv will start anyway, but it will use one of the other video drivers, none of which convert correctly Dolby-encoded video.

On the computer where I normally play HDR/Dolby Vision movies, I use an NVIDIA GPU, so I know for sure that gpu-next works fine with it.

I do not remember whether I have played any HDR/Dolby Vision movie with an AMD or Intel GPU, but I doubt that any of those is incompatible with gpu-next.

In any case, if mpv prints "VO: [gpu-next]" without any error message and if "I" shows for "Display:" the correct color space supported by your monitor, e.g. sRGB or DCI-P3, then you should try to upgrade the GPU driver, which could be too old. Like I have said, IIRC this problem has been solved in 2022 and since then I have never encountered again color conversion errors, so you must have some software component that is older than 2022.

Because my monitor is configured to use the color space DCI-P3 (with 10-bit colors), I alias "mpv" to "mpv='mpv --vo=gpu-next --target-prim=dci-p3'", and it has been working fine for the last two years, including with any HDR and/or Dolby Vision movie.


Not something I have experience with so can’t speak to that.


was the material purple-green by chance?


Yeah. I did try playing around with some of the colorspace options you can find googling, but nothing seemed to work.


That's a Dolby Vision Profile 5 file. A format that's very very proprietary. The only PC apps that can play them at all are https://apps.microsoft.com/detail/9p9zh5fl1bfk?hl=en-ms&gl=M... and https://firecore.com/infuse


Nowadays mpv is able to decode it correctly, but it usually requires for that the command-line option "--vo=gpu-next".

A couple of years ago, mpv was unable to handle it.


You can play it with mpv, it depends on the hardware/drivers. It worked fine on a random Ryzen Lenovo laptop with Linux even though MacOS version of mpv couldn't play it correctly on M2 (even though Apple claims that M2 is compatible with the format).


It depends on what format/decoder support went into your particular build of mpv. It offloads almost all of its capabilities onto ffmpeg and its supporting libraries, which in turn won't necessarily be built with exactly everything enabled.


And you're sure it was a Profile 5, not 7/8 file?


Is there a way to use Infuse on PC? The only links I see are to the App Store


Macs are PC's, you can also make a hackintosh.

EDIT2: if you consider an ARM board that you can install custom OS on as a PC – admittedly, bit of a stretch – then you can grab UGOOS AM6B plus / AM6 plus / Minix u22x-j max

install CoreELEC on it and enjoy DV.

https://github.com/CoreELEC/CoreELEC/releases https://discourse.coreelec.org/t/dolby-vision-for-minix-u22x... Recommended settings: https://justpaste.it/divn9 Installation instructions 1: https://discourse.coreelec.org/t/guide-s922x-j-ugoos-am6b-co... Installation instructions 2: https://www.reddit.com/r/PleX/comments/1ajszn9/remux_lovers_...

EDIT: I forgot that for Windows playback, you also need the HEVC and DoVi codec packages.

https://apps.microsoft.com/detail/9P9ZH5FL1BFK https://apps.microsoft.com/detail/9PLTG1LWPHLF https://apps.microsoft.com/detail/9nmzlz57r3t7


Infuse is great. I use it to play stuff (in basically any format) from the NAS through the Apple TV on a dumb TV.


Try this in your mpv.conf file

    no-config
    target-trc=pq
    target-prim=bt.2020
    vo=gpu-next
Wont be 100% accurate, but hopefully somewhat watchable

See also https://github.com/mpv-player/mpv/issues/10122


I believe that the target primaries must be those of your monitor.

BT.2020 are the primaries used to encode the HDR movie.

Monitors with such primaries are rare and extremely expensive. For most good monitors "--target-prim=dci-p3" should be appropriate, if DCI-P3 has already been selected from the on-screen monitor configuration menu, because most monitors come configured by default to use the ugly sRGB color space, so you must change the defaults to be able to display content with bigger color spaces.

Some monitors might have the option to use the BT.2020 color space, when they would still not be able to display all of it, but they would do internally the conversion between the BT.2020 used to encode the movie and whatever color space the monitor can actually display.


Still very green/purple. It's fine, I was able to find a non-HDR version.


Then you probably have either a very old mpv or one that was compiled without including the "gpu-next" video output driver.

Or else the GPU drivers for your GPU card have not been updated for a very long time.

A recent mpv and recent GPU drivers should solve this problem, because it was frequently encountered only up to a couple of years ago.


mpv 0.36.0 from July 2023, nvidia 555.58.02 drivers from August 2024 (Fedora 39).


My output of "mpv --version":

  mpv 0.38.0 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
  libplacebo version: v6.338.2
  FFmpeg version: 6.1.1 
I do not remember which was the first version that worked fine. For some time, "gpu-next" was not included by default in the releases, but you had to compile a custom variant to include it.

Pay attention that "libplacebo" is required. If libplacebo is absent, then the Dolby Vision conversion will not work. This could be the reason of your problem, if your Linux distribution does not have libplacebo as an automatic dependence of mpv, or if mpv has been compiled without support for libplacebo.


I would try updating to 0.37.0 or 0.38.0, IIRC it only started to work for me after I updated to one of those (I always build mpv from the latest commit myself, so I'm not sure which release version exactly has the crucial fixes).




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: