cctv is an xscreensaver module that displays security camera images on your screen.  The images are downloaded continuously from teh interwebs, making the display animated and close to real-time.  The URLs of potential images are provided to the script via an input file.  Images must be JPEGs.  Good URLs to use are those from Axis security cameras, which can be located via Google by searching for inurl:"jpg/image.jpg?r=".

This script requires Python 2.3, xscreensaver, and netpbm. When not using --root, Tkinter is also required.

Inspired by the work of i.document.


If you just want to see what CCTV is like without downloading and installing it, I've got a Web-based version, too.  It doesn't do the continuous download, though, so you'll just get a series of static images.

Download and Install

The script:
An example URL file:  cctv.txt

Put them pretty much anywhere.  A reasonable place is the xscreensaver directory (usually /usr/X11R6/lib/xscreensaver/). 

Running It

You can run it from the command-line like this:
./ cctv.txt
That'll attempt to open a Tk window and display a rotation of 5 security cameras in it.  Full usage statement is as follows:
Usage: [-d] [-q] [-n int] [--root] [--range min-max]
[--delay float] [--duration float] urlfile
-d: Turn on debugging output.
-q: Quiet. Suppress humorous status messages.
-n int: The number of CCTVs to rotate amongst. Defaults to 5.
--root: Display the images on the root window.
--range min-max: The minimum and maximum mean pixel values to
allow, as a string such as "20-210", or the special string
"localtime". If a range, the values must be in the range
0 to 255. Images not in this range will be discarded.
If "localtime", images appropriate to your local time will
be used. If not provided, all images may be used.
--delay float: The minimum number of seconds to wait between image
downloads. Defaults to 1.0.
--duration float: The number of seconds to spend on each CCTV.
Defaults to 10.0.
urlfile: A file containing one URL per line.

Screen Saver Configuration

Unfortunately, I don't know any good way to do this other than edit the xscreensaver configuration by hand.  Make a backup copy before you begin.

Add something like the following to ~/.xscreensaver:
default-n:  "CCTV"  /usr/X11R6/lib/xscreensaver/ --root /usr/X11R6/lib/xscreensaver/cctv.txt \n\
The xscreensaver control panel won't give you an inline preview of the module, but you can click the "Preview" button to see it in action. 

Version History


Feel free to send me updates to the script if you want to make either of these -- or other -- improvements.
Chez Zeus:CCTV

Anti-©2007 Dr. Zeus.