PDA

View Full Version : Displaying live video in Vizard?


Deltcho
12-21-2007, 10:41 AM
Hi!

I'm interested in displaying a live video feed in Vizard (coming from either a camcorder or webcam attached to the computer).

I haven't been able to find anything about doing such a thing in the Vizard tutorials, so I am hoping someone here might be able to help.

Assuming this is possible; I also wish to be able to add a custom delay (200 -1000 ms) between the live feed and what is displayed on screen. To do this I would need to buffer a couple of seconds of the live video and play it back, but once again, I am unsure about how I would do such a thing in Vizard. :confused:

-Deltcho

farshizzo
01-04-2008, 10:08 AM
Here is some sample code that will connect to a webcam, add a delay of 30 frames to the live feed, and apply the texture to a quad:import viz
viz.go()

#Create VideoCamera extension
video = viz.add('VideoCamera.dle')

#Connect to webcam
cam = video.addWebcam()

#Add delay of 30 frames to live feed
cam.setDelay(30)

#Apply camera texture to a quad
quad = viz.add(viz.TEXQUAD,pos=(-1,1.8,4),texture=cam)We rewrote the webcam plugin to support multiple webcams and DV cameras. This new version will be documented and available in the next release, which should be in a few weeks.

Deltcho
01-04-2008, 11:05 AM
Great! This is just what I was looking for.