After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 743716 - A bug in 'videomaterial.cpp' and 'openglsurfacepainter.cpp' causes incorrect colors
A bug in 'videomaterial.cpp' and 'openglsurfacepainter.cpp' causes incorrect ...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: qt-gstreamer
1.2.0
Other Windows
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 740614 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-01-29 21:58 UTC by Patrick Duffy
Modified: 2018-05-04 11:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fixes wrong values for BT709 color matrix (1.05 KB, patch)
2017-02-14 18:32 UTC, Martins Mozeiko
none Details | Review
Fix of red artifact in qt5glvideosink (2.33 KB, patch)
2017-04-28 06:35 UTC, toonheyrman
none Details | Review

Description Patrick Duffy 2015-01-29 21:58:00 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);
Comment 1 Tim-Philipp Müller 2016-06-03 22:16:39 UTC
*** Bug 740614 has been marked as a duplicate of this bug. ***
Comment 2 Vadim Kuznecov 2016-09-26 06:09:27 UTC
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;
Comment 3 Martins Mozeiko 2017-02-14 18:32:17 UTC
Created attachment 345749 [details] [review]
fixes wrong values for BT709 color matrix
Comment 4 Martins Mozeiko 2017-02-14 18:32:51 UTC
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.
Comment 5 toonheyrman 2017-04-28 06:35:51 UTC
Created attachment 350616 [details] [review]
Fix of red artifact in qt5glvideosink

I had to modify the patch a bit to solve my problem.
Comment 6 George Kiagiadakis 2018-05-04 11:13:01 UTC
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