A display and and recording interface for the Q-Tec100 webcams with PAC207 chip

Adds date and time in display to your recordings

This will also work with some other v4l webcams, tested now stv0680

copyright Jan Panteltje twenty first century
addional code by and copyright of:
Michel Xhaard
Robert Light

released under GPL 2

jpcat is a display and and recording interface for the Q-Tec100 webcams with PAC207 chip, and should also work with many other webcams.
It requires the video4linux module videodev installed, and the spca5xx driver.
This version has been tested with the Logitech Quickcam 2500 USB webcam, you need to install the included modified driver if you use kernel 2.6.21.
lsm info file

older spca5xx drivers

Please note:
A new patched gspca driver for kernel 2.6.21 is included in the jpcat-0.1.4.tgz archive.
jpcat will only work with the Logitech Quickcam 2500 in kernel 2.6.21 with this new driver.

Please try
jpcat -h
for a list of all options and defaults.

## Show only X display
# jpcat -t -a -u -x

## X display and output to mplayer
# jpcat -t -a -y -u | mplayer -

## See the included file start-qtec for a script to use the Q-Tec-100 webcam with PAC207 chip as
## a 2fps security cam recording in H264 indoors with artificial light.

# jpcat does not use SDL, but directly writes to X.
# It can also send mjpeg tools YUV format to stdout.
# And it can even write mjpeg tools YUV to stdout only when motion happened, so you end up with a short file with only the interesting info.

# jpcat can grab single jpg pictures.
# It can also grab single ppm pictures with time and date added in display.

# jpcat has a spot light measurement, it will draw that measurement area on screen when adjusting.
# This indicator is not present in the yuv output for recording.
# It will try to set max contrast in the spot area only.

# jpcat has a motion detection feature too.
# This works only if also the -y flag is specified.
# When motion occurs, then a semaphore file is created as flag, ~/jpcat.motion
# the idea is that an other application, for example a shell script that runs as root, checks
# if ~/jpcat.motion exists, then does something (anything), then erases ~/jpcat.motion.
# That way every time motion occurs in the picture some action can be taken.
jpcat -t -a -u -x -m 1000 -y 1>/dev/zero

# It is possible to at the same time display and record to H264 with a script like this:

mkdir /video

killall -KILL spcaserv
killall -KILL spcaview

rmmod spca5xx
modprobe spca5xx compress=1 GGreen=300 GRed=300 GBlue=300

sleep 1

serial_number=`/bin/cat /video/qtec_serial.txt`
/bin/echo "serial_number=$serial_number"

nice -n 19 \
jpcat -t -a -u -x -m 1000 -f 2 -y 2> /dev/zero | \
nice -n 19 \
ffmpeg -f yuv4mpegpipe -i - -f avi -vcodec h264 -r 2 -b 10 -g 300 -bf 2 \
-y /video/camera-qtec.$serial_number.avi \
2>/dev/zero 1>/dev/zero

/bin/echo "updating serial number"
let serial_number=serial_number+1
/bin/echo $serial_number > /video/qtec_serial.txt

If you want nice subtitles, moving title rolls, effects, or pictures mixed,
try piping the output via subtitler-yuv-0.6.5.tgz like this:
jpcat -t -x -b 35 -w 82 -y | subtitler-yuv -c 32 -p demo-yuv.ppml | mplayer -
(demo-yuv.ppml and the font is in the subtitler-yuv tgz distribution)