Resolving vertically flipped images from webcams in Ubuntu
UPDATE 2: I strongly recommend against using this patch any more and relaying on the solution provided by UPDATE 1.
UPDATE 1: Please check the solution from here as it represents the correct approach for fixing this problem in Ubuntu (all releases). Also, the patch from this post doesn’t work for the kernel included in Ubuntu 9.10.
Usually I do not use my laptop’s webcam. Not that I use another webcam. But when I made the radical switch from Windows to Ubuntu, I was disappointed to see that the images from my webcam were vertically flipped and I had no option of turning them 180°. The almost mythical explanation is that somehow some of the webcams mounted on laptops were mounted flipped and the producers have corrected this by pushing the repairs into the Windows drivers. Today luck seemed to be on my side as I have found a patch that now fixes my problem. To correctly apply it in Ubuntu 9.04 you have to browse that topic until the 12th page and check this post.
Because some of you might not correctly apply the patch, I have built a script that will help you patch the uvcvideo module in order to get the right images from your webcam. There are two patches available (I have chosen only the patches that provide a non-mirrored image) so pick the one that gives you the best image. To be able to compare them you must apply both patches, testing your webcam after each of them and then, for the third time, apply the patch that suites your needs.
To test your webcam, you can use VLC.
Here’s the short how to:
- install VLC if you do not have it:
- download my script from here (right click, Save link as…) and make it executable:
- make sure you have the
build-essentialpackage: - run the script with super-user privileges from where you have downloaded it, providing the right options:
sudo apt-get install vlc
chmod +x flip_webcam
sudo apt-get install build-essential
This script must be run with super-user privileges.
Usage: ./flip_webcam {OPTION}
1 this applies patch1 file
2 this applies patch2 file
-h, --help displays this beautiful help section
The script will automatically download the needed files, will apply the patch and then it will push the module into your kernel. Do the tests by opening VLC and then following these steps:
- go to Media
- then go to Open capture device…
- in the pop-up window that opens, in the “Video device name” text field, insert
/dev/video0 - click on Play
Remember to run the script whenever your kernel changes. If everything worked okay, drop a Kudos line to me in the comments. ![]()
Similar Posts:
- Flipped images from your webcam in Ubuntu?
- How to install VMware Server 2.0.x on Ubuntu 9.10 Karmic Koala
- How to install VMware Server 2.0.1 on Ubuntu 9.04 Jaunty Jackalope
- How to install VMware Server on 2.6.31 kernels
- How to install VMware Server 2.0.2 on Ubuntu 9.04 Jaunty Jackalope
40 Comments
1 2 3 4 » 1 2 3 4 »Leave a comment
Secure your files
Recent Posts
Recent Comments
Radu said:
I think you have a corrupted archive. Try to download it again. more»
Ronny Ko said:
I have a gigabit Dlink card ( D-Link System Inc DGE-530T Gigabit Ethernet Adapter (rev 11) (rev 11)). When I first run... more»
al.zatv said:
Calin, thank you for your info. web face for virtualbox is the thing i was looking for. more»
djrise said:
Hi and thank you for your job, I have downloaded the script but when i execute them it said : sh vmware-server-2.0.x-kernel-... more»
Xr said:
Disabling vmci in the web access solved it: Select the VM–>ConfigurationR 11;>Advanced–>Conf iguration... more»
Recent Tweets
- jQuery .click() and the double submit of a form - http://bit.ly/dcCGqR [#]







Thanks a lot, it’s working
Sweet man, thanks! worked perfectly!
I’m really glad i found this
Thanks, but I try to fix this problem in pardus -linux
both of ./flip_webcam1 and 2 can not solve this flip problem.
the end of building windows is:
Loading the module into your kernel…
./flip_webcam: line 36: modprobe: command not found
Housekeeping…
Done!
is it error..??
Hi Unal! Yes, it’s an error… Try installing
modeprobefirst. It’s very interesting why this program isn’t already installed in your system.Hey it took a couple of times doing it to get it to work but after following the directions again it now works. Thanks alot.
Hi Darkzeus, can you please provide more details? I mean if it’s something that I can improve in the script please tell me. By the way, you are welcome! It’s my way of helping the open-source community by giving something in return.
Brilliant! Took a while to download but worked like a charm.
[...] webcam fonctionne dès la première utilisation mais l'image est retournée, la solution vient de ce site et m'a été rapportée par edlapoignee du forum [...]
this works great !! I’ve been trying to do this for a long time. thank you very much.
You are welcome, Burak!
Great!!
Just works fine entered the command, waited and now the image in the right orientation.
While waiting for completion of the compilation, I continued browsing your blog: Nice Job you do. Felicitations!!
Thank you, Christoph!
No-one except me seems to have this prob, at least i couldnt find anything, but my webcam is not working AT ALL! and i cant find it in my hw-config either. can anyone help? or does anyone know any forum where this was discussed or any ideas what i could put in google to find something?
ba2toot, what is the output of
lsusbon your system? I get this on the first line:Does your webcam fail to function only in Ubuntu (Linux)?