This blog post a guide for using a webcam with Ubuntu.
Webcams are used for both business and personal use. In the business world webcam technology is especially useful for remote workers or freelancers. Webcams on Linux isn’t always a smooth process and this guide helps inform users of hurdles, resolves a few problems and advises you of the best way forward.
Choosing a webcam
If you don’t already own a webcam and wish to use one with Ubuntu, it is a good idea to buy a webcam which is a) created within the last two years b) already proven to work with Ubuntu c) doesn’t have a low image / video quality problem on Ubuntu.
Low quality video from webcam on Linux
Unfortunately it many instances you won’t be able to improve the video quality, especially for older webcams. If you open a linux application such as ‘Cheese’, you can change the resolution, but often you will find for older webcams, especially those aimed original purely at the Microsoft Windows market, the quality will be found wanting. This includes both the pixel size and the frames per second.
It isn’t unusually for a webcam that worked extremely well on Microsoft Windows, to not produce great quality in Ubuntu. Often this is because the drivers had to be backwards engineered by the linux community. We are not suggesting this is the situation in all cases, but it is in many.
How to improve the quality of a webcam video stream
Already we’ve mentioned running ‘Cheese’ to help you tweak your configuration. Another method to improve webcam quality is to improve its environment.Another piece of software you can use is called ‘Camorama’, but we suggest you try ‘cheese’ first.
Making sure there is more natural light around a webcam will help, plus at night having a main light on, rather than a small lamp could provide the extra light required. Plus many webcams have ‘nozzles’ that can be turned to improve the sharpness.
Does my webcam need a microphone?
As far as we are aware most webcams do not have microphones, but instead you rely on the microphone port of a soundcard or onboard sound port of a motherboard.
How can I take a photo with a webcam?
You can accomplish this with the camorama or cheese software. If your webcam can’t stream video via Skype at a higher resolution, you might find you can still take pictures from the webcam using the cheese software at a higher resolution.
Above is an image of the ‘Cheese’ software with a photo already captured. Please note the three small icons below the main video stream on the left. The middle of these three icons is an option to record video and audio.
How can I record a video clip with a webcam?
You can record video from a webcam by using an application such as ‘cheese’. but during testing on an older computer the video stream halted and there was no smooth video recording, whilst the audio was smooth and fine. This possibly was down to the computer specification used. i.e. not powerful enough. You might have to experiment with lower video resolutions to see if you can improve the recording, if you do experience problems.
How can I change my webcam’s resolution?
Again you can change your resolution in the cheese software. If you webcam software starts crashing with the changed webcam resolution, you should change it back. However the cheese software will probably then crash also, but you hopefully will have a few seconds to quickly make the change from the ‘preferences’ option from the ‘edit’ menu option.
My webcam doesn’t run in Skype!
Often when people use Skype they find the webcam video either doesn’t work or crashes after a short time during a Skype video call. The below advice should hopefully help you resolve these problems.
Step 1 – Ubuntu Restricted Extras.
The first step should be to install the ‘Ubuntu Restricted Extras’, if you are using Kubuntu or Xubuntu, please install the restricted extras for those distributions.
Step 2 – Running Skype from a terminal window.
If your webcam video appears blank in Skype, please follow the advice below. To test and use the webcam in Skype you will need to modify the commands used to call the application, enabling it to use ‘video 4 linux’. Once you are up and running you may wish to modify the startup command, so that you don’t have to use a terminal window each time!
On Ubuntu 11.04 and other variations of the Ubuntu distributions such as Xubuntu, you need to use the command env LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype via a terminal window.
However on Ubuntu 11.10 this results in an ERROR: ld.so: object ‘/usr/lib/libv4l1/v4l1compat.so’ from LD_PRELOAD cannot be preloaded: ignored. message.
On Ubuntu 11.10 you need to use the terminal command LD_PRELOAD=/usr/lib/i386-linux-gnu/libv4l/v4l1compat.so skype to call the video 4 Linux functionality for Skype.
If your webcam keeps crashing you may see an error: libv4l2: error allocating conversion buffer . However if you reduce your webcam resolution using the ‘cheese’ software, hopefully your webcam will continue to work in Skype, rather than Skype simply crashing.
If you see an error Gtk-WARNING **: Unable to locate theme engine in module_path: “pixmap”, then you might need to install gtk2-engines-pixbuf.