pencam-download is a simple commmand-line utility for
extracting the photos from micro-cameras based on the ST
Microelectronics STV0680B chip. This includes the Trust 300 spycam and
a heap of similar products. Only the USB interface is supported. This
software is not related to, and will not co-exist with, the kernel
Webcam driver stv0680.o (see below), but it is
straightforward to unload the kernel module when required.
There are other utilities out there that support this camera, with varying degrees of sophistication. I wrote this one because I needed no sophistication at all, just a way to dump images onto disk in JPEG format.
pencam-download requires libusb support; I
would recommend getting the latest version (which, at the time of
writing, was 0.16). libusb is part of many Linux
distributions, but is frequently not installed as part of the standard
setup. If you want to compile it, you'll need the libusb
development package, or the source code, as well as the end-user
stuff. You'll also need the popt development package,
but that seems to be a standard part of most distributions
now.
make clean make make installThis puts the single executable
pencam-download into
/usr/bin.
pencam-download --help to get a list of command-line
options. Here are some examples.
pencam-download --downloadDownload all images in JPEG format with default (85) quality into the current directory.
pencam-download --download --quality=100Download all images in JPEG format with quality 100 into the current directory. A quality of about 85 yields a reasonable compromise between file size and picture quality with STV0680 device, but you may want to experiment with other figures.
pencam-download --download --rawDownload all images as raw RGB values into the current directory. Files are saved as PNM format. This yields really big files (~1 Mb for VGA mode), and the quality isn't noticeably better than JPEG format. The only good reason to do this, I guess, is to compress with something other than JPEG.
pencam-download --download --first=0 --last=1
Get the first and second images (note that image numbers begin at zero).
pencam-download --download --prefix /tmp/photo
Get all images and store then in directory /tmp
with names beginning with `photo'. The default is to use
the current directory, and names beginning with `picture'.
pencam-download --info
Get information about the attached device
pencam-download writes files in such a way
as to avoid clashing with other files in the same directory.
That is, it doesn't number the generated files to follow the
internal numbers of the pictures in the camera.
What this means is that if you run pencam-download
--download twice with the same settings, it will
will not overwrite the files created the first time. This
is to avoid the need to download to a temporary directory
and renumber all the files (unlike more sophisticated
cameras, the STV0680 does not keep a running total
of the photos it has taken, so we can't use that to
separate goups of photos). You can also use the
--prefix=... command line switch to
set the names of the files written.
stv068 kernel
module before running this software. The two pieces of
software contend for the same USB resource. A complication
is that some Linux versions will automatically load
the kernel driver when you plug the camera in.
root, or with
root privilege. This is because it requires
direct access to the USB hardware.
Authors: