pwc
[Top] [All Lists]

Re: [pwc] Using v4l2 gives grey images

To: Philips Webcam Linux Driver <>
Subject: Re: [pwc] Using v4l2 gives grey images
From: Luc Saillard <>
Date: Thu, 30 Jun 2005 09:00:49 +0200
On Wed, Jun 29, 2005 at 05:01:33PM -0700, Niclas Anderberg wrote:
> I am trying to use the latest driver version (10.0.7a) using v4l2. I 
> have written my own sample app which reads frames from the camera and 
> writes jpeg images.

No the format is the YUV420 Planar mode. So you have all Y value, then all U
value then all V value. To get pointer to Y, it's the begin of the buffer, to
get the pointer to U, you add the size of the image (640*480), to get the
pointer to V, you add the size of the image(640x480) and size of the image/2.
Because U and V is coded with half bit than Y.
I don't know if i'm clear, but here a little code to show how to calculate
offset

                n = width * height;
                
                /* offset in Y plane */
                pout_planar_y = dst;
                
                /* offsets in U/V planes */
                pout_planar_u = dst + n;
                pout_planar_v = dst + n + n / 4;

> If I use an app like camE (which I assume uses v4l and v4l2) I get color 
> fine. Is there a restriction in the v4l2 driver that I don't know about? 
>    Does anyone have some simple sample code which gives you color 
> images? Any other ideas?
 
You can use this little app (modified) from the V4L2 API documentation.

Luc

Attachment: capture.c
Description: Text Data

_______________________________________________
pwc mailing list

http://lists.saillard.org/mailman/listinfo/pwc
<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU