cacatalk is a simple, distributed (peer-to-peer) video chat interface for Linux terminals. It's based on libcaca and v4l2
Carlos Jaramillo cjaramillo@gc.cuny.edu
Copyright (C) 2013 under License: Do What The Fuck You Want To Public License (WTFPL)
'cacatalk' demonstrates basic socket programming principles used to transfer ASCII Art data using libcaca (http://caca.zoy.org/wiki/libcaca), and its display drivers around ncurses, GL, conio, X11, etc. It demonstrates video grabbing from a supported device uses the Linux Media Infrasture API (a.k.a. V4L2). This is a proof-of -concept about the power of asynchronous polling of sockets file descriptors with the help of the select() system call for file descriptors (sockets in our case), the use of threads (pthreads), and the pure awesomeness of CACA itself (Color AsCii Art).
This code is at an experimental stage, and licensed under the WTFPL license.
First, satisfy dependencies:
-
libcaca
-
libv4l2 (probably there already)
-
ncurses (mostlikely there already)
-
Git (optional) for pulling/donwloading the package from this repository:
Build cacatalk with:
make
Connect your v4l2-supported video camera and launch cacatalk:
./cacatalk
Usage : cacatalk [-p address] [-v video_device_path] [-d caca_driver_style(1-7)]
Options :
-p address Sets the reachable peer as a dotted decimal IPv4 address or network resolvable hostname
-v video_device_path Sets the path to the video device (e.g /dev/video0)
-d caca_driver_style The argument value is a number from 1 to 7,
and it allows to choose the environment of cacatalk,
Possible values represent (1: Default, 2: ncurses terminal, 3: conio, 4: GL, 5: raw, 6: VGA, 7: slang)
This is a first release (initial development), so the source code needs to be cleaned up and debugged. The following functionally exists for caca talking:
-
'cacatalk' can be run from the command line without arguments at all), and they could be set during runtime from the main menu.
-
Video stream (if valid device has been open) can be toggle on/off during chat session by pressing 'Ctr+V'
-
'cacatalk' uses 2 stream sockets (bidirectional). The text (chat) socket operates on port 25666. The video stream socket uses
- Both peers are listening on 25666, but whoever initiates the connection (by pressing 'c' in the main menu) becomes the client who also starts listening on port 25667 for the peer to connect to. All this happens transparently.
The program has two canvas:
-
a presentation canvas on which menus and the chat room are drawn. buffer and a screen. The text buffer.
-
a background canvas running on a thread that polls video and sends to the peer.
There maybe issues at quiting a connection when the other peer is still transmitting video data (socket lingers)
-
Parametrize dimension values, such as video resolution (for now it's set statically to grab a 640x480 video), and the produced caca image uses 16 lines (rows).
-
Add scrolling: The program doesn't scroll (nor saves) ongoing text chats (also after leaving the chatroom). Also, there are only 5 entries for send/receive text chat.
Documentation: can be found in the 'docs' folder