I’m having issues capturing from a DataPath Vision E2s capture card.
I’m running Windows 7 x64, with Panda 1.7.2. Previewing the videos in the preview software that comes with the card looks fine. Creating a test graph and routing the capture into a renderer in GraphEdit also works fine.
Here’s the code that I’m using:
from pandac.PandaModules import *
from direct.directbase import DirectStart
# manually select the video mode
option = WebcamVideo.getOption(0)
cursor = option.open()
videoTexture = Texture('movie')
# calculate the same as openCVTexture has as function
videoTextureScale = Vec2(option.getSizeX()/float(videoTexture.getXSize()), option.getSizeY()/float(videoTexture.getYSize()))
# under windows the webcam must be updated manually
cursor.fetchIntoTexture(0, videoTexture, 0)
# generate a card to show the texture on
cardMaker = CardMaker('cardMaker')
# define the card size
# set the uv coordinates of the card, y-scale must be reversed
# create a card and attach to render
card = render.attachNewNode(cardMaker.generate())
# rotate it
And here is the result I’m getting:
I’ve had other issues with other capture cards that I never was really able to solve, but I’ve never even seen the “Could not select desired video resolution” error before.
I tried excluding OpenCV, but I think I need it for what I’m testing (do I?), and although it did compile, it resulted in an error when running the test script:
Seems like it might be referencing some stuff incorrectly though, as the path to my test build is actually
so I’m not sure why it’s looking in the original Panda3D build… my panda.pth file specifies the aforementioned path.
I’m obviously doing something wrong, but am not sure where to go next.
Well, first, I’d suggest uninstalling any previous versions of Panda to guarantee that you don’t get it conflated with the version you’re trying to run. (If you’re careful setting up your environment, you can keep multiple Pandas installed in parallel, but you do have to be careful, and it appears that you’re getting some bleed-through so something’s not quite right in your environment.)
And the next thing is, you’ll have to fix that compilation error before you can run your dev build. Which compiler are you using? One easy (and hacky) thing to do is to put “typedef long ssize_t;” in the beginning of openCVTexture.h.