Using the Sanyo digicam with Linux
The Sanyo digicam (or VPC-G200) is a mid range consumer digital camera
that offers a wide variety of features and good quality at a
comparatively reasonable price (in Summer 1997 at least). The camera
comes with software for Microsoft Windows 3.1 or 95 (it works with NT
4.0 too) that allows picture downloading, a useful degree of camera
control and some image organisation and manipulation.
This web page describes information I have collected and my experiences
using this camera with the Linux operating system. Most of this
information is equally applicable to any UNIX like operating system.
You can find out more about the Sanyo digicam from
What you will need
Here is a list of software you will need to get started...
Putting it all together...
These are the scripts that I use with my Sanyo...
dcgetall connects to the camera and downloads all
the pictures in it. It checks the camera connection (by calling dcnpics), downloads all the images and processes each
file with jpgprocess.
jpgprocess renames a file to a name based on
its unique picture number and if the file is a movie it creates an
animated GIF by calling jpgtogifanim.
jpgtogifanim takes a Sanyo movie file, splits
it into frames and merges them into an animated GIF file that can be
used on the web. It examines the movie file to determine the appropriate
frame rate for the GIF (5 or 10 frames per second) according to which
movie mode was used.
You can download all the
scripts in one archive.
Notes on using these scripts...
- I connect my camera to my second serial port. If you don't then you
will need to edit references to /dev/cua1 in the
dc* scripts.
- Some of the scripts check for the connection to the camera and loop
until they find it and some assume it is already there. That's why
dcgetall calls dcnpics but ignores the
result. This is necessary because the camera connection is quite
sensitive to timing used on the serial port - occasionally it doesn't
work first time.
- With some modification it is probably possible to use the scripts
with other cameras that camediaplay supports, such as the Olympus
Camedia range (surprisingly...), but I don't know what their JPEG files
contain.
- Once you have download your images you can use xv
to organise them into directories.
The scripts, and camediaplay, are works in progress. It's enough to
download images and means I don't have to boot into MS windows but there
is a lot that can't be done yet. Areas for improvement include
- Deleting images from the camera. It's easy to do on the camera, but
it would be nice to automate it.
- Getting audio from the camera. This needs investigation... I
haven't found where the audio is stored or how to get at it.
- Controlling the camera. This would allow scripts for time lapse,
automated shoot and download applications and whatever else...
I wrote these scripts for my own use, so they could be more polished.
If you have problems with the scripts then let me know at
mrd@ecs.soton.ac.uk and I'll try to help. If you add
any good features then I'd like to know too!
Sanyo JPEG files
The Sanyo stores its images internally as JPEG files. When pictures are
transferred from the camera to a computer the files are simply copied
across the serial link to the computer and stored on disk.
The Sanyo JPEG files contain a set of fields and values that record
information about the camera, the picture and the camera settings when
the picture was taken. This table summarises what I have guessed about
them so far...
Sanyo JPEG fields
| Field
| Description
|
|---|
| TimeDate
| picture capture time in secs since 1970, -1 if not set
|
| Shutter
| shutter speed in microseconds
|
| Flash
| 1 if the flash was used, 0 otherwise
|
| Resolution
| 1 for standard, 2 for high or movies
|
| Protect
| picture protected? untested
|
| ContTake
| movie type, 0 for stills, 16-10 for 10 fps, 16-5 for 5 fps
|
| Type
| Camera type, SR4 for this model
|
| Serial#
| serial number, no value
|
| Version
| firmware version?, v04-73 for my camera
|
| ID
| camera id, settable from software
|
| PicLen
| picture length in bytes
|
| ThmLen
| thumbnail length in bytes
|
| P#
| sequential picture number, can it be reset?
|
| QF
| JPEG Q value?
|
| Rg
| Red, Green, Blue, Alpha? Maybe to do with the white balance or light level?
|
| Gg
|
|
| Bg
|
|
| Ag
|
|
| FSadj
| Fstop? 70=small aperture, 57=larger
|
| s0
| Lots of comma separated numbers...
|
| T0
| More comma separated numbers...
|
If you know what some fields mean where I have ?s then
let me know. It might be useful for software applications... I have
worked out that the indication of audio associated with a picture is not
stored here anywhere.
Acknowledgements
Special thanks to itojun for camediaplay. Thanks to all who create and
contribute to the utilities that make using this camera with linux
possible.