
This page describes Camstream, an example AMQP client program that demonstrates some of the features of RabbitMQ.
Camstream uses AMQP to route live, streaming video from one or more webcams to one or more displays. A capture program injects frames into a named AMQP fanout exchange, and a corresponding playback program uses an anonymous auto-delete queue to retrieve a stream from a named exchange.
In this way, Camstream behaves similarly to a video-enabled IRC, where an exchange models an IRC channel.
You can launch camstream via Java Web Start:
If you accept the default settings for the host name and channe name, the programs will connect to a public demo server.
In order to run camstream on your own AMQP broker installation, you need to configure the broker to have
Follow the instructions in the admin guide for configuring a RabbitMQ broker. Here is transcript of the required commands:
$ rabbitmqctl add_user camstream camstream Creating user "camstream" ...done. $ rabbitmqctl add_vhost /camstream Creating vhost "/camstream" ...done. $ rabbitmqctl map_user_vhost camstream /camstream Mapping user "camstream" to vhost "/camstream" ...done. $ rabbitmqctl set_permissions camstream /camstream /data all Setting permissions for user "camstream", vhost "/camstream", realm "/data" ...done.
This section describes how to run Camstream from the command-line, if you chose to download the software or compile the source code
Camstream is made up of two separate classes of program: the capture programs, for various architectures, that capture video frames and inject them into an AMQP broker; and the display program, written in pure java, that retrieves and displays video and provides a basic text chat application.
While any platform can play back video using camdisplay, only platforms supported by either the Java Media Framework (JMF) or by a special driver can capture video for injection into the AMQP network.
The JMF supports Windows, Linux and Solaris. You can download the JMF for your platform from here. Both Mac OS X and Linux also have their own special drivers. The following table summarises the various platform options:
| Platform | Windows | Mac OS X | Linux | Other JMF |
|---|---|---|---|---|
| Capture program | camcaptureJMF | camcaptureOSX |
camcaptureLinux, camcaptureJMF |
camcaptureJMF |
| Display program | camdisplay | camdisplay | camdisplay | camdisplay |
The capture programs are camcaptureJMF, camcaptureOSX, camcaptureLinux, in Java Media Framework, Quicktime and Video4Linux variants respectively.
The Quicktime variant is for Mac OS X machines, running OS X version 10.3.9 or greater.
The Video4Linux variant is an alternative to the JMF variant for Linux machines with V4L-compatible webcams. Use this if you do not wish to install the JMF for Linux.
You can either start the programs without command-line arguments, which will open a window asking for the startup parameters the program needs:
$ ./camcaptureJMF $ ./camcaptureOSX $ ./camcaptureLinux C:> camcaptureJMF.bat
or you can supply the following command-line arguments:
./camcaptureXX hostname exchangename routingkey framerate x-res y-res
The playback program is called camdisplay, and runs on any Swing-supporting Java runtime, including those for Windows, Linux and Mac OS X.
./camdisplay hostname exchangename routingkey
Note that the framerate is entirely controlled by the
intersection of the capture program's maximum framerate
and the available downstream bandwidth between the AMQP
server and the camdisplay client.