Thursday, April 12, 2007

Let's play with text

Do you know that, you can play mpeg video on text mode terminal?

Aalib (ascii art library) is an open source software library, render graphic and display in pure text (ascii) mode.

Is totally out of imagination, why people want to convert graphic to ascii text, especially for those windows users which never use dos before. There is a lot of reasons why people are doing this.

Reason 1: I only have daisy wheel printer. What is a daisy wheel printer (take a look at the picture here)? In the 80s, there is no such thing as laser printer (I mean normal people do not own such a printer), a laser printer may cost more than your desktop computer. The most commonly used printer is either dot matrix or daisy wheel printer. Most people will use a dot matrix (either 9 pin or 24 pin) printer because it can print both graphics and text, some people might prefer a daisy wheel printer for a better text output quality.

You can take daisy wheel printer as a type writer, which has a printer cable connected to your pc. Daisy wheel printer output a better text quality than your dot matrix printer, the down side is daisy wheel printer can't output graphics. With aalib (or similar graphic to ascii software), you can print graphics to a daisy wheel printer.

Reason 2: I am unix administrator. If you are a unix administrator, you might use a lot of telnet or only deal with a green color display dump terminal. With aalib you can view and manage your graphics (eg. gif or jpeg) files on your unix server with your text base terminal. Since you can view jpeg graphics, is should be easier for you to imagine, play mpeg video or video conferencing (streaming) on monochrome dump terminal is really possible.

portrait
display by aalib, move further to get a better view

original portrait
The original portrait


Since aalib is an open source software library, I like to compile it myself. Aalib is well written, is easy to compile:

$ tar xzvfp aalib-1.4.0.tar.gz
(extract out the source code)
$ cd aalib-1.4.0
$ ./configure --prefix=/usr
$ make
$ make install
(if you know how to make software package like rpm or deb, you should install the rpm, other than install the library directly from the source)

aalib will link with the X windows library (strange right?), aalib use X Window terminal for ascii display by default, if it can't get a X Window display, it will use the dump terminal automatically.

$ aafire

To play video on terminal, you can try apron, but since MPlayer and xine support aalib, apron development is discontinued.

There are people who ported VGA library to aalib, so you can play Doom and Quake game on console terminal. You might be still thinking writing such a library like aalib is just a waste of time. As I told you, aalib is like a Mercedes smart fortwo, if is not applicable, is just for fun!

No comments: