ggarra13 / mrv2

Professional player and review tool for vfx, animation and computer graphics.
https://mrv2.sourceforge.io
BSD 3-Clause "New" or "Revised" License
190 stars 13 forks source link

Image is more saturated than in other video players #235

Closed Thane5 closed 3 months ago

Thane5 commented 3 months ago

Describe the bug Videos in mrv2 appear more saturated than in other video players like vlc. I checked if the color settings, like OCIO or LUTs are different from the defaults, but i could not find anything relevant (especially since i have never changed any of the color settings).

saturation

Desktop (please complete the following information):

ggarra13 commented 3 months ago

I believe this may not be a bug. mrv2 is one of the few players that respects the metadata embedded in the movie. Most viewers including mrViewer, DJV, OpenRV (and likely VLC too), assume a RGB color space (FFmpeg's default). mrv2 assumes a Rec709 color space (more correct for current monitors) and will make a color conversion if the movie metadata is not using Rec709. In the Media Info Panel, check the metadata for Color Primaries, Color TRC and Color Space. Anyway, since you are using the CC BigBuck bunny movie, upload your version of it to an upload service like mega.nz and I'll take a look if that's the reason for the difference.

Thane5 commented 3 months ago

This is the test video https://download.blender.org/demo/movies/BBB/bbb_sunflower_1080p_30fps_normal.mp4.zip

Interestingly, a video i exported from davinci resolve in sRGB mode always showed "rec709" in the metadata. Only when i used a more "exotic" color space, for example "rec2020" it would also put that into the metadata.

Thane5 commented 3 months ago

i did another test with blender. I exported a render as an mkv file with these settings, and i think i am going a little insane: image

The color in the mkv itself is fine, so i dont think that Blender is at fault here. i verified this by re-importing this MKV and a PNG back into blender's video editing mode. There, the colors are identical to the render view in the blender file where i created it.

However, none of my video player display the colors correctly. Colorswtf

Every single video player shows the colors wrong, the only difference is that mrv2 adds a little saturation on top of it. And like with the davinci Resolve export, the "YUV Coefficients" were REC709. I do not know what is happening here, but maybe neither Davinci Resolve nor Blender expect this metadata to be used?

i also double checked these colors with an exported mp4. i attached it here because github doesnt like mkv files. https://github.com/ggarra13/mrv2/assets/13683581/75429701-186d-4529-8c6a-f1ed67947a5e

Final note here: Yes, i just noticed that Google Chrome is the only "video player" that apparently displays the colors correctly....

ggarra13 commented 3 months ago

First things first. mrv2 has indeed a bug with YUV420 movies, like your Big Buck Bunny video, which was indeed saturating them. I already fixed that. Still does not match vlc, but maybe that's correct.

Can you attach your Blender's PNG file? That would be useful for me to compare.

Thane5 commented 3 months ago

here sRGBTest

ggarra13 commented 3 months ago

Your blender test was very useful. And you were right, there was a bug in mrv2 regarding saturation on YUV420P movies which I missed, as I had tested mainly with YUV422P and YUV444P.

Anyway, here's new Windows builds for you to test:

.exe: https://mega.nz/file/DOJk3CoD#cU0siGGUbzaobonZ0c-lK6YVhHvoiKI4dMJlpi7Znlw

.zip: https://mega.nz/file/SCID2S4L#cvo5pjzBoaS130n6CiN1v8G5bAb_4wHxHLQ6D6HepS8

ggarra13 commented 3 months ago

One thing I should mention. In mrv2 you can compare the .png and .mp4 with a Wipe to test it. The match won't be 100% perfect as the RGB->YUV conversion looses some precision (the Red for example won't match perfectly).

Thane5 commented 3 months ago

The hue already looks spot on, but i can still see a slightly increased saturation in your test build (again compared to the same PNG image). colorswtf2

ggarra13 commented 3 months ago

I agree. I am still not convinced we are 100% correct. Something may still be wrong. I got derailed with a horrible Linux bug in v1.1.6, which I am ashamed of. Let me keep looking into it.

ggarra13 commented 3 months ago

I verified we are indeed as good as we can get with YUV420 and RGB. Note that mrv2 v1.1.7 will NOT match the (incorrect) look of such movies on any of these players (all of which I tested):

You will NOT get a better match to RGB PNGs as YUV420 looses information of chroma. You can get better matches if you encode YUV422 or YUV444. But to get a perfect match you need to encode also with, I think, at least 12 bits (or maybe 16bits) of precision (or a movie codec with RGB of course).

The reason for mrv2's doing a better job at matching the colors comes from Sam Richards' Encoding guidelines done as part of the ASWF's Open Review Initiative. Sam also mentioned that one player that may be doing color right is:

But I could not verify that as there's no free version available. And indeed Google and macOS Safari also do color right like mrv2.

PD: Thane5, since you took so much time to help out (and I still remember from the mrViewer days), I would like to add you as one of the contributors to mrv2. If you want, please provide me with your name (and email if you care to do, too). You can send it privately to ggarra13@gmail.com.

ggarra13 commented 3 months ago

@Thane5 I looked into the issue more and found another bug in mrv2's color pipeline. Can you please download the latest beta at:

https://sourceforge.net/projects/mrv2/files/beta/

I think we are now matching your png, which I just realized you might have taken directly from a render.

Thane5 commented 3 months ago

Looks exactly like the PNG to my eyes.

ggarra13 commented 3 months ago

Fixed in v1.1.7. Closing the issue.