Re: XForms: Frame grabber app?

William M. Siever (
Sat, 30 Aug 1997 15:12:12 -0500

To subscribers of the xforms list from "William M. Siever" <> :

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

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

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

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

The bt848 driver for linux

I used the frame grabber example that comes with the driver(
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...)

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
To unsubscribe, send the message "unsubscribe" to or see
Xforms Home Page:
List Archive: