Opened 4 years ago

Closed 4 years ago

#140 closed defect (fixed)

Colors Messed Up on Webcam

Reported by: lumpy211 Owned by: vadim
Priority: minor Milestone: QuteCom 2.2-RC2
Component: misc Version: 2.2-RC3
Keywords: Cc:

Description

I'm using the latest Qutecom from the mercurial respository in Arch Linux as of writing (2.2 RC3-426). The webcam I'm using uses V4L2, and looks and works fine in other applications such as Skype and Cheese. lsusb outputs the following info:

Bus 002 Device 003: ID 05a9:2640 OmniVision? Technologies, Inc. OV2640 Webcam

The colors for the test display are messed up - I'm purple and the background looks greenish (see attachment). From what I can tell it's just a palette issue - http://www.mail-archive.com/qutecom-dev@lists.qutecom.org/msg01589.html reports a similar issue for OS X, but I can't find the files to apply the patch to in Arch. Any help would be appreciated. If there's any more info needed, just say the word.

Attachments (3)

colors.png (138.9 KB) - added by lumpy211 4 years ago.
Color palette's all wrong
video.patch (967 bytes) - added by laurent 4 years ago.
colors2.png (132.6 KB) - added by christian_bay 4 years ago.
Wrong colors, the glue-stick should be red, the wall in my back is orange.

Download all attachments as: .zip

Change History (10)

Changed 4 years ago by lumpy211

Color palette's all wrong

Changed 4 years ago by laurent

comment:1 Changed 4 years ago by laurent

Can you try this patch ?

comment:2 Changed 4 years ago by lumpy211

  • Resolution set to fixed
  • Status changed from new to closed

Haha, silly me when I tried to apply that patch originally I was in the build directory. No wonder I couldn't find the file specified in the patch :o)

I applied it and recompiled and it works great. Thanks for your help Laurent.

Changed 4 years ago by christian_bay

Wrong colors, the glue-stick should be red, the wall in my back is orange.

comment:3 follow-up: Changed 4 years ago by christian_bay

  • Resolution fixed deleted
  • Status changed from closed to reopened

I have a very similar issue with my webcam.
lsusb output:
Bus 002 Device 002: ID 04f2:b090 Chicony Electronics Co., Ltd (Lenovo EasyCamera?, supported by the in-kernel gspca driver)
Kopete, Linphone-3 and Skype set the correct color palette, unfortunately Qutecom 2.2-rc3 does not. I checked out a today's snapshot (qutecom-2-2-32faa7d90a06) which has the above patch included but the same thing. I am using ffmpeg-0.5_p19928 (gentoo) which names as libavcodec.so.52.35.0. My libavcodec version does not seem to enable the patch, so I changed the define to #if 1 but then the build breaks:

/var/tmp/portage/net-im/qutecom-9999/work/qutecom-9999/libs/pixertool/src/ffmpeg/ffmpeg-pixertool.c: In function ‘pix_ffmpeg_from_pix_osi’:
/var/tmp/portage/net-im/qutecom-9999/work/qutecom-9999/libs/pixertool/src/ffmpeg/ffmpeg-pixertool.c:106: error: ‘PIX_FMT_RGBA32’ undeclared (first use in this function)
/var/tmp/portage/net-im/qutecom-9999/work/qutecom-9999/libs/pixertool/src/ffmpeg/ffmpeg-pixertool.c:106: error: (Each undeclared identifier is reported only once
/var/tmp/portage/net-im/qutecom-9999/work/qutecom-9999/libs/pixertool/src/ffmpeg/ffmpeg-pixertool.c:106: error: for each function it appears in.)
make[2]: * [libs/pixertool/CMakeFiles/pixertool.dir/src/ffmpeg/ffmpeg-pixertool.o] Error 1
make[1]:
* [libs/pixertool/CMakeFiles/pixertool.dir/all] Error 2

Thatswhy the palette could perhaps be another one as in the issue above, see my attached screenshot. The colors are correctly transfered by Qutecom, in videocalls the called can see the right colors. I am on amd64.

comment:4 in reply to: ↑ 3 Changed 4 years ago by laurent

Replying to christian_bay:

I am using ffmpeg-0.5_p19928 (gentoo) which names as libavcodec.so.52.35.0. My libavcodec version does not seem to enable the patch

Strange, what is the contents of avutil.h ?

so I changed the define to #if 1 but then the build breaks:

It is not a good idea ... I'm not sure but maybe your av... includes are not synced with libavcodec.so version ?

comment:5 follow-up: Changed 4 years ago by christian_bay

equery belongs /usr/include/libavutil/avutil.h
[ Searching for file(s) /usr/include/libavutil/avutil.h in *... ]
media-video/ffmpeg-0.5_p19928 (/usr/include/libavutil/avutil.h)

so this looks good.

avutil.h

/*

  • copyright (c) 2006 Michael Niedermayer <michaelni@…> *
  • This file is part of FFmpeg. *
  • FFmpeg is free software; you can redistribute it and/or
  • modify it under the terms of the GNU Lesser General Public
  • License as published by the Free Software Foundation; either
  • version 2.1 of the License, or (at your option) any later version. *
  • FFmpeg is distributed in the hope that it will be useful,
  • but WITHOUT ANY WARRANTY; without even the implied warranty of
  • MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  • Lesser General Public License for more details. *
  • You should have received a copy of the GNU Lesser General Public
  • License along with FFmpeg; if not, write to the Free Software
  • Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */

#ifndef AVUTIL_AVUTIL_H
#define AVUTIL_AVUTIL_H

/

  • @file libavutil/avutil.h
  • external API header */

#define AV_STRINGIFY(s) AV_TOSTRING(s)
#define AV_TOSTRING(s) #s

#define AV_VERSION_INT(a, b, c) (a<<16 | b<<8 | c)
#define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c
#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)

#define LIBAVUTIL_VERSION_MAJOR 50
#define LIBAVUTIL_VERSION_MINOR 3
#define LIBAVUTIL_VERSION_MICRO 0

#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \

LIBAVUTIL_VERSION_MINOR, \
LIBAVUTIL_VERSION_MICRO)

#define LIBAVUTIL_VERSION AV_VERSION(LIBAVUTIL_VERSION_MAJOR, \

LIBAVUTIL_VERSION_MINOR, \
LIBAVUTIL_VERSION_MICRO)

#define LIBAVUTIL_BUILD LIBAVUTIL_VERSION_INT

#define LIBAVUTIL_IDENT "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION)

/

  • Returns the LIBAVUTIL_VERSION_INT constant. */

unsigned avutil_version(void);

#include "common.h"
#include "mathematics.h"
#include "rational.h"
#include "intfloat_readwrite.h"
#include "log.h"
#include "pixfmt.h"

#endif /* AVUTIL_AVUTIL_H */

comment:6 in reply to: ↑ 5 Changed 4 years ago by laurent

Replying to christian_bay:

so this looks good.

I agree.

I think that the color inversion comes from a BGR <=> RGB problem ...

So first, can you try to adapt this patch !

diff -r 5f4b61bd9d6e libs/pixertool/src/ffmpeg/ffmpeg-pixertool.c
--- a/libs/pixertool/src/ffmpeg/ffmpeg-pixertool.c Tue Jun 16 03:31:26 2009 +0200
+++ b/libs/pixertool/src/ffmpeg/ffmpeg-pixertool.c Tue Jun 16 20:15:28 2009 +0200
@@ -53,9 +53,15 @@

case PIX_FMT_RGB565:

palette = PIX_OSI_RGB565;
break;

+#if LIBAVUTIL_VERSION_INT < (50<<16)

case PIX_FMT_RGBA:

palette = PIX_OSI_RGBA32;
break;

+#else
+ case PIX_FMT_BGRA:
+ palette = PIX_OSI_RGBA32;
+ break;
+#endif

case PIX_FMT_YUV420P:

palette = PIX_OSI_YUV420P;
break;

@@ -98,7 +104,11 @@

case PIX_OSI_ARGB32:
case PIX_OSI_RGB32:
case PIX_OSI_RGBA32:

+#if LIBAVUTIL_VERSION_INT < (50<<16)

palette = PIX_FMT_RGBA;

+#else
+ palette = PIX_FMT_BGRA;
+#endif

break;

case PIX_OSI_YUV420P:

palette = PIX_FMT_YUV420P;

comment:7 Changed 4 years ago by christian_bay

  • Resolution set to fixed
  • Status changed from reopened to closed

You're great! It works! Thank you very much for the incredibly fast support!
But I still get this warning of V4L2WebcamDriver::setPalette():

(warn) 13:55:17 [Common] virtual WebcamErrorCode? V4L2WebcamDriver::setPalette(pixosi): Failed settings pixel format.

Note: See TracTickets for help on using tickets.