Using qvplay(1) to control a Casio QV-10 camera from Linux.


Contents:


This page last updated on Sat Apr 20 16:53:45 EST 2002
$Revision: 1.4 $

1. Introduction

In the continuing battle with the Evil Empire, I have recently reduced my dependance on Them by one application - I discovered a way to use my Casio QV-10a digital camera with Linux.

This article is a simple HOWTO on the method I used - hopefully to encourage more people (and perhaps Casio?) to use Linux.

One of these days, every peripheral will ship with Linux drivers and support software - until then, let's "share and enjoy"! (Douglas Adams, Hitchhikers Guide to the Galaxy).

2. The Casio QV-10 Camera

Describing the camera in full is probably best left to Casio but suffice to say that it has:

The resolution of the pictures is adequate for simple Web page purposes but nowhere near as fine grained as some of the models recently come on to the market. By comparison, a Kodak PhotoCD image digitised from a 35mm slide or film would be about 3000x2500 pixels - about 100 times the number of pixels. On the other hand, while the resolution is so-so, the roughly 25-kbyte files that are produced are reasonably fast to download with todays modems.

It is quite possible that Casio's proprietary CAM format is superior to others for certain purposes - I am no graphics expert - but it is certainly no good for Web pages without conversion to JPEG or GIF files. The Windows software that Casio provides makes it very easy to convert a file to one of these other formats - but as no batch conversion program is provided, it is very laborious to convert more than one or two files. The process for each conversion is:

  1. open CAM image on PC (10 seconds on my 486)
  2. Pull down File|Export menu or hit ^E
  3. Pull down Format|JPG
  4. Type in new file name (.jpg extension is provided automatically!)
  5. Hit OK
On one file this is OK, but on 96 shots - forget it!

Contents

3. The qvplay(1) software

qvplay(1) was written by ken-ichi HAYASHI and Jun-ichiro "itojun" ITOH to control the QV-10 and it is really great!!!.

With qvplay(1) running on Linux you can:

In other words, pretty much everything you can do with the Casio software except for managing Casio's photo-albums.

You may not be surprised that qvplay(1) on Linux is about 30-kbytes in size as an executable whereas on Windows the Casio qvlink software takes up about a megabyte. The price of GUI or just old fashioned Windows bloat?

As qvplay(1) is a batch or command-line program it is not as easy for the novice to use but is very powerful for someone willing to read the manual page and customise scripts.

It seemed to me that the quality of the pictures from qvplay(1) was rather better than from the QV-LINK software provided with the camera - apparently, some older versions of QV-LINK do some automatic re-touching of the pictures which seems to rather get in the way.

Also included in the qvplay(1) package were two utilities:

qvrec(1)
To send CAM files to the QV-10 camera
qvalldel(1)
To clear the camera's memory
Contents

3.1 Getting the software

I used version 0.92 of qvplay(1). To find it, just use HotBot, Excite! or another search engine to find qvplay-0_92_tar.gz and download from the site nearest you.

You might also try ken-ichi HAYASHI's home pages in English or Japanese.

Contents

3.2 Configuring

This really couldn't be easier - just expand the distribution file and follow the instructions. A setup script is provided that worked just fine "out of the box" - I am using RedHat Linux 4.1 with a 2.0.18 kernel.

One thing you might want to tinker with is the default serial port for qvplay(1) to use - I changed the supplied default of /dev/cua1 to /dev/cua0. Once you're happy it's working, just do a strip on the executables and make install.

Contents

3.3 Cameras supported by qvplay(1)

According to the source code, qvplay(1) appears to support the following cameras: The only camera I have tested is the QV-10.

Contents

3.4 Manuals

I wrote a couple of manual pages for the software (not in the original distribution) which you can read or download by clicking here:

Plain text:

HTML version (run through groff2html): man(1) source for ngroff/groff: Contents

3.5 Handy scripts for qvplay

Once I got the hang of qvplay(1) I wrapped it up in a couple of simple scripts to do the things I normally do without reading the manual pages. Here they are:

get_a_pic A simple script to get one photo.

get_all_pics Another way to get all the photos from the camera.

3.6 Postprocessing of JPEG files

There is just one simple but weird thing that you have to do after converting from CAM to JPEG with qvplay(1) and that is to fix the size of the JPEG images (see the get_a_pic(1) script). I must confess I don't fully understand what's going on here but apparently the images come across as 480x240 pixels and you need to change them to an aspect ratio of 4:3 or 320x240 pixels.

You can do this with the xv(1) program (use the -4x3 option) or by using the Independent JPEG Group's commands, djpeg(1) and cjpeg(1) together with the Poskanzer portable bitmap utilities:

qvplay -g 1 | djpeg | pnmscale -xsize 320 -ysize 240 | cjpeg >
foobar.jpg
These utilities are normally found on the various Linux distributions.

Contents

4. Using a WWW browser to view files

You can view your JPEG files quite nicely with xv(1) or with a WWW browser such as Netscape. In the later case, you might want to generate HTML index files for your shots using something like the following automatic procedure.

Assuming your JPEG files are sitting in a directory - e.g. I keep all the files from one day's shooting together under a directory labelled with the date, something like ~/photos/971128/*.jpg - I then run the following script on them to create an index page viewable by the browser. This could be put into a Makefile:

   (cat hdr
    ls $i*.jpg |sed "s/^/<IMG SRC=\"/" |sed "s/$/\">/"
    cat tlr) > index.html
The files hdr simply contains a standard HTML startup:
<HTML> 
<HEAD> 
  <TITLE>Photo viewer</TITLE>
  <META NAME="Author" CONTENT="Bob Hepple">
</HEAD>
<BODY>
<H1>Photo viewer</H1><HR>
Similarly, trl contains your standard HTML wrapup script:
<P>
<HR>
<ADDRESS>
<A HREF="mailto:bhepple@pacific.net.sg">Bob Hepple</A> <P> Copyright © 1997 Bob Hepple. All rights reserved.
</ADDRESS>
</BODY>
</HTML>
Contents

5. Other programs for the Casio QV-10

5.1 qvplaytk(1) - A graphical user interface for qvplay(1)

There is also a tcl/tk wrapper for qvplay(1) which provides a GUI interface. Here is a screenshot of the program, which can be found at the author, Mr. Amano's homepage

As a tcl/tk script, qvplaytk(1) is very easy to configure and adapt. For example, you might like to change the obscure "G", "S" and "T" buttons to, say, "Get", "Save" and "Take".

One very nice feature of qvplaytk(1) is that the "Take" mode allows you to take a photo every N seconds - this could be used in a remote monitoring application, or perhaps for those strange web sites which offer a changing view of the level of the coffee in the kitchen. Or just keep an eye on your kids...

Apart from qvplay(1), qvplaytk(1) requires tcl 7.4 and tk 4.0 or tcl 7.5 and tk 4.1. It also relies on xv(1) for the viewing functions.

Contents

5.2 cam2jpeg - converts Casio CAM files to JPEG or PPM

Itojun also wrote cam2jpeg (sometimes written as camtojpeg) as a filter to batch convert CAM files to JPEG or to PPM formats. It works with a whole range of Casio products that output the CAM format such as the QV-10, 10A, 30 and 100.

It can also be found through ken-ichi HAYASHI's as above.

Contents

6. Samples of pictures

The camera works well in full daylight, as in this scene of the Singapore River from the famous "Boat Quay":

as well as in very low light conditions, in one of the wonderful food centres, "Lau Pau Sat" in the business district:

Contents

since March 18th 1998


This site built with Linux

This page last updated on Sat Apr 20 16:53:45 EST 2002
For corrections/additions/suggestions for this page, please send email to: Support

Copyright© 1997-2002 Bob Hepple. All rights reserved.'