Greetings All,
I’ve tried running the attached code as well as some examples found at code.google.com/p/video-puzzle/
All give me the following error:
AttributeError: ‘libpanda.MovieVideoCursor’ object has no attribute ‘fetchIntoTexture’
[*]Running Panda3d 1.8.1 with Vista SP2 64bit on portable(integrated webcam)
Code
from direct.showbase.ShowBase import ShowBase
from panda3d.core import *
from panda3d.vision import *
class Application(ShowBase):
def __init__(self):
ShowBase.__init__(self)
for i in range(WebcamVideo.getNumOptions()):
print WebcamVideo.getOption(i)
if WebcamVideo.getNumOptions() > 0:
opt = WebcamVideo.getOption(0)
self.cursor = opt.open()
self.tex = Texture()
self.cursor.setupTexture(self.tex)
cm = CardMaker("plane")
cm.setFrame(-1, 1, -1, 1)
plane = render2d.attachNewNode(cm.generate())
plane.setTexture(self.tex)
scaleX = float(self.cursor.sizeX()) / float(self.tex.getXSize())
scaleY = float(self.cursor.sizeY()) / float(self.tex.getYSize())
plane.setTexScale(TextureStage.getDefault(),
Vec2(scaleX, scaleY))
taskMgr.add(self.update, "update video")
def update(self, task):
if self.cursor.ready():
self.cursor.fetchIntoTexture(0, self.tex, 0)
return task.cont
w = Application()
run()
Output
Known pipe types:
wglGraphicsPipe
(all display modules loaded.)
Added device: DirectShow: 0264A184:2
Added device: DirectShow: 0264A244:2
Added device: DirectShow: 0264A304:2
Added device: DirectShow: 0264A3C4:2
Added device: DirectShow: 0264A484:2
Added device: DirectShow: 0264A544:2
Added device: DirectShow: 0264A604:2
Added device: DirectShow: 0264A6C4:2
Added device: DirectShow: 0569CA34:2
Added device: DirectShow: 0569CAF4:2
Laptop Integrated Webcam: 640x480 @ 30Hz
Laptop Integrated Webcam: 1600x1200 @ 10Hz
Laptop Integrated Webcam: 1280x1024 @ 10Hz
Laptop Integrated Webcam: 1024x768 @ 10Hz
Laptop Integrated Webcam: 800x600 @ 30Hz
Laptop Integrated Webcam: 352x288 @ 30Hz
Laptop Integrated Webcam: 320x240 @ 30Hz
Laptop Integrated Webcam: 176x144 @ 30Hz
Laptop Integrated Webcam: 160x120 @ 30Hz
Live! Cam Virtual: 160x120 @ -2147483648Hz
IID_IGraphBuilder & IID_ICaptureGraphBuilder2 are established.
IID_IMediaControl interface is acquired.
The capture filter is acquired.
The capture filter has been added to the graph.
IID_IBaseFilter of CLSID_SampleGrabber is acquired.
The media type of the sample grabber is set 24-bit RGB.
The sample grabber has been added to the graph.
IID_IBaseFilter of CLSID_NullRenderer is acquired.
The Null Renderer has been added to the graph.
Connected media type 640 x 480
Traceback (most recent call last):
File "cam.py", line 25, in update
self.cursor.fetchIntoTexture(0, self.tex, 0)
AttributeError: 'libpanda.MovieVideoCursor' object has no attribute 'fetchIntoTexture'
:task(error): Exception occured in PythonTask update video
Trackback (most recent call last):
File "cam.py", line 29, in <module>
run()
File "C:\Panda3D-18.1\direct\showbase\ShowBase.py", line 2921, in run self.taskMgr.run()
File "C:\Panda3D-18.1\direct\task\Task.py", line 502, in run self.step()
File "C:\Panda3D-18.1\direct\task\Task.py", line 460, in step self.mgr.poll()
File "cam.py", line 25, in update self.cursor.fetchIntoTexture(0, self.tex, 0)
AttributeError: 'libpanda.MovieVideoCursor' object has no attribute 'fetchIntoTexture'
Any help would be appreciated