Quoted Laurent Pinchart <[EMAIL PROTECTED]>:

> Hi Raúl,
>
> On Sunday 24 February 2008, Raúl Sánchez Siles wrote:
>>   Hello All:
>>
>>   I own a laptop with a webcam supported by the uvc driver. I can use it
>> for videoconference successfully but I fail to take an single jpg photo. I
>> use luvcview 0.2.1 in order to have it, with no success.
>>
>>   I have just built the latest svn driver (r188), with same result. I'm on
>> a Debian unstable distro using 2.6.24.2 for and Core2 Duo laptop. This is
>> the output of luvcview:
>>
>> luvcview version 0.2.1
>> Video driver: x11
>> A window manager is available
>> video /dev/video0
>> Unable to set format: 22.
>>  Init v4L2 failed !! exit fatal
>>
>>   Same result for luvcview -w, -c, -C and -S . -g fails since direct I/O is
>> not supported.
>>
>>   What does this message mean? Is there a way I could get a simple
>> screenshot using the driver. Pointers are appreciated.
>>
>>   Only -f yuv worked, but well, what about the others?
>
> Your camera supports YUV only, so there is no other format :-)

What you may be able to do is use the mjpg-streamer project's  
uvc_stream.  The only problem I've had is writing a suitable program  
to work with its somewhat bizarre MJPEG format.  Mozilla Firefox will  
display the JPEG frames, although with some bugs, so I wrote my own  
viewer.  My viewer supports Linux and Win32.  I just share the viewer  
program with my friends so that they can connect to the MJPEG stream.

I also have a small patch to uvc_stream that seems to be useful.
$ svn diff uvc_stream.c
Index: uvc_stream.c
===================================================================
--- uvc_stream.c        (revision 56)
+++ uvc_stream.c        (working copy)
@@ -460,8 +460,11 @@

    /* create a child for every client that connects */
    while ( 1 ) {
+    struct sockaddr_in saddr;
+    socklen_t slen = sizeof (saddr);
      int *pfd = (int *)calloc(1, sizeof(int));
-    *pfd = accept(sd, 0, 0);
+    *pfd = accept(sd, (struct sockaddr *)&saddr, &slen);
+    fprintf (stderr, "accept %s\n", inet_ntoa (saddr.sin_addr));
      pthread_create(&client, NULL, &client_thread, pfd);
      pthread_detach(client);


If desired I could clean it up a bit (it's only ~100 lines of code),  
and add a grab option to save individual frames.  It uses code from my  
project called megapkg, specifically the megaimage, jpegext2, and ntk  
extensions to Tcl.

By the way, how difficult would it be to add a read() interface to the  
uvc driver?  Is there something that makes that inherently difficult  
that the hardware imposes?


George
-- 
http://www.xmission.com/~georgeps/  http://whim.linuxsys.net
http://code.google.com/p/megapkg/   http://code.google.com/p/opennexx/

_______________________________________________
Linux-uvc-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel

Reply via email to