Image Server Usage

[2007.01.09]

Introduction
Installation
Running USARSim in server mode
Running USARSim in client mode
Using Image Server
Download


Introduction

The image server that you can download from this page is a slightly modified version of the image server included in the UASRSim package. The server code is the same however this version also supports UT running in client mode.

Installation

Copy the following files in the UT2004/System directory:

ImageSrv.exe
FreeImage.dll
Hook.dll


Running USARSim in server mode

If you want to use the image server in the usual way do the following:

  1. Start the UT server.
  2. Start the image server.
  3. In the image server select UT Server Mode, type in UT Server address IP, enter a map name and chose the format, resolution and fps of the images.
  4. Click on Start.

Remember: you must run image server on the same machine where UT server is running.


Running USARSim in client mode

If you plan to use USARSim in client mode, then do the following:

  1. Start the image server.
  2. In the image server select UT Client Mode, enter a map name and chose the format, resolution and fps of the images.
  3. Click on Start.


Using Image Server (from USARSim manual)

Image Server simulates web camera. Its workflow is:

  1. Send out a picture when the client connects with it.
  2. Wait for the acknowledgement form the client.
  3. If the current time is the sending time triggered in the specified frame rate, then send out the next picture.
  4. Go to step 2).

The server supports both raw picture and jpeg picture. The image data format is:

ImageType (1 byte) + ImageSize (4 bytes) + ImageData (n bytes)

Where ImageType is the format of the image. It can be:

0 raw data
1 jpeg in super quality
2 jpeg in good quality
3 jpeg in normal quality
4 jpeg in averagequality
5 jpeg in bad quality

ImageSize is the total length of ImageData in bytes.

ImageData is the actual data of the image. For raw data, the ImageData is:

width (2 bytes) + height (2 bytes) + RGB (1 byte + 1 byte + 1 byte) data from left to right, from top to bottom. For jpeg, the ImageData is the real jpeg data which can be decompressed by any jpeg decoders.

The image transfer protocol is very simple. When the client got the image, it sends back acknowledgement meesage 'OK' (in plain text) to the image server. To use the image server, you only need to follow the simple protocol and the image format. As an example of how to use image server, the source code of SimpleUI is included in the USARSim package. The SimpleUI uses the FreeImage (http://sourceforge.net/projects/freeimage) DLL to decode jpeg pictures.


Download

ImageSrv.rar (1.28Mb)