How to:stream your webcam over telnet with Ubuntu linux
Tuesday, 5. February 2008, 21:13:25
First, make sure, that you have your webcam installed and available as video device, i won't cover that, as i don't know your webcam, i will just assume you have that.
Second you will need the following packages installed:
- vlc
- caca-utils
You can install them like this in your console:
sudo apt-get install vlc caca-utils
Now a bit of theory:
The software called vlc (videolanclient) is, basically spoken a media player, which supports lots of funny stuff, of which we will use two things specifically for this: the ability to read your video4linux device as input, and the support of using libcaca as output.
Libcaca is a library, used for colored ascii output of images/videos.
Installed with caca-utils comes a utility called cacaserver, which serves libcaca output on port 51914 for telnet connections, so it's just about putting those two together:
CACA_DRIVER=raw vlc v4l:// :v4l-vdev="/dev/video" :v4l-adev="/dev/dsp" :v4l-norm=3 :v4l-frequency=-1 --vout=caca --intf dummy|cacaserver
If your video device is different from /dev/video you will have to adjust that.
I don't want to type that all the time, so i created me an alias in my ~/.bashrc:
cam2telnet='CACA_DRIVER=raw vlc v4l:// :v4l-vdev="/dev/video" :v4l-adev="/dev/dsp" :v4l-norm=3 :v4l-frequency=-1 --vout=caca --intf dummy|cacaserver'
It seems to consume quite the bandwidth, maybe you can get a bit control over that with adjusting the framerate, have fun with digging into the vlc documentation for that: http://www.videolan.org/doc/

