Monday, October 12, 2015

HOWTO Fix Webcam (dark) Problem In Skype

If you have a webcam that does not work correctly in Skype (for example, the image it's dark) but it works fine other apps like Cheese, you might want to check this out:

1. Install libv4l-0
ximena@ximunix:~$ sudo apt-get install libv4l-0

2. Now we need to edit the file "skype.desktop" so we can pre-load libv4l-0 with Skype.

ximena@ximunix:~$ sudo vi /usr/share/applications/skype.desktop

And replace the line following line:
Exec=skype 
with this new line:
Exec=bash -c 'LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libv4l/v4l1compat.so skype'

This is an example of the file /usr/share/applications/skype.desktop:
[Desktop Entry]
Name=Skype
Comment=Skype Internet Telephony
#Exec=skype %U
Exec=bash -c 'LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libv4l/v4l1compat.so skype'
Icon=skype.png
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Network;Application;
MimeType=x-scheme-handler/skype;
X-KDE-Protocols=skype

Note: please check that in our case, libv4l is located under /usr/lib/x86_64-linux-gnu, but it can be located in another folder, depending on the OS.
To search for the location of the library, just search it quickly by typing:

ximena@ximunix:~$ locate v4l1compat.so
/usr/lib/x86_64-linux-gnu/libv4l/v4l1compat.so
ximena@ximunix:~$ 

Now the camera should work fine and the image should be clear.

Hope it helps! :)