Fix the upside down on uvc webcams

Hi everybody,
it's a very quick how-to that will help you to solve the problem of those webcams who give back upside-down images/videos!!!
This help is intended only for those who have a UVC capable webcam.
But it will be usefull only if your webcam supports YUV image format and the applications that use your webcam request YUV format to your webcam!!! I've tested it and it works with:
skype, amsn, kopete, luvcview, mplayer!!

So...let's start!!!!

In order to know if your webcam is UVC capable you just need to open your shell and run:
Code:
lsusb

you will get something like this:
Quote:
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 002: ID xxxx:yyyy "Your_Webcam_Model"
Bus 001 Device 001: ID 0000:0000
Then type:
Code:
sudo lsusb -d xxxx:yyyy -v | grep "14 Video"

If you get something like the following, your webcam is UVC capable:
Quote:
bFunctionClass 14 Video
bInterfaceClass 14 Video
bInterfaceClass 14 Video
bInterfaceClass 14 Video

If your webcam passes this test, you can go on reading. Otherwise, your camera needs to use propertary driver, because it doesn't use standard protocol/command.

Well,
now you need to donwload the UVCVIDEO driver sources, but they are on a SVN repository, so you need to install the SVN client:
Code:
sudo apt-get install subversion
and now you can download the sources:
Code:
svn checkout svn://svn.berlios.de/linux-uvc/linux-uvc/trunk

The sources will be saved into a folder called "Trunk" in the path from where you run the previous command.

Next, you need to use a patch to update your clean uvcvideo driver. Please download this.

Then proceed..

Code:
patch < patch_solution1_mirrored.patch
Well, now the worst part has been done!!!
We just need to compile our modded file and to install the new driver, so from shell you have to go to the "Trunk" directory and type:
Code:
make
there shouldn't be errors!!

Then, ONLY if you are using one of the Ubuntu distributions (ubuntu, kubuntu, etc.), open with you editor the "Makefile" and change the following line:
Code:
INSTALL_MOD_DIR := usb/media
with
Code:
INSTALL_MOD_DIR := ubuntu/media/usbvideo
Now we just need to remove uvcvideo module (if you have previously installed it):
Code:
sudo modprobe -r uvcvideo
Then:
Code:
sudo make install
sudo modprobe uvcvideo
Now everything should work!!!

Let me know!!

Labels: