David Austin's Swann Max IP Cam Page

So, I bought a cheap IP camera, which happened to be the Swann Max IP Cam. Naturally, this comes with a driver disk for windows. However, on first appearance, things are even more broken than you'd expect. The Max-IP-Cam requires an ActiveX control to stream video! For me, this wouldn't even install properly under windows XP - I suspect that I could have got it going, but why bother since I wanted to use Linux anyway. :-)

A bit of hacking around and I managed to download the binary of the ActiveX control (under Linux of course). It's a .cab file called view.cab. I then extracted the actual ActiveX control from the .cab file - a file called com1024.dll. Running strings on this file gave a very small list of possible candidate URLs that the camera responds to. A quick bit of trial and error with wget determined that the camera would send some sort of video data in response to a request like this 'http://camera/cgi-bin/Stream?Video?Acc=account?Pwd=pass?webcamPWD=FREE' where account is your setup account name and pass is the corresponding password and camera is the name or IP of the camera.

Next step was to decipher the video data that I got. Fortunately, that was very simple - the camera simply sends a sequence of JPEG files with a short preamble beforehand which doesn't seem very meaningful. A downside of this is that the camera doesn't follow any standard that I could determine (and in fact the JPEG files that the camera sends are not standards compliant either!).

So, what to do?

I wrote a small wrapper program in Python that makes the camera appear to be a standards compliant camera (well largely).

Download the wrapper: maxipcam-wrapper-0.7.py Fixed version!

Older versions: maxipcam-wrapper-0.6.py maxipcam-wrapper-0.5.py maxipcam-wrapper-0.1.py

I use the wrapper with zoneminder which works fine.

You should also be able to point a web browser at the address http://host:port/ where host is the name or IP address of the computer running the wrapper and port is the local port that you set (default is 8000). I've had issues with some browsers not actually displaying the images as data arrives - I think this was a browser bug.

Known issues

  1. The script expects the camera to be set in 640x480 mode.
  2. The JPEG data created by the camera is not standards compliant - you'll get warnings about extra or spurious bytes before marker XXXX. I have implemented two quick fixes - one involves re-encoding the JPEG data and the CPU load is not really worth it and the other doesn't always work (but does improve things).
  3. Documentation is minimal to non-existent
  4. zoneminder has latency issues with remote cameras when the frames per second is set to a small value. See patch at http://www.zoneminder.com/forums/viewtopic.php?t=10464

Future work

  1. control of camera functions
  2. clean up of the JPEG data without re-encoding - should be possible to drop the spurious bytes - but will need to correctly interpret the JPEG image contents.

Last modified: Aug 2008 - d.austin@MAPScomputer.org (remove the MAPS)