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 587443 - gstffmpegcodecmap.c: fix to RGB24->I420 wrong color / endian problem
gstffmpegcodecmap.c: fix to RGB24->I420 wrong color / endian problem
Status: RESOLVED INCOMPLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.23
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-06-30 16:51 UTC by Harry Coin
Modified: 2010-04-13 18:36 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement



Description Harry Coin 2009-06-30 16:51:50 UTC
A webcam producing RGB24 was verified to produce accurate snapshots.  However outputting through ffmpegcolorspace to xvimagesink suffered wrong colors / bad colors , specifically blue / red reversal as it gets converted to I420 colorspace.   For instance:

gst-launch-0.10 -v v4lsrc device=/dev/video1 !  video/x-raw-rgb,width=640,height=480,bpp=24 !  ffmpegcolorspace ! xvimagesink 

on little endian machines would always produce accurate images except for red / blue being swapped.  I noticed this first on Debian lenny and also in Debian testing / squeeze

This fix corrects the issue.

--- gstffmpegcodecmap.c	2009-04-01 06:49:11.000000000 -0500
+++ /home/library/dvl/slidesaver/gstffmpegcodecmap.c	2009-06-30 11:21:06.000000000 -0500
@@ -695,7 +695,11 @@
             }
             break;
           case 24:
+#if (G_BYTE_ORDER == G_BIG_ENDIAN)
             if (rmask == 0x0000FF)
+#else
+            if (rmask == 0xFF0000)
+#endif
               context->pix_fmt = PIX_FMT_BGR24;
             else
               context->pix_fmt = PIX_FMT_RGB24;
Comment 1 Wim Taymans 2009-12-11 12:18:26 UTC
Can you make a file like this:

gst-launch-0.10 -v v4lsrc device=/dev/video1 num-buffers=10 ! video/x-raw-rgb,width=640,height=480,bpp=24 ! gdppay ! filesink location=out.gdp

Then attach out.gdp to this bugreport.
Comment 2 Tobias Mueller 2010-04-13 18:36:06 UTC
Harry, I'm closing this bug report as no further information has been provided. Please feel free to reopen this bug if you can provide the information asked for.
Thanks!