= FrameGrabber = The Integral Technologies !FlashBus Spectrim Lite is a PCI frame grabber which is currently installed on the m25 machine outside the control room at the 40m. It is hooked up to the "ul4" video feed on the C0VIDEO MEDM screen. Right now, the only way to access the frame grabber is to issue an ssh command to m25 under the username jweiner (e.g., ssh jweiner@m25 "/home/jweiner/capimgf my_image.ppm") and then copy the resulting image to the local computer. The Solaris and Linux machines on the Martian network can log in as jweiner@m25 without having to enter a password. '''I. Features ''' . [[http://www.integraltech.com/FileDownloads/fe8349_FB_SpectrimLite.pdf|Official Info Sheet]] on the Integral Technologies !FlashBus Spectrim Lite Notable features: * 16 MB of memory * S-Video and BNC inputs * Good support for Windows but not much for Linux or anything else * Max. resolution of 640x480 in NTSC mode '''II. Installation''' Video For Linux (V4L) installation software can be found on Integral Technologies's website: http://www.integraltech.com/FileDownloads/e2245e_spectrim-v4linst-v2.5.tgz Compiling and installing this software should be enough to get the card up and running. The release notes state that the software has been tested on Fedora Core 2 and 4 but it also works on FC3 (with lots of bugs). After installing the software, make sure to specify the amount of memory available to the card in grub or lilo as described in the README.mem file! Otherwise, V4L programs (including the test programs that come with the card's software) could crash the computer. Also, make sure to run the startFbspSupt script included in the support directory. This program will output a "test.bmp" file so you can tell if your card is working. '''III. Software ''' . There are a lot of V4L applications which have a large number of dependencies and which crash a lot. The better ones I have found for the Spectrim are: '''1. videodog '''([[http://paginas.terra.com.br/informatica/gleicon/video4linux/videodog.html|Homepage]]) videodog is a simple capturing utility which is good for capturing single images from the frame grabber. It has some useful features, like optional JPEG capture and timestamps in the image, as well as optionally automatically timestamped file names so that it can be run easily from scripts (including Matlab). The loop capture has a bug which makes it output junk to the terminal, and the normal capture has a bug where there are invalid calls to the V4L API. I think these are both driver problems, but the single capture / auto-timestamped capture works. If the output is suppressed by appending ">> /dev/null 2>&1" to the end of the command it seems to work faster (i.e., looping the timestamp capture will not capture images as many times as videodog is called; it seems like commands will be lost when videodog is busy writing to stderr/stdout or capturing images). videodog is a fairly simple program to edit. A major bonus is that it hardly has any dependencies (I think the only external dependency is libjpeg which seems to be standard), so compiling it should be easy. '''2. xaw''''''tv''' ([[http://linux.bytesex.org/xawtv/|Homepage]]) xawtv is a TV application which allows you to view a live feed of the framegrabber's input, as well as capture still images in bitmap (ppm) or jpeg formats of the live feed. It has video capture capability, but as far as I can tell right now that feature either requires a lot of memory or the V4L software for the Spectrim is pretty shoddy since anything but low-framerate MJPEG capture ends xawtv in a segmentation fault or outputs a lot of errors. xawtv is the most convenient program to use to capture video (this can also be done with streamer, but no scripts have been written yet). xawtv comes with streamer, a program like videodog but more prone to crashes. streamer should also allow you to capture video from the command line, but it crashes like the video capture from the xawtv GUI (probably because xawtv uses streamer to capture video and images). motv has a cleaner GUI than xawtv itself, and comes with the whole xawtv suite of programs available on the website above. ''' CAUTION: '''Simultaneously running more than one program which uses the frame grabber will crash the machine on which it is installed! '''3. Scripts''' There are a few useful scripts which were written to quickly capture images. '''3.1 capimgf and capimgf1 ''' capimgf is on the m25 machine in the /home/jweiner/bin/ directory. capimgf calls videodog with the correct options and takes 1 command-line argument, the full file name of the image (including extension, which should be .ppm), and saves the file to the current working directory. capimgf supresses status or error messages from videodog. capimgf1 is the same as capimgf, but it does not supress status or error messages.''' ''' '''3.2 ezvidcap''' ezvidcap is a Perl script (which should be rewritten to be a shell script) which resides in /cvs/cds/caltech/users/jweiner/. It takes a case-sensitive name of a video channel from the C0VIDEO MEDM screen as its only argument (e.g., OMCT, Faraday, MC2). When called, it will switch the frame grabber (ul4) channel to the command-line argument, save an image file with that channel name and a .ppm extension in the current directory, and then change the frame grabber channel back to what it was before the script was called. This script badly needs to be rewritten to be completely a shell script, since right now it depends on a "remoteimg" shell script in the same directory which actually runs capimgf on the remote m25 machine. '''Test Image''' Here is a sample image taken at full resolution (640x480) in 24-bit color (although the video feed is black-and-white). The image is oversaturated at some points and the image is noticeably noisy. The noise is due to the AGC settings on the cameras being too high for the amount of light present. {{attachment:out.png}}