GNOME Bugzilla – Bug 587443
gstffmpegcodecmap.c: fix to RGB24->I420 wrong color / endian problem
Last modified: 2010-04-13 18:36:06 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;
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.
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!