Broadcast Live Video in ASCII Art with Hasciicam

Spread the love

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:

hasciicam

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:

-f :user@host:/directory

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 horizontally. 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):

-S 3

Change font face (this didn’t work for me):

-a Terminus

Change refresh rate in seconds (default is 2):

-r 1

Set background color (use hexadecimal format without the leading “#“):

-B FF0000

Set foreground color:

-F 0000FF

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 html -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.

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?

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Sign up for all newsletters.
By signing up, you agree to our Privacy Policy and European users agree to the data transfer policy. We will not share your data and you can unsubscribe at any time. Subscribe


Rebecca “Ruji” Chapnik

Ruji Chapnik is a freelance creator of miscellanea, including but not limited to text and images. She studied art at the University of California, Santa Cruz and writing at Portland State University. She went on to study Linux in her bedroom and also in various other people’s bedrooms, crouched anti-ergonomically before abandoned Windows computers. Ruji currently lives in Portland, Oregon. You can find her experiments at rujic.net and her comics at dondepresso.rujic.net.

Comments (2)