Re: XForms: Frame grabber app?

William M. Siever (bsiever@umr.edu)
Sat, 30 Aug 1997 15:12:12 -0500

To subscribers of the xforms list from "William M. Siever" <bsiever@umr.edu> :

mike rushford wrote:
>
> To subscribers of the xforms list from mike rushford <rushford@wenet.net> :
> Has anyone worked a frame grabber - video application using Xforms?

Well, I just started a VERY simple application for my Linux box:

Hardware:
Capture:
Hauppauge Win/TV PCI TV Tuner (Cheap and has multiple uses)
Note: this is for PC's only and uses /dev/bttv

Machine:
P-133 Running Linux 2.0.xx, Diamond Stealth 64 PCI video card.

Software:
Driver:
The bt848 driver for linux
http://www.thp.uni-koeln.de/~rjkm/linux/bttv.html

Xforms/etc.
I used the frame grabber example that comes with the driver(grab.cc)
Basically, it allocates memory, sets up the card, and does an ioctl
call to grab a frame into the memory.

It grabs the frames with 3 bytes for each pixel - the example
provided writes this value out to a .pnm file (Portable Anymap).
Anyway, after looking around a little I realized that this
was almost identical to a XImage (xlib). Since I knew I could write
XImages to a forms canvas, I created a canvas in a form, made an
XImage with the data and used XPutImage to display
the frame in the canvas.

(I've also attempted to do direct graphics access, but it's not
stable - I need to put a lot more thought into it...)

Application:
I wrote a simple application that just grabs frames and displays
them. By using the idle callback to get frames I was averaging ~10
frames per second.

By doing a loop on fl_check_forms() loop rather than a idle callback
I was able to get about 15 frames per second.

I should note that even in a non X-app. I only get
about 15 frames per second. (i.e. when I'm only
grabbing frames, and not displaying or processing them)

P.S. Anyone know where I can get a simple/cheap color video camera?
(All I need is something I can focus and that has NTSC video out)
(I'm hoping to do a little work with simple image recognition)

--
Bill Siever
bsiever@umr.edu
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
Xforms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/