GNOME Bugzilla – Bug 743716
A bug in 'videomaterial.cpp' and 'openglsurfacepainter.cpp' causes incorrect colors
Last modified: 2018-05-04 11:13:01 UTC
Colors for the following formats appear to be swapped in the selection for the matrix corrections in both of theses files: case GST_VIDEO_COLOR_MATRIX_BT709: m_colorMatrix *= QMatrix4x4( 1.164, 0.000, 1.793, -0.5727, 1.164, -0.534, -0.213, 0.3007, 1.164, 2.115, 0.000, -1.1302, 0.0, 0.000, 0.000, 1.0000); break; case GST_VIDEO_COLOR_MATRIX_BT601: m_colorMatrix *= QMatrix4x4( 1.164, 0.000, 1.596, -0.8708, 1.164, -0.392, -0.813, 0.5296, 1.164, 2.017, 0.000, -1.081, 0.0, 0.000, 0.000, 1.0000); Colors are correct when these are swapped like this: case GST_VIDEO_COLOR_MATRIX_BT601: m_colorMatrix *= QMatrix4x4( 1.164, 0.000, 1.793, -0.5727, 1.164, -0.534, -0.213, 0.3007, 1.164, 2.115, 0.000, -1.1302, 0.0, 0.000, 0.000, 1.0000); break; case GST_VIDEO_COLOR_MATRIX_BT709: m_colorMatrix *= QMatrix4x4( 1.164, 0.000, 1.596, -0.8708, 1.164, -0.392, -0.813, 0.5296, 1.164, 2.017, 0.000, -1.081, 0.0, 0.000, 0.000, 1.0000);
*** Bug 740614 has been marked as a duplicate of this bug. ***
Not correct matrix (BT709) http://www.mathworks.com/help/vision/ref/colorspaceconversion.html Use conversion specified by = Rec. 709 (HDTV) 1.16438356 0 1.79274107 1.16438356 -0.21324861 -0.53290933 1.16438356 2.11240179 0 Correct matrix: case GST_VIDEO_COLOR_MATRIX_BT709: m_colorMatrix *= QMatrix4x4( 1.164, 0.000, 1.793, -0.969, 1.164, -0.213, -0.533, 0.300, 1.164, 2.112, 0.000, -1.129, 0.0, 0.000, 0.000, 1.0000); break;
Created attachment 345749 [details] [review] fixes wrong values for BT709 color matrix
I can confirm this bug. Changes from Vadim Kuznecov fixes this issue. I've attached patch that I used to apply on top of 1.2.0.
Created attachment 350616 [details] [review] Fix of red artifact in qt5glvideosink I had to modify the patch a bit to solve my problem.
Pushed. commit 91c9011e901ccd713e225ac85b4c46e1689b98ce Author: Toon Heyrman <toonheyrman@hotmail.com> Date: Thu Apr 27 16:49:24 2017 +0200 qt5glvideosink: fix of too much red value in video The red value was too much in the video when using qt5glvideosink. This was caused by a wrong color matrix. https://bugzilla.gnome.org/show_bug.cgi?id=781816