Is Skype a little too modern for your taste? Hasciicam will take you back to the electronic days of yore, where you can broadcast live video to your friends â" and even the public â" in ASCII art.
Hasciicam is a small command-line application written in C. It was originally developed by Rastasoft as part of the libre operating system âdyne:bolicâ, but you can run it on any Linux operating system as a standalone program.
Requirements
Getting Hasciicam
Many Linux repositories stock Hasciicam. If yours doesnât, or if youâd like to build it from source, get it from the dyne.org FTP server.
Basic Usage
If you just want to see yourself in ASCII art or test your webcam, you can run Hasciicam in live mode. This is the default mode, so it doesnât require any command-line arguments. Just run:
A window called âaa for Xâ will open. This is Hasciicam and AAlib in action:
Broadcast Live Video
To broadcast live video, we need a destination to send it to. Hereâs where the FTP server comes in.
The first command-line switch we need to use is â-m
â for âmode.â The three possible modes are live (which we used in the previous example), HTML, and text. When youâre pushing to an FTP server, you must use either HTML or text mode.
Use -m html
for broadcasting video; thereâ s no refresh function in text mode, so all youâll get is a static text file.
The next switch is -f
to specify the FTP server and login details. It follows this format:
Finally, we need to give Hasciicam an output file with â-o
â. The default is hasciicam.html, but you might want to change this to index.html to save your viewer(s) some typing.
Hereâs an example I used to broadcast my video to another computer on my local area network (LAN), creating the file index.html in that userâs home directory:
hasciicam -m html -f :ruji@192.168.1.167:/ -o index.html |
I also tested this method on my public website, using this format to connect to the server and save index.html in a directory called âhasciicamâ:
hasciicam -m html -f :ruji@mywebhostingcompany.com:/public_html/hasciicam/ -o index.html |
After I entered the command, my webcam light turned on, and Hasciicam prompted me for my FTP password:
In my browser, I navigated to the hasciicam directory on my website. And there I was, in glorious green characters on a black background, albeit with a lag of about ten to fifteen seconds.
The only problem besides the lag was that the image was stretched out horizon tally. Fortunately, Hasciicam lets you change the rendering options for a better picture.
Rendering Options
Hasciicam gives you a few different command-line switches for changing the appearance of the output. Enter any of these after your FTP information:
Change font size (choose a number between 1 and 4):
Change font face (this didnât work for me):
Change refresh rate in seconds (default is 2):
Set background color (use hexadecimal format without the leading â#
â):
Set foreground color:
Hasciicam also lets you adjust the contrast, gamma, and brightness. See the main page for details.
Here I changed the font size to fix the stretching problem, and I also set the colors to blue on red and the refresh rate to every second:
hasciicam -m h tml -f :ruji@mywebhostingcompany.com:/public_html/hasciicam/ -o index.html -B FF0000 -F 0000FF -S 4 -r 1 |
The output looks like this:
To stop your Hasciicam stream, just hit âCtrl + Câ in the console you ran the command in.
Note that the HTML page will remain on your server, and it will keep trying to refresh even without new data coming in. If you want to keep the page on your server but stop it from refreshing, just remove this line from the top of the file:
<meta http-equiv="refresh" content="1" /> |
Conclusion
While Hasciicam isnât exactly full-featured â" for instance, thereâs no integrated audio streaming â" you can extend this simple program yourself. A rather low-quality solution could be to set up a separate HTTP audio streaming server and embed the audio stream alongside Hasciicamâs output using iFrames (just a thought!).
What do you think of Hasciicam? Is there anything else you wish you could do with ASCII art?
No comments:
Post a Comment