the sample of using Video As Texture

Is there any sample on the web or a bit of source code of

using video as texture? I want basically the 'Video (LIVE)

coming from a source (like USB Webcam/Other Capture

Device) to be loaded as a Texture. Will appreciate any

type of help in this regard.

i’m currently working on a project that uses captured video camera input as textures. to actually capture the image i’m using the cvcam code in intel’s computer vision library. if you want to check it out (openCV), here’s the address: they provide a simple example that shows how to capture the image to an array. at that point, you can just build an opengl texture as usual.

[This message has been edited by lost hope (edited 06-18-2003).]

[This message has been edited by lost hope (edited 06-18-2003).]

I think nehe has a tutorial on using an avi as a texture…

I had written such a program using DirecShow(for video capturing)and “glTexImage2D”, “glTexSubImage2D” functions,but I found the “glTexSubImage2D” can damage the performance of system,it will consume extra 150MHz of my 1.5G P4 CPU.I am not sure it is the problem of “glTexSubImage2D” or my computer(1.5G P4+768M SDRAM+Geforce Ti4200),but I found a similar sample in DirectX SDK and it will not consume any extra resource of CPU.I don’t how to use DirectX,so please give me some sample code or doc,so I can rewrite my program to improve performance.

Did the Dx demo use the video input as a texture? I only remember having seen a video capture demo in the Dx SDK - it probably just uses GDI based functions to display the data - which is quite a bit different to if it used that data as a texture.

Are you trying to put the video feed onto an 3D object? Or are you simply trying to display it? glTexSubImage2D is going to be your best bet (unless some extensions out there can speed this process up).

For performance issues I would suggest you read jwatte’s post in the following thread.

the DX demo using the video input as texture,and the implement way is similar with my app,but it use lower CPU usage than my app.The CPU usage is costful for my app,so I’m still finding a way of reducing the CPU usage.