pjWebCam Documentation
Version 1.2a

Overview

pjWebCam is a simple application to enable a windows video capture device to be accessed across an intranet or internet.

The latest version of pjWebCam can be found at http://www.homeusers.prestel.co.uk/cherryjam/utilities.html

Features

pjWebCam supports the following.
HTTP Server.

This turns the machine that the camera is attached to into an HTTP (web) server. This responds to blank http requests by sending the current image from the camera.

Optionally a refresh interval can be configured, which will cause some browsers to effect a "client pull" on the image at the selected interval.

FTP Client.

Each time an image is captured (at the end of each capture interval, or as a result of the user pressing the take button) the Image can be uploaded to an FTP server.

Local Save.

Each time an image is captured (at the end of each capture interval, or as a result of the user pressing the take button) the Image can be saved locally. Incremental filenames are not currently supported.

Captioned Images.

Captured images can be captioned. This caption uses a user defined, font, colors and message which can use escape sequences to include time strings (using standard C strftime escapes), using the host machines current locale settings.

Overlayed Images.

A Bitmap file can be superimposed on the captured image. This can be used to display a logo or other image on top of the capture.

Image Processing.

The captured image can be processed before being displayed. Processing options include, blur, sharpen, negative, edge detect.

Multiple Configurations.

Multiple configurations can be stored. This allows simultaneous use of multiple cameras, or simultaneous use of the same camera using different settings, for example ftp'ing captured images at different rates to different locations. The configuration can be specified by name as a command line parameter, so shortcuts can be setup to start pjWebCam with different configurations.

Multiple instances of pjWebCam running the same configuration aren't allowed. If a second instance of pjWebCam is started with the same configuration as an already running instance then you are prompted for different a configuration name.

Configuration

pjWebCam is configured entirely from its main window, and the dialogs that are created from there. The default configuration settings (those that are used if pjWebCam is run without parameters)are stored in the Registry in the key HKEY_CURRENT_USER\Software\Pacaro\pjWebCam and can be reset to defaults at any time by deleteing that key.

Named configurations are stored beneath that key, so a configuration foobar would be stored in the key HKEY_CURRENT_USER\Software\Pacaro\pjWebCam\foobar

Banners

If you use pjWebCam on your site you might want to link back to my website. I have provided a couple of banners that you can use. The following html will link back to the pjWebCam homepage.

<a href="http://www.homeusers.prestel.co.uk/cherryjam/utilities.html">
<img src=pjWebCam.banner.jpg 
     width=256 height=64 border=0
     alt="Powered by pjWebCam"></a>
Powered by pjWebCam

This Banner is provided in three sizes...
NormalpjWebCam.banner.jpg
SmallpjWebCam.small.banner.jpg
TinypjWebCam.tiny.banner.jpg

Any suggestions for better banners will be gratefully recieved!

Legal Information

This program is copyright © Paul Roberts 1998 - 2000.

This program is based in part on the work of the Independent Jpeg Group

This program is licensed free of charge and can be freely distributed provided this file is distributed with it and that there are no charges beyond those necessary for administrative purposes.

BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

I Wrote This

Paul Roberts
pjWebCam@cherryjam.prestel.co.uk

I Welcome your input and constructive criticism but may not have time to respond.

Changes

Version 1.2a - 23 June 2000

Fixed memory leak in thread handling. Added more detailed FTP error reporting.

Version 1.2 - 27 January 1999

Added image overlays and preprocessing. Completely redesigned the caption dialog.

Version 1.1b - 5 January 1999

Added a "safe" capture mode. This should prevent the "black image" that some capture boards give. This mode shouldn't be used if you don't have this problem. If this fixes the problem for you please let me know. Thankyou.

Version 1.1a - 2 January 1999

Fixed ftp bug. Very long responses in some servers motd's caused crashes. This is now fixed. Many thanks to Tao for helping test this.

Version 1.1 - 18 September 1998

Added multiple configurations
Added PASV (passive) mode support for FTP
Improved storing of configuration, particularly time and local image capture.
Changed version numbering scheme. No more lettered versions :)

Version 1.0d - 28 July 1998

Added 300 second timeout on sockets, afterwhich that socket is killed.
Remembers the state of the preview window from session to session.
Added expiry header to http server.

Version 1.0c - 23 June 1998

Now "remembers" which capture device it last used.
Logging is now optional.
The log is not allowed to grow beyond 256 entries.

Version 1.0b - 4 June 1998

Support added for compressed mode capture.
Now allows selection of Capture Device if more than one is available.
FTP works better with some firewalls.

Version 1.0a - 13 May 1998

Support added for 8 bit capture. Both color and greyscale.

Top


Top


Capture Settings

Capture Interval

This is the number of interval units between captures.

Interval Units

This is the units to use for counting capture intervals, options are...

  • Seconds
  • Minutes
  • Hours
  • Days
  • Weeks

Time Remaining

This displays the amount of time remaining until the next automatic capture.

Top


Video Settings

Capture Device

This is the video capture device that pjWebCam is currently using.

Preview Video

If this button is selected a video capture preview is displayed.

Source

Adjust settings for the video source.

Format

Adjust video format options.

Display

Adjust video display options.

Quality

This specifies the "quality" setting to be used when encoding the jpeg file. This is a value between 0 and 100 where 0 represents the lowest quality (best compression) and 100 the highest quality (least compression). The table shows the effects on file size of 5 different quality settings.

QualitySize in kImage
03
257
509
7513
10060

Details

This shows a summary of the current image capture options.

Top


HTTP Server

Enable HTTP

If this is checked then pjWebCam operates as a simple HTTP server. Using the port number etc. specified in the http settings dialog.

HTTP Settings

This opens the http settings dialog.

HTTP Settings Dialog

Port Number

This specifies the port number that the http server listens on. The default port for http is 80, a common alternative (to avoid clashing with another webserver on the same address, or to avoid using a privilidged port) is 8080.

Client Pull Refresh

If this is checked then the server will send and Http header asking the web client to perform a client pull after the time specified by the refresh interval.

Refresh Interval

This is the number of seconds the client should wait before performing a client pull.

Top


FTP Settings

Enable FTP

If this is checked then each time pjWebCam captures and image it is uploaded to the ftp server specified in the ftp settings dialog.

FTP Settings

This opens the ftp settings dialog.

FTP Settings Dialog

Username

This specifies the username to use when logging on to the ftp server.

Password

This specifies the password to use when logging on to the ftp server. The password is stored (like all other pjWebCam configuration information) in the registry. It is encrypted using a relatively simple encryption mechanism. There is a potential security risk. If someone has access to your registry they could break the encryption, given sufficient time and expertise, thus giving them access to your ftp account.

Account

This specifies an account name to connect to the ftp server with. This is not tested because i couldn't find an FTP server that uses this facility. The likelyhood is that you will not need to enter anything in this box.

Server

This is the internet address of your ftp server.

Directory

This is the subdirectory on that server that you wish to store the image file in.

Filename

This is the filename that you wish to store.

Passive Mode

If this is checked then the image file is ftp'd to the server in passive(PASV) mode. An ftp session consists of 2 TCP/IP connectections between the clent and the server. A control connection created from the client to the server, this is used to send control messages to the server, and a data connection (used to send and recieve data). Normally the server connects to the client to create the data connection, in passive mode this is reversed. This can be helpful for ftp'ing through some firewalls.

Top


Caption Settings

Caption Image

If this is checked then any captured image has a caption using the settings specified in the caption settings dialog.

Overlay and Caption Settings

This opens the overlay and caption settings dialog.

Overlay and Caption Settings Dialog

Caption

This specifies the string to be used as a caption. The following escapes are used to insert date and time information into the string.

EscapeMeaning
%aAbbreviated weekday name
%AFull weekday name
%bAbbreviated month name
%BFull month name
%cDate and time representation, appropriate for locale
%dDay of month as decimal number (01 - 31)
%HHour in 24-hour format (00 - 23)
%IHour in 12-hour format (01 - 12)
%jDay of year as decimal number (001 - 366)
%mMonth as decimal number (01 - 12)
%MMinute as decimal number (00 - 59)
%pCurrent locale's A.M./P.M. indicator for 12-hour clock
%SSecond as decimal number (00 - 59)
%UWeek of year as decimal number, with Sunday as first day of week (00 - 51)
%wWeekday as decimal number (0 - 6; Sunday is 0)
%WWeek of year as decimal number, with Monday as first day of week (00 - 51)
%xDate representation for current locale
%XTime representation for current locale
%yYear without century, as decimal number (00 - 99)
%YYear with century, as decimal number
%z, %ZTime-zone name or abbreviation; no characters if time zone is unknown
%%Percent sign

A flag # can be inserted in any escape, changing the meanings as follows

EscapeMeaning
%#a, %#A, %#b, %#B,
%#p, %#X, %#z, %#Z,
%#%
# flag is ignored
%#cLong date and time representation, appropriate for locale.
%#xLong date representation for current locale
%#d, %#H, %#I, %#j,
%#m, %#M, %#S, %#U,
%#w, %#W, %#y, %#Y
removes leading zeros (if any)

Vertical Position

Specifies the vertical position of the caption.

Horizontal Position

Specifies the horizontal position of the caption.

Transparent

If this is checked then the Caption is drawn onto the image transparantly, other wise the text is drawn in a box.

Caption Font

Clicking this button allows you to select a caption font.

Foreground Colour

Clicking this button allows you to select the foreground colour of the caption.

Background Colour

Clicking this button allows you to select the background colour of the caption. This is the colour of the box that the text is drawn onto unless transparent is selected, in which case this is used as the outline colour for the text.

Swap Colours

Clicking this button exchanges the current foreground and baground colours.

Image Processing

This combo box allows the selection of image processing. Available options are

  • Blur
  • Sharpen
  • Sharpen More
  • Edge Detect
  • Trace Contours
  • Negative

Use Overlay

If this is selected then an overlay image will be used

Bitmap

This is the name of the bitmap file to be used as an overlay image

Bitmap browse

This allows you to browse for a bitmap file

Overlay Method

This is the method used to overlay the bitmap on the captured image. The available methods are

Average
This averages the pixels in the captured and overlay images.
Difference
This subtracts the pixels in the captured image from the overlay image and offsets the result by 128
Distance
This calculates the linear distance in color space of the pixels.
Interlace
This alternates lines from the two images.
Alternate
This alternates pixels from the two images
Add
This adds the pixels from the two images.
Subtract
This subtracts the source pixels from the overlay pixels.
Multiply
This multiplies the pixel values and divides by 256.
TL Transparent
Treats the colour of the top left pixel in the overlay image as a transparent colour.

Overlay Position

This selects the position of the overlay image on the source image. If Stretch is selected then the overlay image is stretched to the same size as the source image. If the overlay image is smaller than the source image then pixels outside the overlay image area are assumed to have the same colour as the top left pixel of the overlay image.

Caption Preview

This shows a preview of the current overlay and caption settings.

Top


File Settings

Save File

If this is checked then the captured image is saved locally.

Filename

This is the filename of the image to save.

Browse

This button allows you to browse for a filename to save as.

Top


Other

Progress Indicator

This shows an indication of outstanding file transfers.

Take

This button causes a capture to happen immediately, resetting the timer.

About

Displays copyright information about pjWebCam.

Exit

Closes pjWebCam.

log - checkbox

The state of this checkbox determines whether or not actions are logged to the listbox.

log - listbox

This shows a log of actions in the current session, if loggin is enabled.