RECIPE
Videoconferencing for Linux
Here's all you'll need to know for getting videoconferencing/videophone to work on a Linux desktop.
(URL: )
By A. Lizard
10:11 AM EDT Fri. Jun. 22, 2007
Plugging video into the Linux desktop, whether for a webcam or for use in videoconferencing/videophone, is still something of an adventure. But like most Linux configurations that are still a bit problematic, with the right tour guide, it's almost a walk in the park. This recipe aims to be that guide.
Though videoconferencing/videophone is harder to set up on Linux than it is on Mac or Windows, it's still a useful tool, and an alternative to Vonage and Skype. In general, videoconferencing works best (or at all) when using the same client, including versions running across platforms.
For this recipe, I recommend using a telephone-style headset to work through this piece with. But even then, feedback between a microphone and speakers will be difficult to avoid. You can use headphones if you're using a digi/webcam microphone, but your sound quality will most likely be better with a microphone in a headset assembly.
Though I used the Debian Linux distribution, Ubuntu users should be able to use the same instructions. If you aren't using a Debian-based distribution, you should use the instructions for automated installation (for example, yum install filename for Fedora/RHEL) or the installer GUI that works with your distribution. The program filename should be the same.
Video4Linux (v4l, v4l2 - gspca)
This is the basic building block underlying most Linux video applications.
The first step is selecting a webcam with a Linux driver.
Compatible USB (only) Videocams
You can find a list of cameras with compatible drivers here.
This is a good place to use your Web browser's page search feature—usually, control + F—to look up model names or USB ID codes. My camera is an inexpensive Aiptek DV4100M digicam with "live video" and flash disk storage for digital images and video.
If you have a camera you want to use, but it doesn't seem to appear on the list, plug it in and get a list of all plugged-in USB devices. Assuming it isn't a pure webcam, make sure your camera is set to "live" or "video" mode once your USB cord is plugged into the computer. If you don't have a camera already, use the list to guide you in finding a camera that will work for Linux video without problems.
Note that a
monospace
font means that this is text that should be entered or displayed via Linux terminal application. $ means do this from a user prompt, # means a root (admin) command given from a root login, a user with the root password accesses a root login by:
$ su root
Password:
To discover the USB identification information from your camera:
username@workstation:~$ lsusb
Bus 002 Device 007: ID 08ca:2040 Aiptek International, Inc.
Bus 002 Device 005: ID 050d:0551 Belkin Components
Bus 002 Device 006: ID 04a9:220e Canon, Inc. CanoScan N1240U/LiDE 30
Bus 002 Device 004: ID 04a9:1094 Canon, Inc.
PIXMA iP3000x Printer
The first hex 4-digit number after the ID is the product ID. The second is the vendor. I'd search on product ID. If both numbers match something in the driver list, then you are in business with Linux video. If not, I recommend finding a supported camera. Either a digicam or webcam that's listed should work fine.
With a webcam, make sure it's running in the desired mode—live or disk access—to match videoconferencing or image/video retrieval from camera flash disk.
INSTALLING VIDEO4LINUX
Make sure gnome-desktop-environment (or the equivalent in your distro) is installed. If it isn't and you're using the KDE window manager as your desktop, when you install it, make sure that KDE stays the default window manager.
"Use the Source, Luke!"
If the version installed via your distro's automated installer fails, download the gspca source or, if available, a binary from your distribution from here. I'm not providing instructions for Debian, because this is one of the rare cases when building from source is actually easier. Besides, I never did get gspca-source working, as I would ordinarily install via apt-get.
If you got a source tarball (tarball file extensions are tgz , tar.gz , tar.bz2), then do this:
$ tar xzvf gspca*
$ cd gspca*
$ su root
# make && make install && depmod "ae
If this fails, open the README file in the gspca directory to see what it can tell you. If that doesn't help, go to the Where To Get Help section at the end of this Recipe.
Next, plug in the camera. Make sure that it's in "live" (or Web or video) mode with the USB cord plugged in. Not "picture" or "still" image. Get this wrong, and the camera will think it's supposed to transfer your last batch of still offline images or videos. Don't take for granted that it will stay in the mode you left it in, either. If you got it running and it suddenly fails, check this first.
$ ls /dev/vid*
You should see a video0 file in that directory. If you do, you've got video.
INSTALLING A VIEWER / WEBCAM APP
The Camorama or Camstream viewer/webcam applications are adequate to verify camera operations. Either will automatically upload via FTP to a webpage. You may already have either or both programs preinstalled by default. If not, then:
# aptitude install camorama
or
# aptitude install camstream
Non-Debian/Ubuntu users should use the equivalent automated installer commands for their distribution.
If neither is available, you can download source from these two pages, camorama or camstream.
Download to a convenient directory. For build-from-source applications, the following is the generalized method for building the great majority of applications provided as source code:
...for files ending in tar.gz or tgz:
$ tar xvzf programname.tar.gz
$ cd [top of new directory tree created by unpacking tarball]
...for files ending in bz2:
$ tar xvjf programname.tar.bz2
$ cd [top of new directory tree created by unpacking tarball]
Follow the instructions in the README files after unpacking the tarballs and opening the directories into which the tarballs were unarchived, open as:
$ nano README
Further information should be available on the developer sites, including a pointer to the web forums or mailing lists to ask for help in if need be.
Configuring these things once installed to point them at ftp sites/directories, and frame size, frame rate, and in some cases, choice between V4L and V4L2 is point and click on the GUI. The following figures feature screenshots of the Camorama Webcam Viewer and Controls and the Online Camorama ftp setup respectively:
Displaying a continuously updating webcam image is a server-side operation and therefore beyond the scope of this article. Some website hosts have a built-in setup for this. Otherwise, you'll need to set it up on your Apache or whatever Web server.
HOW TO INSTALL VIDEOCONFERENCING
Every videoconferencing application has its advantages and disadvantages. The only ones I discuss here are cross-platform. Video modes work best (or at all) when the different computers in the connection are all running the same videoconferencing application.
PHONE FORMATS: SIP VS. H.323
The two most common protocols found in the VoIP world are sip and H.323. Basically, H.323 is a telco-oriented protocol maintained by the ITU, and sip is an Internet-oriented protocol maintained by IETF. Most Internet VoIP implements sip. H.323 seems to me to be a standard with declining support in the Internet community. While support of both is preferable, if one has to choose one or the other as an end user, I'd go with sip.
You can find a much more technologically oriented and detailed comparisons here and here.
Linux for Skype: This is a proprietary format with no video support, unlike the Mac/Win products. While it appears to work, it is still not recommended. There's no longer any reason to recommend a product for Linux that doesn't have a feature set as good as that of Win/OSX versions.
Ekiga (formerly gnomemeeting): Ekiga installation and setup works, is relatively easy, fairly well supported, and can easily be connected to the PSTN (Public Switched Telephone Network). That is, you can videoconference computer-to-computer and make phone calls with it, too. It supports both sip and h.323. The instructions provided here will be for sip setup; if you need H.323, you can get setup information from the documentation. It may already be installed. If not, you can probably install it through your distribution's automated installer.
Supported Distros: Fedora Core/RHEL, OpenSUSE, Debian, Ubuntu, Windows, source.
Install Ekiga:
First, see if it's already installed with your distro by checking the menus.
In KDE, find it in Start > Internet > Ekiga
Debian / Ubuntu:
# aptitude install ekiga
To install with other distros, use the automatic installer for your distro to try installing it
You might as well wait to run the configuration utility until after you've set up the firewall and done any router setup necessary. If not, go to the Ekiga download page and if possible, download and manually install the ekiga binary for your distro via distro installation tool. For example, if rpm, # rpm -i ekiga*
.
If there isn't one, build from source. First, download all the source tarballs on the page. Then follow the build-from-source instructions in the Camorama / Camstream section above for each tarball.
Other Libraries Required:
Chose a distro and download here.
In Debian, you can get a list of installable plug-ins by:
# aptitude search libpt
i A libpt-plugins-alsa - Portable Windows Library Audio Plugin for the ALSA Interface
i libpt-plugins-oss - Portable Windows Library Audio Plugins for the OSS interface
i libpt-plugins-v4l - Portable Windows Library Video Plugin for Video4Linux
i libpt-plugins-v4l2 - Portable Windows Library Video Plugin for Video4Linux2
i A libpth20 - The GNU Portable Threads
In the display, i = installed, A=automatically installed (usually to satisfy a dependency.) Bold face indicates the ones I actually installed.
Use the equivalent search feature in your distro's automatic installer. Or download and install the plug-ins manually that you need from the above URL. Your distribution will probably install it automatically. (The ones in bold were the ones I had to install.)
If you need more information, the Ekiga FAQ entry is here.
FIREWALL SETUP
Modern distributions usually use ipchains. You can update the various files that configure ipchains by simply running the script from here in section 6.2 entitled "What iptables rules could I use for GNU/Linux?" Cut and paste the script into the text editor of your choice. Save it as ekiga-iptables-setup.sh anywhere convenient.
Note: Do not run it until you've changed ppp0 in the line
EXTERNAL_DEVICE="ppp0"
...to whatever actually matches your system. Of course, if you're running dialup, ppp0 is probably right. But dial-up users are a shrinking minority. The script should now be running eth0 by default, and it should have a comment line showing what's most likely to be changed. In most cases, you'll want to change that line to eth0 as follows:
EXTERNAL_DEVICE="eth0"
Run it by:
# sh ekiga-iptables-setup.sh
If you don't know what your EXTERNAL_DEVICE is, run:
# ifconfig
Ignore lo, and if you're running VMware Server, all vmnet* entries, it's the connection to the Net you're looking for.
ROUTER SETUP
Go to your router setup page. (Read the instructions. It's usually a webpage accessible via browser.) If it has a setup for H.323, SIP, stun, or videoconferencing, click the checkbox or enable the menu setting, and you're probably done. If it doesn't have the setup, go ahead and start running the Ekiga Configuration Druid.
If you haven't done so already, plug the camera into the USB port. Also, plug in whatever microphone device you plan to use if you don't plan to use the microphone built into the camera.
Open Ekiga from the menu.
top menu > Edit > Configuration Druid
I regard the UserID and related account info screen as self-explanatory.
Click on "Get an Ekiga.net SIP Account". It'll open a Web browser; do the obvious.
Concerning the following two screenshots: Though they're similar in appearance, they do have important differences. Specifically, while both figures are of the fifth frame of the Ekiga videoconferencing setup wizard, the first figure shows "Cone NAT" setup and STUN ready to go (which is correct). The figure after that shows "Symmetric NAT." All of which means you'll have some router setup work to do.
So here's a screenshot of what the Ekiga setup wizard does when you're ready for videoconferencing:
If you see that, then your router is probably configured correctly. Click Yes and Forward. Skip the images showing router configuration here down to Video Codecs. The following figure shows what appears when there's a NAT-detection problem:
If you see this, then your router setup is either incomplete or wrong. "Symmetric" in this context means that the router won't respond to an incoming message unless this port has already been opened from inside the LAN. While that may be a good security practice, it is not so good when you're trying to get an incoming call behind a router that can't hear it.
The following is the setup on my Airport 101 AR420W wireless router. (the "wireless" part is irrelevant here). In general, these routers are set up via a set of Web pages resident within the router accessible via an ordinary browser. For documentation on your specific router, check for the manual that came with it, either on paper or on the disk that came with it. (usually Adobe Acrobat PDF format). Here's a shot of the port forwarding settings:
SIP port forwarding:
ports: 3478-3479 (labeled stun-voip1 above)
ports 5000-5100 (labeled stun-voip1 above)
Here's a screenshot of port range triggering setup:
The port triggering is because the original "Symmetric NAT" test result says that the router won't ordinarily open a port unless a computer on the LAN behind the router first accesses it. So to respond to an incoming request, it has to have ports configured specifically to accept them. This is called port-range triggering.
Set port triggering for:
Ports triggered: 3478-3479
Ports Forwarded: 3478-3479
Ports triggered: 3478-3479
Ports Forwarded: 5000-5100
Hit "Apply," "Enable," or whatever is appropriate for your router. Then repeat the Ekiga Configuration Druid. You should see the image above labeled "correct configuration." Go on to the next step, and select ALSA as the first choice. Here's a shot of the audio driver screen:
The audio device can be any microphone device you can plug into your PC, including microphones plugged into the audio input. In the picture above, I'm using the microphone built into my digicam and getting it via the same USB connection that provides video. If you can't hear anything, check the volume controls. Make sure the appropriate I/Os are switched on and that the input / output volumes are at a reasonable level. If that fails, go back a step and try changing ALSA to OSS.
Next, you'll be asked to select the Video Manager. Pick the one (either V4L or V4L2) that matches your camera type. Try V4L if you don't know. On the next step, select your camera device. Simply pull down the menu below "Please choose your video input device" and select the entry that matches your camera. After that, you should see this configuration-complete screen:
Now you are ready to test Ekiga. If you need to change the device data later, you can do this from Main Menu > Tools > Preferences. The videophone test screen looks like this:
Making a test call:
sip:500@ekiga.net
This is the ekiga.net echo test number. I recommend using "side by side" video (View > Side-by-Side) to let you see what your video looks like from the other end. You can also dial username@ekiga.net if you know the username. To let you see what you're sending out, you can put the image into side-by-side mode by going to the main menu and pulling down Tools > Side-by-Side. The image to the left is the remote image, the right is local.
TO CALL OFF THE NETWORK VOIP-VOIP
I'll use examples from the Ekiga Fun Numbers page. Video won't work unless you're talking to another Ekiga client.
*010-600 Echo test from Voxalot (USA) Enter it as *010600 (equivalent of sip:*010600@ekiga.net ) via URL bar or telephone keyboard. Do not enter spaces or dashes. DO enter the asterisk. Simply enter the numbers either by dial pad or keying into the phone number slot as a continuous string as you would on a physical telephone dial pad, with no spaces.
Also, you don't have to enter the provider part of the sip URL, as long as you're using ekiga.net.
There's a server that'll get you into toll-free numbers in the "Fun Numbers" listing: A listing of VoIP provider prefixes..
If you want to use the PSTN, you'll have to buy an account. Click on the Ekiga Tools > PC to Phone menu item. Then click "Get an Ekiga PC-To-Phone Account." That will open your browser to a Web page for a telephone VOIP service. Start an account, and charge it with money; the minimum charge to credit / debit card, e-gold, etc., is $10. Go back to the menu item and fill in the account number and password. Then click the Use PC-To-Phone checkbox, and hit Apply.
The U.S rate is 0.017 cents per minute (that's right, 17 one-thousandths of a cent). Foreign rates are fairly typical for a U.S.-based VOIP-based provider. For rate information, visit here.
For incoming calls, being listed in the white pages directory is optional. Do that from the ekiga.net account you made when setting up Ekiga via the Ekiga Configuration Druid. The Documentation / FAQ can be found here.
COMMON PROBLEMS
If you unplug your digicam and your CPU usage suddenly goes to 100 percent, open a console and do:
# ps -A
...and look for the Ekiga process ID in the list. Then do:
11532 ? 00:00:04 ekiga
# kill -9 11532
RECONFIGURING WEB/VIDEOCONFERENCE CAMERA AS DIGICAM
To make your camera -- assuming it isn't a pure webcam -- available for the purpose of retrieving pictures you've taken, first try switching to disk mode or image or camera. . . whatever it is you usually have your camera set to in order to download the images to the computer. Then try unplugging or re-plugging your camera. Make sure it's in "disk mode." Then try rebooting.
Actually, once I got gspca stable, I could usually simply switch modes at the camera, occasionally using ps -A as above to find and kill a video app that refused to shut down completely.
Qnext: This is a super IM with video " multiplatform, multiple networks :MSN Messenger, Yahoo! Messenger, AIM, and ICQ, plus its own qnext network. Versions for Linux, OSX, Windows. Get it here.
Unlike the other applications, this requires that the current Java version for your distro be installed. To verify this, look for /usr/lib/jvm/java-1.5.0-sun-1.5.0.11/ . Or if it's configured in your browser, simply go to http://java.com/en/download/help/testvm.xml. If the applet is running, you'll see a small window on the page with a vaguely penguin-ish figure moving left-right-left and the words "Congratulations, the latest version is installed on your system."
If Java needs to be installed, then:
# aptitude install j2re
...or the equivalent commands in your distro's automated installer.
Otherwise, download a binary for your distro from here.
An IM with video might be the best choice for straight PC-to-PC calls that don't have to go through the PSTN. Note that I am doing the following as user not root. This is not a build-from-source. Simply download, unpack, and run the script:
$ cd [path-to-wherever you downloaded qnext]
$ tar xvjf qnext*
$ cd qnext*
$ ./qnext
To make an icon:
right-click the desktop and on the pull-down, go to:
Create new
Link to Application
In the General tab,
Click left button in the Select Icon window.
Click browse
Enter [path-to]/qnext/errors
Select the .png image
In the text box next to button, enter qnext
In Description tab:
Description: qnext video IM
Command: Hit the browse button. Use the directory window to get to the qnext directory. Select qnext. Hit the Open button.
Work Path: [path-to]/qnext
Push the OK button, your Qnext icon is on the desktop as thus:
In IM mode: start the program. After you've finished registering, close the program. Then reopen it; the Quick Start Guide will come up. Follow the instructions to start adding buddy lists. Click the icon on the bottom left (everything's got tool tips, just hover your mouse cursor for labels) corresponding to the network you want to use.
Go to Main Menu > Tools > Options. Then click the Devices tab and push the Detect button to pick up your camera.
For audio conferencing, go here for the procedure.
For videoconferencing, go Wengophone supports Linux / OSX / Windows, PC-to-PC or PSTN.
WHERE TO GET HELP
- video4linux mailing list: As on any mailing list you're hoping to get help from, I recommend searching the list archives first. There's a good chance your problem has already been solved.
- Ekiga mailing lists: You want the "Users" mailing list.
- Qnext support center: Here you can find a FAQ, further documentation, a user forum, and customer support for Qnext.
A. Lizard, is an Internet consultant in the San Francisco Bay area. He has been writing for technology magazines and Web sites since 1987.