Friday, June 17, 2011

Live cam on ubuntu?

Ok, here's how to do a live cam on ubuntu. I'm using a small HP mini laptop.

1. Install webcam-server. Details here:
http://hacktivision.com/index.php/2009/06/16/setting-up-an-ubuntu-webcam-server

2. Start the webcam server:
sudo webcam-server -v -g 320x240 -p 8888 -c mycam

3. Access the server:
http://localhost:8888
CTRL-R to refresh

4. Link applet to apache home dir:
/usr/local/apache2/htdocs$ sudo ln -s /usr/share/doc/webcam-server/applet/

5. Make sure apache knows location of the applet.jar file:
/usr/local/apache2/htdocs$ vi index.html

APPLET CODE = "WebCamApplet.class" archive="applet/applet.jar" WIDTH = "320" HEIGHT = "240"

6. Access the web cam:
http://localhost

-----Errors?
I got this one:
"get_cam_image(): len != img->bufsize, just letting you know"
Details about this error:
https://bugs.launchpad.net/ubuntu/+source/webcam-server/+bug/318187

Fix:
(step1) install "libv4l" from here:
https://launchpad.net/ubuntu/jaunty/lpia/libv4l-0/0.5.0-3~intrepid1

(step2) Start server like this:
# LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so webcam-server -v -g 320x240 -p 8888 -c mycam

--
If you need to install apache:
http://httpd.apache.org/download.cgi#apache22
It installs by default into: /usr/local/apache2/

If I missed anything, or if anyone knows how to add sound -- let me know in comments.

No comments: