SMIL : You're on Davis WebCamera

It is the nature of most webcams that they capture and save to disk still images as JPEG files. The basic problem: how do you display a sequence of these JPEG stills successively to suggest to the viewer live video rather than still imagery? The three most common methods:

  • native browser support of "Motion JPEG" MIME encapsulated multi-part JPEG streams;
  • Display of "Motion JPEG" using ActiveX technology;
  • or Display of "Motion JPEG" using Java technology.

Only "Mozilla" class browsers display "Motion JPEG" natively. Java VM is not pre-installed on Windows XP systems. Internet Explorer supports ActiveX technology, but only if manually enabled by a user with administrative rights.

Client has a Windows XP laptop. Client admits to having minimal IT skills and being easily frustrated by things that don’t work and he doesn’t understand. Somehow, Java VM was installed on his laptop (and the one in the conference room across the hall from his office). Client searched for examples of other schools and colleges who were building things like the Davis Center and who had webcams. Apparently, the ones he originally bookmarked as exemplary were using Java, because they "just worked" on his laptop. Existing UVM examples did not work and were considered sub-standard, because his Internet Explorer security settings disallowed ActiveX. He also purchased some network cameras that shipped with a Java applet solution, partly because the examples on the vendors web site "just worked."

After I changed his IE security settings, his exemplary list grew to include ActiveX examples, but his graduate student assistant web developer had difficulties making the UVM examples work — including the ones I developed using his new cameras, both with ActiveX and Java. The difficulty was the same: either Java was not installed or the target machine’s IE setting were not or could not be set correctly.

 So, we needed another solution. Some googling suggested scripting QuickTime Player with Synchronized Multimedia Integration Language (SMIL, pronounced "smile"). I created a SMIL file that essentially directed QuickTime to display a sequence of JPEG images. One hurdle was that the URL of the image never changes: the image to display is replaced by a new model every few seconds via FTP upload from the camera. So the URLs in the SMIL file had to be perturbed by a random number to appear differently. Another hurdle was that including more than about 10 or 20 images references in the same SMIL file created unsatisfactory performance. This was solved by using a QuickTime specific SMIL extension to reload a new SMIL file at the completion of the first. The SMIL files are created dynamically (and refreshed dynamically) by a PHP script; the QuickTime Plug-in is invoked via HTML. Of course, QuickTime, too, must be downloaded and installed before this all works, but I submit that — especially in the age of the iPod — QuickTime is more ubiquitous and less forbidding than Java, and is unlikely to be as bburdensome upon the user.

About Wesley Wright

Born on a mountain top near New York City, Craziest state in the land of the pretty. Raised in the woods so's he knew every tree, Killed him a bear when he was only three.
This entry was posted in Projects, Video and Audio. Bookmark the permalink.

Leave a Reply