Video Chat System

Overview

The goal of this project is to build a video multicast system with distributed chat capability. This system allows clients to view the video broadcast from a server of their choice. The clients and servers are divided into different groups. The server multicasts the video content to the registered clients in its group. Besides the video, the server and its clients can communicate with each other by text chat system. This kind of structure would be suitable for functions such as online lectures. In this context, each server would represent individual lectures; the clients, or the students, would select the lecture of their choice and tune into them. Each lecture then would have its own group of listeners, corresponding to the different clients belonging to different groups.

The overall structure is shown below.



Architecture

1. Server

The server is responsible for the video broadcast to the clients. When a server connects to the relay, it makes itself known to the potential clients. When certain clients join the server via the relay, they form a single group. One server is responsible for providing the video content to one group. When a server is first started, the source video file is specified so that it can stream the video content to the clients. Besides the video, the server communicates with its clients by text chat. The server interface is shown below.



2. Client
The clients first connect to the relay to receive the list of available servers. Each client can connect to one server of its choice through the relay. Once this happens, the client becomes a member of that server's group. During video broadcast by the server, a client may wish to communicate with the server or other clients in the group. This is done through the text chat system, which allows direct communication among all members of a particular group. The client interface is shown below.

3. Relay
The relay acts as the communication hub between the servers and the clients. Servers and clients can only see the relay; they have no way of directly contacting each other. This serves several purposes, the most important of which is to provide a level of security. All packets between servers and clients are first sent to the relay, which then forwards these packets to appropriate destinations. The relay does not try to interpret any of the packets. It maintains a list of currently registered groups, which include the addresses of the server and clients in a particular group.
Based on the source address of a received packet, the relay looks up its group list table to determine the destination of the packet and simply forwards it there.

Implementation

The server and client programs are written in Java for easier implementation of the video transmission system. The relay is written in C to make it as efficient as possible, as it can be the point of bottleneck for the entire system. Using Java for the server and client allows them to utilize Java Media Framework for handling of multimedia. JMF provides easy-to-use facilities for video capture, streaming and reception using RTP. Also, as it is based on Java, it is very portable.

The servers, clients, and the relay communicate with each other by sending each other message packets based on UDP. Each message packet contains a command field specifying its type. These packets are used for either control or text messages. The message types can be found in the file message.h from the relay package.

There are four ports between the server and the relay or the client and the relay. The control port is for sending and receiving of control messages, which are used for actions such as establishment and teardown of connections, joining of groups, and keeping track of alive members. The text port is for those messages containing text chat contents. The last two ports are for RTP and RTCP used for video transmission.

Future Developments

There are three main goals to be achieved in the future. First of all, the current implementation allows video streaming from a specified file only. Video capture module should be added so that instead of streaming a file, video content can be captured by a video camera and streamed. The second goal would be to add audio capability. This would be expanding on the current video session used. Finally, ways to reduce the load on the relay should be investigated. Possible solutions would include making the relay distributed, so that the load would be divided into a number of machines, instead of just one.

     

Home

Technology

Topics

Links

Contacts