libcvd-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libcvd-members] Problems with V4L2 and gspca driver


From: E. Rosten
Subject: Re: [libcvd-members] Problems with V4L2 and gspca driver
Date: Mon, 17 Aug 2009 17:33:07 +0100 (BST)
User-agent: Alpine 2.00 (LSU 1167 2008-08-23)

On Sun, 16 Aug 2009, Daniel Tabares Fernaud wrote:

Hi
Fist of all, sorry for my english

I have a problem using V4l2 cameras.

I have two Creative WebCam Vista (lsusb ID 041e:405f).
When I used Ubuntu 8.04, i haven't problems using v4l1 and ov51x-jpeg driver. 
But this driver actually haven't support for Ubuntu 9.04 kernel (2.6.28-11. 
Actually, I use this distribution, and I use the gspca driver, ov519 module 
(http://linuxtv.org). The driver works well in most applicatons (cheese, for
example), but in the example application included in libcvd, 
"video_play_source", executed with the following parameters:

./video_play_source v4l2:[verbose]///dev/video0

its output shows:

V4L2Client: verbose operation. Initializing
V4L2Client: Querying capabilities.
V4L2Client:    driver: ov519
V4L2Client:    card: Creative WebCam Vista
V4L2Client:    bus_info: 0000:00:13.3
V4L2Client:    version: 131840
V4L2Client:    capabilities: 0x5000001
V4L2Client:                 V4L2_CAP_VIDEO_CAPTURE        = 1
V4L2Client:                 V4L2_CAP_VIDEO_OUTPUT         = 0
V4L2Client:                 V4L2_CAP_VIDEO_OVERLAY        = 0
V4L2Client:                 V4L2_CAP_VBI_CAPTURE          = 0
V4L2Client:                 V4L2_CAP_VBI_OUTPUT           = 0
V4L2Client:                 V4L2_CAP_SLICED_VBI_CAPTURE   = 0
V4L2Client:                 V4L2_CAP_SLICED_VBI_OUTPUT    = 1
V4L2Client:                 V4L2_CAP_RDS_CAPTURE          = 0
V4L2Client:                 V4L2_CAP_VIDEO_OUTPUT_OVERLAY = 0
V4L2Client:                 V4L2_CAP_TUNER                = 1
V4L2Client:                 V4L2_CAP_AUDIO                = 0
V4L2Client:                 V4L2_CAP_RADIO                = 0
V4L2Client:                 V4L2_CAP_READWRITE            = 1
V4L2Client:                 V4L2_CAP_ASYNCIO              = 0
V4L2Client:                 V4L2_CAP_STREAMING            = 1
V4L2Client: Requested format: RGB3
V4L2Client: Enumerating formats.
V4L2Client:    Index  FourCC     Flags    Description
V4L2Client:        0   JPEG   0x00000001  JPEG
V4L2Client: Selected format: None
V4L2Client: Getting format (VIDIOC_G_FMT)
V4L2Client:    size: 640x480
V4L2Client:    format: JPEG
V4L2Client:    field flag: 1
V4L2Client:    bytes per line: 640
V4L2Client:    image size: 115790
V4L2Client:    colourspace: 7
V4L2Client: Setting format (VIDIOC_S_FMT)
V4L2Client:    size: 640x480
V4L2Client:    format: None
V4L2Client:    field flag: 0
V4L2Client:    bytes per line: 640
V4L2Client:    image size: 115790
V4L2Client:    colourspace: 7
V4L2Client: Getting format (VIDIOC_G_FMT)
V4L2Client:    size: 640x480
V4L2Client:    format: JPEG
V4L2Client:    field flag: 1
V4L2Client:    bytes per line: 640
V4L2Client:    image size: 115790
V4L2Client:    colourspace: 7
Error: V4LBuffer: "V4L2: Requested format not supported" ioctl failed on 
/dev/video1: Invalid argument

The VideoBuffer is VideoBuffer<Rgb<byte>>, and the camera apparently only 
support JPEG format.

Has the problem any solution?

None of the solutions are especially pretty, but you could make it work. At the moment libCVD won't generally do any automatic conversions on live image capture, for efficiency reasons. This has been relaxes a bit recently for cameras which hand back JPEG images (not v4l cameras, though).

The best solution would probably be to hack v4l2 buffer so it will perform JPEG decoding of the image automatically, and return the image data as if it was a RGB or GREY image.

To decode the data, you could just place an istringstream around it and load from the stream with img_load.

-Ed



--
(You can't go wrong with psycho-rats.)(http://mi.eng.cam.ac.uk/~er258)

/d{def}def/f{/Times s selectfont}d/s{11}d/r{roll}d f 2/m{moveto}d -1
r 230 350 m 0 1 179{ 1 index show 88 rotate 4 mul 0 rmoveto}for/s 12
    d f pop 235 420 translate 0 0 moveto 1 2 scale show showpage

reply via email to

[Prev in Thread] Current Thread [Next in Thread]