The video application for USB web cams is supported mainly by 
1) uvc driver (found in source/open-src/OS/linux-kernel/2.6.8.1/drivers/usb/media/uvc and)
2) uvccapture (found in source/open-src/applications/uvccapture)


Before Compilation
====================

To support the uvc driver support for the kernel,
the Makefile and the kconfig files have been modified in /source/open-src/OS/linux-kernel/2.6.8.1/drivers/usb/media
and the Makefile of /source/open-src/OS/linux-kernel/2.6.8.1/drivers/usb/

One has to enable the following options in the menuconfig for enabling the Video support on Linux

/source/open-src/OS/linux-kernel/2.6.8.1/make ARCH=arm menuconfig

(assuming that the USB host support is already enabled)

Multimedia devices  --->
------------------------
1) Video For Linux                - Compulsory
USB support  --->
--------------------
2) USB UVC support (EXPERIMENTAL) - Compulsory
3) USB Mass Storage support       - Optional  ( in case you wish to store the video in some USB mass storage device)

Modifications in the makefile present in /source/makefile
enable UVCCAPTURE and CUPS Compilation by selecting them (selection is done by changing the n option to y)

CONFIG_UVCCAPTURE=y
CONFIG_CUPS=y

CUPS is mainly for the HTTPD and has no other relevance to USB Video.

Compilation
============
Issue a top level make to make a complete product


Execution  - 
============
BOARD SIDE
===========

Start the CUPSD by issuing the following commands

# startbsp
# ifconfig eth1 10.0.0.102 up
# ifconfig lo 127.0.0.1 up
# cupsd -F &


Make sure the video cam is connected to the USB hub or port of the Board.
(Currently the application is tested for High speed Cameras supporting MJPEG format)

create a device entry in the /dev directry

# mknod /dev/video0 c 81 0

Change the current working directory to 

# cd /usr/share/doc/cups/

We need to create a Directry where we can write files, as the filesystem 
is on flash the read/write operation would be very slow.
We can mount an external USB driver or the RAMFS

The below example is on a RAMFS Mount. In case a USB mass storage is to be used,
the mass storage device can be mounted 

# mkdir MOUNT
# mount -t tmpfs none ./MOUNT
# cp /bin/live_view.html .

execute the uvccapture utility by typing

/usr/share/doc/cups/MOUNT/ # uvccapture &

This will create two files
1) snap.jpg 
2) snap1.jpg

snap.jpg is the one which would be used for streaming

To save a video file for later use
/usr/share/doc/cups/MOUNT/ # uvccapture -m/<path of the mounted USB drive>/<filename> &

by default the video file will be created in the working directory under the name video.avi















************************************************************************************************
uvccapture: USB UVC Video Class Snapshot Software
Newest versions always available at http://staticwave.ca/source/uvccapture

This software is based of the package luvcview:
Copyright (C) 2005 2006 Laurent Pinchart &&  Michel Xhaard

Modifications and updates:
Copyright (C) 2006  Gabriel A. Devenyi <ace@staticwave.ca>

This program communicates via the USB UVC Video Class driver for V4L2, available
at http://linux-uvc.berlios.de/.

The purpose of this software is to capture an image from a USB webcam at a
specified interval, and save it to a JPEG file, no other formats are supported,
imagemagick can handle anything else you might need.

Right now this software is really a hack, since still image support is not yet
available in the UVC driver. The program continually polls the UVC driver in
MJPEG mode, and at a specified interval writes a JPEG header and a single frame
to file, creating a JPEG image. Because of this continuous polling, this program
has high CPU usage. Input checking is pretty trusting, so call it with the right
parameters.

In order for this software to work, whatever device you pass to -d you will need
to have read/write rights to, please see appropriate /dev documentation for how
to do this.

This software depends on jpeglib(present on almost all systems)

For usage information, run uvccapture -h
